You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an effort to stop this, what I want to do here is have an rc file in the users home directory that contains the MCP Server envs you use.
26
+
**This is a security nightmare waiting to happen.** One accidental commit and your keys are exposed in your Git history.
27
+
28
+
## 💯 The Solution
25
29
26
-
> The MCP Server envs your using are likely user specific, so it makes sense to have them in your home directory. Will need to look at this again for when different projects are using different environment variables
30
+
`get-mcp-keys` loads your API keys from a secure file in your home directory, keeping them out of your repositories entirely.
27
31
28
-
so something like:
32
+
## ⚡ Quick Start
29
33
30
-
create the .mcprc file in the users home directory:
34
+
### 1. Create a `.mcprc` file in your home directory
Then run this command before you run the mcp server, it would look something like this:
50
+
### 4. Update your MCP configuration to use get-mcp-keys
43
51
44
52
```json
45
53
{
46
54
"mcpServers": {
47
55
"firecrawl": {
48
56
"command": "npx",
49
57
"args": [
50
-
"@masonator/get-mcp-keys",
58
+
"@masonator/get-mcp-keys",// 🔐
51
59
"npx",
52
60
"-y",
53
61
"firecrawl-mcp"
@@ -57,4 +65,36 @@ Then run this command before you run the mcp server, it would look something lik
57
65
}
58
66
```
59
67
60
-
This would run the `get-mcp-keys` command first, grab the envs from the .mcprc file, and then run the `npx firecrawl-mcp` command with the envs it's grabbed.
68
+
**That's it!** The `get-mcp-keys` utility will:
69
+
70
+
- Load your API keys from `~/.mcprc`
71
+
- Inject them as environment variables
72
+
- Run your MCP server command with the keys available
73
+
74
+
## 🛡️ Security
75
+
76
+
- Your API keys stay in your home directory
77
+
- Keys are never committed to repositories
78
+
- Keys are loaded only when needed
79
+
- Debug output shows only first/last few characters of keys
80
+
81
+
## 🧰 Supported MCP Servers
82
+
83
+
Works with any MCP server that needs environment variables, including:
84
+
85
+
- FireCrawl
86
+
- Brave Search
87
+
- Supabase
88
+
- And any other MCP servers you configure!
89
+
90
+
## 🔍 How It Works
91
+
92
+
`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!
93
+
94
+
## 📋 License
95
+
96
+
MIT
97
+
98
+
---
99
+
100
+
⭐ If this saved you from committing your keys, star the repo!
0 commit comments