Fix: remove hardcoded API key from scan command#7
Open
rajaramr7 wants to merge 1 commit into
Open
Conversation
Move the report backend API key from hardcoded string to environment variable MCP_AUDIT_API_KEY. Also make the backend URL configurable via MCP_AUDIT_BACKEND_URL. Show a clear message when the env var is not set instead of sending requests with an empty key.
🟢 MCP Security Audit Results
Total MCPs found: 6 Generated by MCP Audit |
rajaramr7
added a commit
that referenced
this pull request
Apr 13, 2026
- Report API key moved from hardcoded string to window.MCP_AUDIT_REPORT_KEY (set at deployment time via index.html script block) - Analytics URL moved from hardcoded Google Apps Script URL to window.MCP_AUDIT_ANALYTICS_URL (same pattern) - Added graceful handling when keys are not configured - index.html updated with deployment configuration block - This completes the security fix started in PR #7 (scan.py) which only addressed the Python CLI, not the web frontend
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp_audit/commands/scan.pyMCP_AUDIT_API_KEYenvironment variableMCP_AUDIT_BACKEND_URL(defaults to current Vercel endpoint)Why
A security auditing tool should not have its own API key hardcoded in source code. The key was visible to anyone reading the repo.
Test plan
MCP_AUDIT_API_KEYenv var, runmcp-audit scan --email test@example.com— verify report sends