MCP Hub
Back to servers

mcp-scan

Security scanner for MCP server configurations. Detects secrets, CVEs, permission issues, and exfiltration vectors across 10 AI tool clients.

GitHub
Stars
9
Updated
Mar 24, 2026
Validated
Mar 26, 2026

mcp-scan

Security scanner for MCP server configurations.

npm version npm downloads license node version github stars

Why this exists

MCP servers run with full filesystem and network access. Most users install them without auditing what they are actually running. mcp-scan scans your configurations automatically and surfaces what needs attention.

Quick start

npx mcp-scan
$ npx mcp-scan

  ┌ Claude Desktop › filesystem
  │ /Users/rodolf/Library/Application Support/Claude/claude_desktop_config.json
  │
  │   HIGH       exposed-secret
  │            Environment variable GITHUB_TOKEN contains a hardcoded secret.
  │            Move the value to a .env file and reference it as ${GITHUB_TOKEN}.
  │
  └────────────────────────────────────────────────

  ✓ Claude Desktop › github         0 issues
  ✓ Claude Desktop › slack          0 issues

  ────────────────────────────────────────────────
   Scanned 3 servers across 1 client in 45ms
    0 critical    1 high    0 medium    0 low
  ────────────────────────────────────────────────

What gets scanned

ClientConfig locationPlatform
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonmacOS
Cursor~/.cursor/mcp.jsonmacOS, Linux
VS Code~/.vscode/mcp.jsonmacOS, Linux
Claude Code~/.claude.jsonmacOS, Linux
Windsurf~/.codeium/windsurf/mcp_config.jsonmacOS, Linux
Gemini CLI~/.gemini/settings.jsonmacOS, Linux
Codex CLI~/.codex/config.tomlmacOS, Linux
Zed~/.config/zed/settings.jsonmacOS, Linux
Continue.dev~/.continue/config.jsonmacOS, Linux
ClineVS Code extension settingsmacOS, Linux
Roo CodeVS Code extension settingsmacOS, Linux
Amp~/.amp/config.jsonmacOS, Linux
Plandex~/.plandex/config.jsonmacOS, Linux
GitHub Copilot~/.config/github-copilot/apps.jsonmacOS, Linux
ChatGPT Desktop~/Library/Application Support/com.openai.chat/settings.jsonmacOS
Project local.mcp.json, .cursor/mcp.json, .vscode/mcp.jsonAll

Windows paths are automatically detected using %APPDATA% and %USERPROFILE%.

Scanners

ScannerWhat it detectsSeverity range
secretHardcoded API keys and tokens in env vars or argsHIGH - CRITICAL
registryPackages on the known malicious blocklistCRITICAL
typosquatPackage names that closely resemble official serversHIGH
permissionOverly broad filesystem paths like /, ~, or .sshMEDIUM - HIGH
transportHTTP without auth or deprecated SSE transportLOW - MEDIUM
astSuspicious execution patterns like eval or execHIGH - CRITICAL
prompt-injectionMalicious instructions in server descriptionsMEDIUM - HIGH
tool-poisoningCapability injection and cross-tool manipulationHIGH
env-leakSecrets in .env files exposed to server processHIGH
packageKnown CVEs via OSV.dev API or bundled snapshotMEDIUM - CRITICAL
supply-chainLow trust scores based on npm and GitHub metadataLOW - MEDIUM
licenseCopyleft licenses or missing license fieldsLOW
configShell injection patterns in argument stringsHIGH

Severity levels

LevelMeaning
CRITICALImmediate risk. Stop using until resolved.
HIGHSignificant risk. Fix before next session.
MEDIUMRisk present. Fix in current sprint.
LOWMinor issue. Fix when convenient.
INFOInformational. No action required.

CLI reference

Click to view all commands and flags

Commands

CommandDescription
scanDefault scan of all detected AI tool configs
auditView scan history or deep audit a specific server
fixInteractive auto-fix for secrets and permissions
watchContinuous monitoring of config files
lsList all detected MCP servers
scannersList all available security scanners
diffCompare two scan reports and show changes
submitScan and submit clean servers to ugig.net marketplace
ciCI mode with JSON output and strict exit codes
dashboardLaunch the interactive TUI dashboard
historyShow scan history trends and statistics
doctorRun system diagnostic check
reportScan all configs in a directory for a unified report
initCreate .mcp-scan.json policy config
proxyRun local proxy to intercept MCP server traffic

Flags

FlagWhat it doesDefault
--jsonOutput report in JSON formatfalse
--sarif <path>Output SARIF report for GitHub Securityundefined
--html <path>Output self-contained HTML reportundefined
--sbom <path>Output CycloneDX SBOMundefined
--offlineSkip network calls, use bundled CVE snapshotfalse
--severity <level>Filter by minimum severitylow
--config <path>Scan a specific config fileundefined
--ugigShow ugig.net links for verified serversfalse
--fixAutomatically apply fixes where possiblefalse
--submitSubmit clean servers to ugig.netfalse
--ugig-key <key>ugig.net API keyprocess.env.UGIG_API_KEY
--webhook <url>POST scan results to a webhookundefined
--slack-webhook <url>POST scan results to Slackundefined
--ciEnable CI modefalse
--verboseEnable verbose outputfalse
--dry-runPreview submission without sendingfalse

Output formats

  • CLI table: Default color-coded output for terminal use.
  • JSON: Use --json for machine-readable output.
  • SARIF: Use --sarif results.sarif to import into GitHub Security tab.
  • HTML report: Use --html report.html for a self-contained visual report.
  • SBOM: Use --sbom sbom.json for CycloneDX v1.5 Software Bill of Materials.

CI/CD integration

GitHub Action example

name: MCP Security Scan
on: [push, pull_request]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: rodolfboctor/mcp-scan@v1
        with:
          severity: high
          sarif-output: results.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

Library usage

import { runScan } from 'mcp-scan';

const report = await runScan({
  severity: 'high',
  offline: true
});

console.log(`Found ${report.totalFindings} issues.`);

Integrations

  • ugig.net: MCP marketplace integration. Run mcp-scan submit --ugig-key YOUR_KEY.
  • GitHub Security: Upload SARIF reports to see findings in your repository security tab.
  • Slack: Send alerts to your team using --slack-webhook <url>.
  • Custom webhooks: Integrate with any system using --webhook <url>.

Troubleshooting

  • Rate limits: If you see GitHub API errors, set GITHUB_TOKEN in your environment.
  • Config not detected: Use mcp-scan --config path/to/config.json to scan a specific file.
  • Node version: Ensure you are using Node.js 18 or higher.

Architecture

Click to view pipeline details
  1. Detection: Automatically locates configuration files for 15+ AI clients.
  2. Parsing: Reads JSON, JSONC, and TOML formats into a unified internal model.
  3. Scanning: Runs a pipeline of 13 specialized security scanners.
  4. Reporting: Aggregates findings and generates output in multiple formats.

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

License

MIT. See LICENSE for details.


Development by ThynkQ.

Reviews

No reviews yet

Sign in to write a review