Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

MCP Configuration: ${input:} System for Secure API Keys Not Working

Open punkyard opened this issue 1 year ago • 2 comments

Before opening, please confirm:

Operating System

darwin

Kiro Version

0.1.9

Bug Description

The MCP configuration system with ${input:} variables for secure API key management is not functioning as documented. According to the official documentation and forum discussions (like Cursor's forum), Kiro should support a secure input system similar to VS Code where:

  1. API keys are defined in an inputs section
  2. Referenced using ${input:variable_name} syntax
  3. Kiro prompts for the keys securely on first use
  4. Keys are stored encrypted by the IDE

Current Behavior:

  • MCP servers connect but don't prompt for API keys
  • Services that require authentication fail with credential errors
  • No secure prompt appears despite proper configuration

Configuration Used:

{
  "inputs": [
    {
      "id": "brave_api_key",
      "type": "promptString",
      "description": "Brave Search API Key", 
      "password": true
    },
    {
      "id": "github_token",
      "type": "promptString",
      "description": "GitHub Personal Access Token",
      "password": true
    }
  ],
  "mcpServers": {
    "brave-search": {
      "command": "npx",
      "args": ["-y", "mcp-server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "${input:brave_api_key}"
      },
      "disabled": false,
      "autoApprove": ["brave_web_search"]
    },
    "github": {
      "command": "npx", 
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Steps to Reproduce

  1. Configure MCP servers with ${input:} variables in .kiro/settings/mcp.json
  2. Add corresponding entries in inputs section
  3. Restart Kiro completely
  4. Try to use a service requiring API authentication (e.g., Brave Search)
  5. Observe that no prompt appears and service fails with authentication error

Expected Behavior

  1. On first use of a service requiring API keys, Kiro should prompt securely for the key
  2. The prompt should be masked (due to "password": true)
  3. The key should be stored securely by Kiro
  4. Subsequent uses should work without re-prompting
  5. Services should authenticate successfully

Conversation ID

No response

Additional Context

Evidence of the issue:

  • SQLite MCP server works (no authentication required)
  • Brave Search fails with "SUBSCRIPTION_TOKEN_INVALID"
  • GitHub MCP works without token (public API access only)
  • No secure prompts ever appear

References:

  • Similar system discussed in Cursor forum: https://forum.cursor.com/t/secure-input-support-for-mcp-server-configuration-e-g-api-keys/101910
  • This appears to be a VS Code-style input system that should work in Kiro

Impact: This prevents secure usage of MCP servers requiring authentication, forcing users to either:

  1. Hardcode API keys in configuration files (security risk)
  2. Use environment variables (less convenient)
  3. Avoid authenticated MCP servers entirely

Workaround: Currently using environment variables, but this defeats the purpose of Kiro's intended secure configuration system.

punkyard avatar Jul 17 '25 04:07 punkyard

Hi @punkyard ,

Can you please update KIRO to the most newest and recent version i.e 0.2.38 and retry this configuration. Thank you!

harshchheda-aws avatar Sep 10 '25 14:09 harshchheda-aws

Hi 👋, we're closing this issue due to inactivity. If you're still experiencing this problem, please create a new issue with detailed information so we can investigate and provide the support you need.

AnilMaktala avatar Jan 08 '26 15:01 AnilMaktala