Skip to content

Commit ee0b5de

Browse files
mojwangclaude
andcommitted
fix: resolve remaining critical security issues
Critical security fixes: 1. API key no longer passed in process arguments (update-exa-mcp.sh) - Changed from command line argument to environment variable - Prevents exposure via ps/process lists 2. Removed hardcoded user path (setup-claude-code-mcp.sh) - Changed /Users/mojwang to $HOME for portability - Supports all users, not just hardcoded username These changes ensure: - API keys are not visible in process lists - Scripts work for any user without modification - Better security posture overall 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b8cd0e8 commit ee0b5de

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

scripts/setup-claude-code-mcp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ add_claude_code_server() {
4949
case "$server_type" in
5050
"node")
5151
if [[ "$server_name" == "filesystem" ]]; then
52-
claude mcp add "$server_name" -s "$scope" node "$server_path" "/Users/mojwang"
52+
claude mcp add "$server_name" -s "$scope" node "$server_path" "$HOME"
5353
elif [[ -n "$api_key_var" ]]; then
5454
claude mcp add "$server_name" -s "$scope" node "$server_path" --env "${api_key_var}=${!api_key_var}"
5555
else

scripts/update-exa-mcp.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ import sys
2626
import os
2727
import subprocess
2828
29-
api_key = sys.argv[1] if len(sys.argv) > 1 else None
29+
# Get API key from environment variable for security
30+
api_key = os.environ.get('EXA_API_KEY')
3031
if not api_key:
31-
print("Error: No API key provided")
32+
print("Error: No API key provided (set EXA_API_KEY environment variable)")
3233
sys.exit(1)
3334
3435
# Get current settings
@@ -79,8 +80,8 @@ else:
7980
print("Successfully updated Exa MCP configuration!")
8081
EOF
8182

82-
# Run the Python script
83-
python3 /tmp/update_exa_mcp.py "$api_key"
83+
# Run the Python script with API key via environment variable
84+
EXA_API_KEY="$api_key" python3 /tmp/update_exa_mcp.py
8485

8586
# Clean up
8687
rm -f /tmp/update_exa_mcp.py

0 commit comments

Comments
 (0)