Stop accidentally committing API keys to your repos!
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.
get-mcp-keys
loads your API keys from a secure file in your home directory, keeping them out of your repositories entirely.
.mcprc
file in your home directorytouch ~/.mcprc
chmod 600 ~/.mcprc # Make it readable only by you
# ~/.mcprc
FIRECRAWL_API_KEY="your_actual_api_key_here"
BRAVE_API_KEY="another_secret_key_here"
# Add any other MCP server keys you use
{
"mcpServers": {
"firecrawl": {
"command": "npx",
"args": [
"@masonator/get-mcp-keys", // 🔐
"npx",
"-y",
"firecrawl-mcp"
]
}
}
}
That's it! The get-mcp-keys
utility will:
~/.mcprc
Works with any MCP server that needs environment variables, including:
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!
MIT
⭐ If this saved you from committing your keys, star the repo!
Seamless access to top MCP servers powering the future of AI integration.