mcpField
🔐
🔐 get-mcp-keys

🔐 get-mcp-keys

Local
github.com/StuMasonDeveloper Tools12Updated 84w ago

About 🔐 get-mcp-keys

get-mcp-keys is a small utility for developers using Cursor and other AI coding assistants. It loads secrets from `~/.mcprc`, injects them as environment variables, and runs an MCP server command without storing keys in a repository.

Key features

  1. 01Loads keys from `~/.mcprc`
  2. 02Injects keys as environment variables
  3. 03Runs the configured MCP server command
  4. 04Masks most key characters in debug output

Use cases

  1. 01Keep API keys out of repository history
  2. 02Provide credentials to Firecrawl or Brave Search
  3. 03Launch MCP servers that require environment variables

MCP support

It acts as a wrapper for MCP server commands, loading configured credentials before launching the server. It is not described as exposing its own tools.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"get-mcp-keys": {
"command": "npx",
"args": [
"-y",
"firecrawl-mcp"
],
"env": {
"FIRECRAWL_API_KEY": "<FIRECRAWL_API_KEY>"
}
}
}
}
Run commandnpx -y firecrawl-mcp
Environment variables to set
FIRECRAWL_API_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmfirecrawl-mcp

Tools

27

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
urlstringYes
formatsarrayNo
jsonOptionsobjectNo
jsonOptions.promptstringNo
jsonOptions.schemaobjectNo
queryOptionsobjectNo
queryOptions.promptstringYes
queryOptions.modeenumNodirectQuote | freeform
screenshotOptionsobjectNo
screenshotOptions.fullPagebooleanNo
screenshotOptions.qualitynumberNo
screenshotOptions.viewportobjectNo
screenshotOptions.viewport.widthnumberYes
screenshotOptions.viewport.heightnumberYes
parsersarrayNo
pdfOptionsobjectNo
pdfOptions.maxPagesintegerNo
onlyMainContentbooleanNo
redactPIIbooleanNo
includeTagsarrayNo
excludeTagsarrayNo
waitFornumberNo
actionsarrayNo
mobilebooleanNo
skipTlsVerificationbooleanNo
removeBase64ImagesbooleanNo
locationobjectNo
location.countrystringNo
location.languagesarrayNo
storeInCachebooleanNo
zeroDataRetentionbooleanNo
maxAgenumberNo
lockdownbooleanNo
proxyenumNobasic | stealth | enhanced | auto
profileobjectNo
profile.namestringYes
profile.saveChangesbooleanNo

Details

From the project README

🔐 get-mcp-keys

Stop accidentally committing API keys to your repos!

The Problem

When using Cursor AI (and other AI coding assistants) with MCP servers, you need API keys in your ./cursor/mcp.json file:

{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": [
        "-y",
        "firecrawl-mcp"
      ],
      "env": {
        "FIRECRAWL_API_KEY": "sk_live_ohno-this-should-NOT-be-in-git" // 💀
      }
    }
  }
}

This is a security nightmare waiting to happen. One accidental commit and your keys are exposed in your Git history.

💯 The Solution

get-mcp-keys loads your API keys from a secure file in your home directory, keeping them out of your repositories entirely.

⚡ Quick Start

1. Create a .mcprc file in your home directory
touch ~/.mcprc
chmod 600 ~/.mcprc  # Make it readable only by you
3. Add your API keys to the file
# ~/.mcprc
FIRECRAWL_API_KEY="your_actual_api_key_here"
BRAVE_API_KEY="another_secret_key_here"
# Add any other MCP server keys you use
4. Update your MCP configuration to use get-mcp-keys
{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": [
        "@masonator/get-mcp-keys", // 🔐
        "npx",
        "-y",
        "firecrawl-mcp"
      ]
    }
  }
}

That's it! The get-mcp-keys utility will:

  • Load your API keys from ~/.mcprc
  • Inject them as environment variables
  • Run your MCP server command with the keys available

🛡️ Security

  • Your API keys stay in your home directory
  • Keys are never committed to repositories
  • Keys are loaded only when needed
  • Debug output shows only first/last few characters of keys

🧰 Supported MCP Servers

Works with any MCP server that needs environment variables, including:

  • FireCrawl
  • Brave Search
  • Supabase
  • And any other MCP servers you configure!

🔍 How It Works

get-mcp-keys reads your .mcprc file, adds those environment variables to the current environment, and then executes whatever command you specify after it in the args list. It's simple yet effective!

get-mcp-keys in action

📋 License

MIT


⭐ If this saved you from committing your keys, star the repo!

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.