MCP servers extend Kiro's capabilities by connecting to external services and APIs. Since all MCP servers are third-party code, this introduces potential security considerations:
- Access to sensitive information: MCP servers may require API keys or tokens
- External code execution: MCP servers run code outside of Kiro's sandbox
- Data transmission: Information flows between Kiro and external services
- Source verification: Review the source code and verify the server comes from a trusted source before using
- Isolation: Run servers in isolated environments when possible and limit the permissions granted
- Never commit configuration files with sensitive tokens to version control
- Create tokens with minimal permissions necessary for the MCP server to function
- Limit access scope to only the repositories or resources needed
- Regularly rotate API keys and tokens used in configurations
- Use environment variables when possible instead of hardcoding values
{
"mcpServers": {
"github": {
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}For security, Kiro only expands environment variables that are explicitly approved. When you add or modify an MCP server configuration that includes unapproved environment variables, Kiro displays a security warning popup.
To manage approved environment variables:
- Open Kiro settings
- Search for "Mcp Approved Env Vars"
- Add the environment variables you want to allow for expansion
# 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- Review each tool request carefully before approval
- Check the parameters being passed to the tool
- Understand what the tool will do before approving it
- Deny any suspicious requests that don't match your current task
Only auto-approve tools that:
- Don't have write access to sensitive systems
- Come from trusted sources with verified code
- Are used frequently in your workflow
- Have limited scope of what they can access
Use workspace-level configurations for project-specific MCP servers to ensure:
- MCP servers only run when working in the relevant project
- Tokens and configurations are isolated between projects
- Security risks are contained to specific workspaces
- Open the Kiro panel
- Select the Output tab
- Choose "Kiro - MCP Logs" from the dropdown
- Check your MCP configuration for auto-approved tools
- Review the MCP logs for tool usage patterns
- Monitor server activity for unexpected behavior
- Remove auto-approval for tools you no longer use frequently
If you suspect a security issue with an MCP server:
- Disable the server immediately in your configuration
- Revoke any tokens or API keys associated with the server
- Check for unauthorized activity in the connected services
- Report the issue to the MCP server maintainer
- Use firewalls to restrict outbound connections from MCP servers
- Consider using a VPN for sensitive MCP server connections
- Monitor network traffic to and from MCP servers
- Keep your system updated with security patches
- Run MCP servers with minimal privileges
- Use separate user accounts for running sensitive MCP servers