claude mcp get prints raw secret header values in plaintext, unlike claude mcp add

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 29, 2026

Summary

claude mcp add redacts sensitive header values (e.g. Authorization: Bearer <token>) in its own confirmation output, but claude mcp get <name> does not apply the same masking — it prints the full stored config, including the raw secret value, in plaintext.

This is inconsistent behavior between two commands that both report on the same underlying config, and it's easy to trigger by accident when just trying to check a server's connection status.

Steps to reproduce

  1. Register an HTTP-transport MCP server with a bearer token in a header:

``
claude mcp add --transport http myserver https://example.com/mcp --header "Authorization: Bearer sk-some-real-secret"
`
Output correctly redacts it:
`
Added HTTP MCP server myserver with URL: https://example.com/mcp to local config
Headers: {
"Authorization": "[REDACTED]"
}
``

  1. Now check its status:

``
claude mcp get myserver
`
Output includes the raw secret in plaintext:
`
myserver:
...
Headers:
Authorization: Bearer sk-some-real-secret
``

Impact

Because claude mcp get is a natural, low-risk-looking command to run for a status/debug check, it's easy to end up with a live secret printed to a terminal — and, when run inside an agent session, persisted into that session's transcript/history file on disk (e.g. under ~/.claude/projects/.../*.jsonl), not just the terminal scrollback. claude mcp list does not have this problem — it never prints header values at all.

Suggested fix

claude mcp get should mask header values the same way claude mcp add already does (e.g. print [REDACTED] for any header whose value isn't already known-safe), rather than dumping the literal stored config.

Workaround

Use claude mcp list for routine status/health checks on servers with secrets in their headers — it only reports name/URL/transport/connection status, never header contents. Avoid claude mcp get for such servers until this is fixed.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗