Use these practices to limit MCP server access, protect credentials, and verify the code you run.
MCP servers extend Kiro's capabilities by connecting to external services and APIs. Since MCP servers are third-party code, this introduces security considerations:
The MCP security model is designed with these principles:
Instead of hardcoding tokens in your configuration:
{ "mcpServers": { "github": { "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" } } } }
Set the environment variable in your shell:
export GITHUB_TOKEN=your-token-value
For security, Kiro IDE only expands environment variables that are explicitly approved. Only variables in the approved list will be expanded when found in MCP config files.
When you add or modify an MCP server configuration that includes unapproved environment variables, Kiro displays a security warning popup listing the variables that need approval. You can approve them directly from the popup or manage them in settings.
To manage approved environment variables:
This prevents MCP servers from accessing arbitrary environment variables on your system.
Restrict access to your MCP configuration files:
# Set restrictive permissions on user-level config chmod 600 ~/.kiro/settings/mcp.json # Set restrictive permissions on workspace-level config chmod 600 .kiro/settings/mcp.json
Only auto-approve tools that:
{ "mcpServers": { "aws-docs": { "autoApprove": [ "mcp_aws_docs_search_documentation", "mcp_aws_docs_read_documentation" ] } } }
disabledTools to restrict access to dangerous operations:{ "mcpServers": { "github": { "disabledTools": ["delete_repository", "force_push"] } } }
On your own machine, the local command sandbox can start stdio MCP server processes inside the same OS-level sandbox it uses for the agent's shell commands. Set mcpSandboxing to true in your sandbox configuration; the server then runs under the same network mode and sandbox_network host rules as sandboxed commands. Remote HTTP and SSE servers are not affected, and their network access does not follow sandbox rules.
See Local command sandbox for setup, platform requirements, and what happens when wrapping fails.
Use workspace-level configuration to keep each project's MCP server list separate:
project-a/ ├── .kiro/ │ └── settings/ │ └── mcp.json # Project A specific servers project-b/ ├── .kiro/ │ └── settings/ │ └── mcp.json # Project B specific servers
Kiro starts a project's workspace servers only when that project is open. Workspace configuration separates server lists; it does not isolate server access. Without the local command sandbox or other OS restrictions, a workspace server can still access the files, credentials, environment variables, and network resources available to your user account.
Periodically review which tools you've approved:
If you suspect a security issue with an MCP server:
Best practices