Local Static Analysis: Evaluates JSON manifests locally in your browser JavaScript runtime without submitting configuration files to backend servers.

1. Purpose & MCP Architecture

The Model Context Protocol (MCP) is an open specification created by Anthropic that standardizes how large language model clients (such as Claude Desktop, Cursor IDE, or autonomous multi-agent runtimes) communicate with external data sources and local system tools using JSON-RPC 2.0 over standard input/output (stdio) or Server-Sent Events (SSE) transports.

When a developer adds an MCP server to their configuration file (typically located at claude_desktop_config.json on macOS/Windows/Linux), they grant the LLM runtime permission to spawn subprocesses on their machine, execute binaries, read local directories, and query private databases. Because LLMs are susceptible to prompt injection and indirect manipulation through untrusted retrieved documents, a misconfigured MCP server creates an immediate local privilege escalation vector.

2. How to Use the Scanner

  1. Locate Configuration: Open your local MCP configuration file (e.g. ~/.config/Claude/claude_desktop_config.json or your application's MCP settings).
  2. Paste Configuration: Copy and paste the JSON object into the input area above.
  3. Or Test a Preset: Click Load Sample Risk Config to inspect common real-world vulnerabilities, or Load Safe Config to view a hardened pattern.
  4. Run Audit: Click Audit MCP Configuration to execute client-side static security analysis.
  5. Export Findings: Review each finding, severity rating, and remediation recommendation. Click Copy JSON Report to include the audit log in your compliance records.

3. Reproducible Audit Cases & Walkthrough

Case A: High-Risk Shell Wrapper & Root Filesystem Exposure

Vulnerable Configuration Snippet:
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/"]
    },
    "terminal": {
      "command": "/bin/sh",
      "args": ["-c", "python run_script.py"]
    }
  }
}

Scanner Findings: Triggers Direct Shell Execution Wrapper (Critical) because /bin/sh -c allows command injection, and Unbounded Root Filesystem Access (Critical) because mounting / exposes all host files.

Case B: Hardened Configuration with Scoped Paths and Version Pins

Hardened Configuration Snippet:
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem@0.6.2", "./safe_workspace"]
    },
    "weather": {
      "command": "python",
      "args": ["-m", "mcp_server_weather"],
      "env": {
        "WEATHER_API_KEY": "${WEATHER_API_KEY}"
      }
    }
  }
}

Scanner Findings: Evaluates as Hardened (0 Risks): exact version tag is pinned, directory mount is scoped to a relative path, and credentials use environment variable substitution syntax.

4. Core Audit Rules & Threat Taxonomy

Rule Target Severity Vulnerability Mechanism Remediation Standard
Shell Wrapper Invocations Critical Wrapping commands in /bin/sh -c or cmd.exe /c allows prompt-injected LLM arguments to inject shell operators (;, &&, |). Invoke the binary executable directly without wrapping in shell interpreters. Pass arguments as individual array elements.
Unbounded Root Mounts Critical Passing root paths (/ or C:\) allows the LLM to traverse and read SSH keys, environment files, and credentials. Restrict mounts to dedicated, non-sensitive subdirectories (e.g. ./projects/data).
Unpinned Package Execution High Running npx -y <package> downloads the latest unpinned release from npm registry at startup, exposing the developer to supply chain compromise. Pin exact semantic package versions (e.g. package@1.2.3) or pre-install dependencies into a locked virtualenv or container.
Hardcoded Secrets in Environment High Storing database connection strings or API keys directly in the MCP JSON file exposes credentials in plaintext. Reference environment variables dynamically (e.g. ${DATABASE_URL}) rather than writing plaintext values into configuration files.

5. Scope, Assumptions & Limitations

Important Disclaimer: Static Configuration Scope

Static JSON analysis is a configuration audit, not a runtime firewall.

  • This tool inspects the declaration of MCP servers in the provided JSON string. It does not spawn, connect to, or observe dynamic network traffic from running MCP servers.
  • A configuration marked "Hardened" verifies that common structural anti-patterns are absent, but cannot guarantee that the underlying third-party Python/TypeScript server code is free from internal vulnerabilities.
  • For enterprise production use, combine static MCP config reviews with containerized sandboxing (Docker/gVisor) and network egress firewalls.

6. Authoritative References & Specifications