This guide provides detailed information on configuring Model Context Protocol (MCP) servers with Kiro CLI, including configuration file structure, server setup, and management.
MCP configuration files use JSON format with the following structure:
{ "mcpServers": { "local-server-name": { "command": "command-to-run-server", "args": ["arg1", "arg2"], "env": { "ENV_VAR1": "hard-coded-variable", "ENV_VAR2": "${EXPANDED_VARIABLE}" }, "disabled": false, "disabledTools": ["tool_name3"] }, "remote-server-name": { "url": "https://endpoint.to.connect.to", "headers": { "HEADER1": "value1", "HEADER2": "value2" }, "disabled": false, "disabledTools": ["tool_name3"] } } }
| Property | Type | Required | Description |
|---|---|---|---|
command | String | Yes | The command to run the MCP server |
args | Array | Yes | Arguments to pass to the command |
env | Object | No | Environment variables for the server process |
disabled | Boolean | No | Whether the server is disabled (default: false) |
autoApprove | Array | No | Tool names to auto-approve without prompting |
disabledTools | Array | No | Tool names to omit when calling the Agent |
| Property | Type | Required | Description |
|---|---|---|---|
url | String | Yes | HTTPS endpoint for the remote MCP server (or HTTP endpoint for localhost) |
headers | Object | No | Headers to pass to the MCP server during connection |
env | Object | No | Environment variables for the server process |
disabled | Boolean | No | Whether the server is disabled (default: false) |
autoApprove | Array | No | Tool names to auto-approve without prompting |
disabledTools | Array | No | Tool names to omit when calling the Agent |
{ "mcpServers": { "web-search": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-bravesearch" ], "env": { "BRAVE_API_KEY": "${BRAVE_API_KEY}" } } } }
{ "mcpServers": { "api-server": { "url": "https://api.example.com/mcp", "headers": { "Authorization": "Bearer ${API_TOKEN}", "X-Custom-Header": "value" } } } }
{ "mcpServers": { "fetch": { "command": "uvx", "args": ["mcp-server-fetch"] }, "git": { "command": "uvx", "args": ["mcp-server-git"], "env": { "GIT_CONFIG_GLOBAL": "/dev/null" } }, "aws-docs": { "command": "npx", "args": ["-y", "@aws/aws-documentation-mcp-server"] } } }
When multiple configurations define the same MCP server, they are loaded based on this hierarchy (highest to lowest priority):
mcpServers field in agent JSON.kiro/settings/mcp.json~/.kiro/settings/mcp.jsonComplete override:
Agent config: { "fetch": { command: "fetch-v2" } } Workspace config: { "fetch": { command: "fetch-v1" } } Global config: { "fetch": { command: "fetch-old" } } Result: Only "fetch-v2" from agent config is used
Additive (different names):
Agent config: { "fetch": {...} } Workspace config: { "git": {...} } Global config: { "aws": {...} } Result: All three servers are used (fetch, git, aws)
Disable via override:
Agent config: { "fetch": { command: "...", disabled: true } } Workspace config: { "fetch": { command: "..." } } Result: No fetch server is launched
Many MCP servers require environment variables for authentication or configuration. Use the ${VARIABLE_NAME} syntax to reference environment variables:
{ "mcpServers": { "server-name": { "env": { "API_KEY": "${YOUR_API_KEY}", "DEBUG": "true", "TIMEOUT": "30000" } } } }
Make sure to set these environment variables in your shell before running Kiro CLI:
export YOUR_API_KEY="your-actual-key" export DEBUG="true"
To temporarily disable an MCP server without removing its configuration:
{ "mcpServers": { "server-name": { "disabled": true } } }
To prevent an agent from using specific tools from an MCP server:
{ "mcpServers": { "server-name": { "disabledTools": ["delete_file", "execute_command"] } } }
To see which MCP servers are currently loaded in an interactive chat session:
/mcp
This displays all active MCP servers and their available tools.
Validate JSON syntax
Verify command paths
Check environment variables
Review configuration loading
# Check workspace config cat .kiro/settings/mcp.json # Check user config cat ~/.kiro/settings/mcp.json
When configuring MCP servers, follow these security best practices:
${API_TOKEN}) instead of hardcoding sensitive valuesdisabledTools to restrict access to dangerous operationsFor comprehensive security guidance, see the MCP Security Best Practices page.
Configuration