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": { "server-name": { "command": "command-to-run-server", "args": ["arg1", "arg2"], "env": { "ENV_VAR1": "value1", "ENV_VAR2": "value2" }, "disabled": false, "autoApprove": ["tool_name1", "tool_name2"] } } }
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 |
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 + P
Ctrl + Shift + P
Search 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:
autoApprove
If your MCP configuration isn't working:
Validate JSON syntax:
Verify command paths:
Check environment variables:
Restart Kiro:
Configuration