MCP secrets · Claude Desktop

API keys out of Claude Desktop’s MCP config

Every MCP server you add to Claude Desktop tends to bring a key, written into one JSON file. Here’s how to empty it.

The short answer

Claude Desktop reads MCP servers from claude_desktop_config.json (on a Mac, in ~/Library/Application Support/Claude/), and each server’s key usually sits in its env block as plain text. To get keys out: for business platforms, add MoltenRock Connect as one MCP server; it holds the keys, calls the platform and gives Claude the answer. For any other server, keep the key in the macOS Keychain and start the server through a small wrapper that reads it at launch.

The problem

Where it goes wrong

  • Plain text on disk
    The env block of each server holds its key as written. Anything you run as you can read the file.
  • One key per server
    Five servers, five keys, five places to rotate, and five packages trusted with a secret.
  • Easy to leak by accident
    Config files end up in dotfile repos, screenshots and support tickets.

The solution

MoltenRock Connect: Two ways to empty the env block

  • Business tools: one Connect entry
    Add MoltenRock Connect once and Claude reads 30 platforms through it. No platform key appears in the file.
  • Other servers: the Keychain
    A two-line wrapper reads the key from the macOS Keychain when the server starts.
  • Answers, not keys
    Connect returns data, with customer names and addresses as tokens.
  • Changes wait for you
    On Stripe, Cloudflare and GitHub, Claude can only propose; you approve with Touch ID.

Side by side

Where a Claude Desktop MCP key can live

OptionWhat’s in the config fileGood for
The key in the env blockThe key itself, in plain textA quick test, then remove it
Keychain and a wrapper scriptA path to the wrapper; no secretAny MCP server you trust
MoltenRock ConnectOne entry, no key at allIts 30 business platforms

How it works

Clean up claude_desktop_config.json

  1. 01
    Open the file
    In Claude Desktop: Settings → Developer → Edit Config. It lives in ~/Library/Application Support/Claude/.
  2. 02
    Move platform keys into Connect
    Paste each key once in MoltenRock Connect, then add its entry from Connect → Settings → Agent Setup → Claude Desktop, Cursor.
  3. 03
    Keychain for the rest
    Store the key once with security add-generic-password -a "$USER" -s my-mcp-key -w (it asks for the value, so it never lands in your shell history), then point the server’s command at a two-line wrapper script that reads it with security find-generic-password -s my-mcp-key -w, exports it and starts the server. The config then holds a path, not a secret.
  4. 04
    Rotate what was in the file
    Any key that sat in a config file may have been copied, synced or shared. Make a new one and revoke the old.

Straight answer

What this fixes, and what it doesn’t

Stays on your Mac

  • Platform keys, in Connect or MoltenRock’s vault
  • Keys for other servers, in the Keychain
  • A config file with nothing secret in it

Leaves your Mac

  • Connect’s calls from your Mac to each platform
  • Tool results, to Claude and its model
  • MoltenRock Connect covers its 30 business platforms (Stripe, Shopify, WooCommerce, GitHub, Cloudflare and more). An MCP server for anything else still needs its own key: keep that one in the Keychain.

Questions

What people ask first

Where is claude_desktop_config.json on a Mac?

In ~/Library/Application Support/Claude/. Claude Desktop opens it from Settings → Developer → Edit Config.

Does MoltenRock put keys into my other MCP servers?

No. MoltenRock hands keys to OpenClaw and Hermes, and MoltenRock Connect never hands one out at all. For another MCP server, keep its key in the macOS Keychain and read it at launch.

Is the Keychain wrapper enough?

It keeps the key out of the file and out of your shell history. The running server still holds the key in its environment, as any server that uses a key must; only trust servers you would trust with the key itself.

What does it cost?

Connect is free for two platforms; one $9.99 unlock opens all 30, and MoltenRock Pro includes it.

Nothing secret in claude_desktop_config.json.

MoltenRock Connect is free for Mac.