This guide provides detailed information on configuring Model Context Protocol (MCP) servers with Kiro, including configuration file structure, server setup, and best practices.
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": "value1", "ENV_VAR2": "value2" }, "disabled": false, "autoApprove": ["tool_name1", "tool_name2"], "disabledTools": ["tool_name3"] }, "remote-server-name": { "url": "https://endpoint.to.connect.to", "headers": { "HEADER1": "value1", "HEADER2": "value2" }, "disabled": false, "autoApprove": ["tool_name1", "tool_name2"], "disabledTools": ["tool_name3"] } } }
| 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 |
| 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 |
You can configure MCP servers at two levels:
Workspace Level: .kiro/settings/mcp.json
User Level: ~/.kiro/settings/mcp.json
If both files exist, configurations are merged with workspace settings taking precedence.
Open the command palette:
Cmd + Shift + PCtrl + Shift + PSearch for "MCP" and select one of these options:
{ "mcpServers": { "web-search": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-bravesearch" ], "env": { "BRAVE_API_KEY": "your-api-key" } } } }
Many MCP servers require environment variables for authentication or configuration:
{ "mcpServers": { "server-name": { "env": { "API_KEY": "your-api-key", "DEBUG": "true", "TIMEOUT": "30000" } } } }
To temporarily disable an MCP server without removing its configuration:
{ "mcpServers": { "server-name": { "disabled": true } } }
When configuring MCP servers, follow security best practices to protect your credentials and system:
${API_TOKEN}) instead of hardcoding sensitive valuesautoApproveFor comprehensive security guidance, see the MCP Security Best Practices page.
If your MCP configuration isn't working:
Validate JSON syntax:
Verify command paths:
Check environment variables:
Save configuration changes:
Configuration