MCP Security Kit by Agent Trust Cloud

high

Secret written into an MCP config

An API key, token or password is stored as plain text in the env or headers of an MCP server entry.

Why it matters

Config files get synced, backed up, shared in screenshots and committed by accident. Anyone who reads the file gets the credential, and nobody remembers to rotate a key that lives in a JSON file.

How to fix it

Reference the secret instead of writing it: an environment variable your launcher sets, or an input the client prompts for (VS Code supports ${input:...}). Then rotate the key that was exposed.

Before

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/[email protected]"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_realtokenwrittenhere..."
      }
    }
  }
}

After

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/[email protected]"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

Illustrative configs. The checker flags the “before” version with this finding and not the “after” version.

Check your own config

Other checks