Secure Input Support for MCP Server Configuration (e.g., API Keys)

Hi there,

I’m really enjoying using MCP with Cursor—thank you for the great tool!

One concern I have is about how we currently handle secure values like API keys in the mcp.json configuration. As far as I can tell, the only option is to hardcode these sensitive values directly in the env field, which raises security concerns—especially when working in shared environments.

Here’s an example of what this currently looks like:

// This example demonstrates an MCP server using the stdio format
// Cursor automatically runs this process for you
// This uses a Node.js server, ran with `npx`
{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "mcp-server"],
      "env": {
        "API_KEY": "value"
      }
    }
  }
}

As you can see, this approach requires storing sensitive keys directly in a config file, which is not ideal from a security perspective.

Proposal: Support for inputs-style Secure Prompts (like VS Code)

Visual Studio Code handles this quite nicely using an inputs section. On first run, the user is prompted to enter the value, which is then securely stored locally by VS Code:

{
  // 💡 Inputs are prompted on first server start, then stored securely by VS Code.
  "inputs": [
    {
      "type": "promptString",
      "id": "perplexity-key",
      "description": "Perplexity API Key",
      "password": true
    }
  ],
  "servers": {
    "Perplexity": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "server-perplexity-ask"],
      "env": {
        "PERPLEXITY_API_KEY": "${input:perplexity-key}"
      }
    }
  }
}

With this approach, the API key is never written into any file and is handled securely from the beginning.

Request

I would love to see similar functionality supported in Cursor’s MCP configuration:

Prompting for secure inputs on first run, storing them safely, and allowing reference via ${input:…} in the env field.

I believe this would be a huge security improvement and benefit many developers working with sensitive credentials.

Thank you for your consideration! :folded_hands: