Skip to content

Commit 954749f

Browse files
committed
better readme
1 parent ed2c643 commit 954749f

File tree

8 files changed

+77
-127
lines changed

8 files changed

+77
-127
lines changed

.cursor/mcp.json.bak renamed to .cursor/mcp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"mcpServers": {
33
"firecrawl": {
4-
"command": "node",
4+
"command": "npx",
55
"args": [
6-
"/Users/stuartmason/Code/JeredBlu/get-mcp-keys.js",
6+
"@masonator/get-mcp-keys",
77
"npx",
88
"-y",
99
"firecrawl-mcp"

.cursor/rules/coding-best-practices.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.cursor/rules/database-rules.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.cursor/rules/documentation-and-techstack.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

.cursor/rules/mcp-tool-usage.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.eslintrc.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
"node": true,
44
"es2021": true
55
},
6-
"extends": [
7-
"standard",
8-
"plugin:security/recommended"
9-
],
6+
"extends": ["standard"],
107
"plugins": ["security"],
118
"parserOptions": {
129
"ecmaVersion": "latest"
@@ -18,14 +15,10 @@
1815
"indent": ["error", 2],
1916
"quotes": ["error", "single"],
2017
"object-curly-spacing": ["error", "always"],
21-
"security/detect-object-injection": "warn",
22-
"security/detect-non-literal-require": "warn",
23-
"security/detect-non-literal-fs-filename": "warn",
2418
"security/detect-eval-with-expression": "error",
25-
"security/detect-no-csrf-before-method-override": "error",
19+
"security/detect-non-literal-fs-filename": "warn",
2620
"security/detect-buffer-noassert": "error",
27-
"security/detect-child-process": "warn",
28-
"security/detect-disable-mustache-escape": "error",
29-
"security/detect-new-buffer": "error"
21+
"security/detect-possible-timing-attacks": "warn",
22+
"security/detect-no-csrf-before-method-override": "error"
3023
}
3124
}

.github/workflows/sec-check.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # Fetch all history for all branches and tags
2830

2931
- name: Setup Node.js
3032
uses: actions/setup-node@v4
@@ -61,9 +63,7 @@ jobs:
6163
uses: trufflesecurity/trufflehog@main
6264
with:
6365
path: ./
64-
base: ${{ github.event.repository.default_branch }}
65-
head: HEAD
66-
extra_args: --debug --only-verified
66+
extra_args: --only-verified --no-git
6767

6868
# OSSAR Scan
6969
- name: Run OSSAR
@@ -86,18 +86,11 @@ jobs:
8686
uses: actions/dependency-review-action@v3
8787
if: github.event_name == 'pull_request'
8888

89-
# Software Bill of Materials (SBOM) Generation
90-
- name: Generate SBOM
91-
uses: CycloneDX/gh-node-module-generatebom@master
92-
with:
93-
output: bom.xml
94-
95-
# Results Processing
96-
- name: Upload SBOM
97-
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
98-
with:
99-
name: bom
100-
path: bom.xml
89+
# Generate and Upload SBOM
90+
- name: Generate and Upload SBOM
91+
run: |
92+
npx @cyclonedx/bom -o bom.xml
93+
echo "Generated SBOM at bom.xml"
10194
10295
security-matrix:
10396
needs: security-checks

README.md

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,61 @@
1-
# Get MCP Keys
1+
# 🔐 get-mcp-keys
22

3-
Cursor (perhaps other ai tools too?) allow you to create project specific MCP servers in the `./cursor/mcp.json` file.
3+
**Stop accidentally committing API keys to your repos!**
44

5-
However, that means it's in the repo, so likely will end up commiting your env variables...
5+
## The Problem
6+
7+
When using Cursor AI (and other AI coding assistants) with MCP servers, you need API keys in your `./cursor/mcp.json` file:
68

79
```json
810
{
9-
"mcpServers": {
10-
"firecrawl": {
11-
"command": "npx",
12-
"args": [
13-
"-y",
14-
"firecrawl-mcp"
15-
],
16-
"env": {
17-
"FIRECRAWL_API_KEY": "oops-this-shouldnt-be-in-the-repo"
18-
}
19-
}
11+
"mcpServers": {
12+
"firecrawl": {
13+
"command": "npx",
14+
"args": [
15+
"-y",
16+
"firecrawl-mcp"
17+
],
18+
"env": {
19+
"FIRECRAWL_API_KEY": "sk_live_ohno-this-should-NOT-be-in-git" // 💀
20+
}
2021
}
22+
}
2123
}
2224
```
2325

24-
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
2529

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.
2731

28-
so something like:
32+
## ⚡ Quick Start
2933

30-
create the .mcprc file in the users home directory:
34+
### 1. Create a `.mcprc` file in your home directory
3135

3236
```bash
3337
touch ~/.mcprc
38+
chmod 600 ~/.mcprc # Make it readable only by you
3439
```
3540

36-
add the following to the .mcprc file:
41+
### 3. Add your API keys to the file
3742

3843
```bash
39-
FIRECRAWL_API_KEY="oops-this-shouldnt-be-in-the-repo"
44+
# ~/.mcprc
45+
FIRECRAWL_API_KEY="your_actual_api_key_here"
46+
BRAVE_API_KEY="another_secret_key_here"
47+
# Add any other MCP server keys you use
4048
```
4149

42-
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
4351

4452
```json
4553
{
4654
"mcpServers": {
4755
"firecrawl": {
4856
"command": "npx",
4957
"args": [
50-
"@masonator/get-mcp-keys",
58+
"@masonator/get-mcp-keys", // 🔐
5159
"npx",
5260
"-y",
5361
"firecrawl-mcp"
@@ -57,4 +65,36 @@ Then run this command before you run the mcp server, it would look something lik
5765
}
5866
```
5967

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

Comments
 (0)