{
  "markdown": "# mcp-audit-server\n\nThin MCP server and CLI proxy for AI agent and MCP security auditing. It connects to a private audit API to analyze MCP configurations, test prompt injection resistance, trace data flows, scan packages, and generate security policies.\n\nThis package is a thin proxy. All scan logic lives in a private backend operated by you or your provider.\n\nManaged hosted flow:\n- set `AGENT_SECURITY_API_KEY`\n- the package will automatically target `https://audit.leddconsulting.com`\n\nSelf-hosted or private-network flow:\n- set `AGENT_SECURITY_BASE_URL` to your HTTPS API origin\n- or set `AGENT_SECURITY_HOST` and `AGENT_SECURITY_PORT` for a loopback/private deployment\n\nHosted backend access is not bundled with this package. If you want managed access or a licensed private deployment, contact [Ledd Consulting](https://leddconsulting.com).\n\n## Registry and Directories\n\n- npm package: `ledd-mcp-audit-server`\n- Official MCP Registry name: `io.github.joepangallo/mcp-audit-server`\n- Downstream directories such as Glama and PulseMCP should ingest from the official MCP Registry, so you usually do not need separate manual submissions for each site.\n- Glama authorship claim is optional. It only gives you ownership of the Glama page and access to manual sync and re-scan controls.\n\n## Install\n\n```bash\nnpm install ledd-mcp-audit-server\n```\n\nInstall package: `ledd-mcp-audit-server`\nCLI command after install: `mcp-audit-server`\n\nThis is the public package that should be published to npm and listed in public MCP directories. The audit engine itself stays private.\n\nThe old package name `mcp-server-agent-security` is retired. See [MIGRATION.md](./MIGRATION.md) for upgrade steps and the deprecation plan.\n\n## Usage as MCP Server\n\nAdd to your MCP client configuration (Claude Desktop, Cursor, etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-audit-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ledd-mcp-audit-server\", \"--mcp\"],\n      \"env\": {\n        \"AGENT_SECURITY_API_KEY\": \"your-issued-api-key\"\n      }\n    }\n  }\n}\n```\n\nFor a self-hosted backend, add `AGENT_SECURITY_BASE_URL` to that same `env` block.\n\nThe server exposes 10 tools over stdio:\n\n| Tool | Description |\n|------|-------------|\n| `audit_mcp_config` | Static analysis of MCP config JSON for privilege, auth, transport, and launch risks |\n| `audit_mcp_server` | Active probing of a running MCP server over stdio (requires `AGENT_SECURITY_ADMIN_MODE=1`) |\n| `audit_agent_trust` | Trust audit for tool permissions, execution provenance, secret exposure controls, policy drift, and deployment trust score |\n| `audit_prompt_injection` | Tests a system prompt against a 30+ payload injection catalog |\n| `audit_agent_dataflow` | Traces PII and secret exposure through an agent's tool pipeline |\n| `scan_mcp_package` | Scans an npm MCP package for dependency vulnerabilities and dangerous patterns |\n| `generate_report` | Combines multiple audit results into a composite report with executive summary |\n| `fix_mcp_config` | Auto-remediates config issues: removes unsafe flags, upgrades transport, redacts secrets |\n| `harden_system_prompt` | Appends injection-resistant guardrails to a system prompt |\n| `generate_policy` | Generates an enforceable JSON security policy from an MCP config |\n\n## Usage as CLI\n\nThe CLI forwards commands to the private audit API.\n\n```bash\n# Hosted quick start\nexport AGENT_SECURITY_API_KEY=your-issued-api-key\n\n# Audit an MCP configuration file\nmcp-audit-server scan-config ./claude_desktop_config.json\n\n# Probe a live MCP server (requires AGENT_SECURITY_ADMIN_MODE=1)\nmcp-audit-server scan-server npx -y @modelcontextprotocol/server-filesystem /tmp\n\n# Audit trust posture and policy drift for an agent/MCP deployment\nmcp-audit-server scan-trust ./claude_desktop_config.json ./claimed-policy.json\n\n# Scan an npm package for vulnerabilities\nmcp-audit-server scan-package @modelcontextprotocol/server-shell\n\n# Test a system prompt for injection vulnerabilities\nmcp-audit-server scan-injection ./system-prompt.txt\n\n# Trace data flows through an MCP config\nmcp-audit-server scan-dataflow ./claude_desktop_config.json\n\n# Auto-fix security issues in an MCP config\nmcp-audit-server fix-config ./claude_desktop_config.json\n\n# Harden a system prompt against injection\nmcp-audit-server harden-prompt ./system-prompt.txt\n\n# Generate a security policy from an MCP config\nmcp-audit-server generate-policy ./claude_desktop_config.json\n\n# Retrieve a previous audit report\nmcp-audit-server report <audit-id>\n\n# Output raw JSON instead of formatted tables\nmcp-audit-server scan-config ./config.json --json\n\n# Start in MCP stdio server mode\nmcp-audit-server --mcp\n```\n\nFor a self-hosted backend, also set `AGENT_SECURITY_BASE_URL=https://your-audit-host`.\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `AGENT_SECURITY_BASE_URL` | (none) | Full audit API origin, e.g. `https://audit.example.com` |\n| `AGENT_SECURITY_HOST` | `127.0.0.1` | Self-hosted/private-network audit API host |\n| `AGENT_SECURITY_PORT` | `3091` | Self-hosted/private-network audit API port |\n| `AGENT_SECURITY_API_KEY` | (none) | API key for authenticated access. If set with no endpoint overrides, the package uses `https://audit.leddconsulting.com` |\n| `AGENT_SECURITY_REQUEST_TIMEOUT_MS` | `15000` | Request timeout for CLI and MCP proxy calls |\n| `AGENT_SECURITY_ADMIN_MODE` | (none) | Set to `1` to enable active server probing |\n\n## What It Detects\n\n- **Tool spoofing** -- duplicate tool names, namespace collision (CWE-290)\n- **Rug pull** -- unpinned packages, version drift (CWE-829)\n- **Prompt injection** -- direct override, instruction hijacking, role-play escape, delimiter injection, encoding bypass, multilingual injection\n- **Privilege escalation** -- overprivileged tools, shell execution without allowlists, unrestricted filesystem access\n- **Data exfiltration** -- PII leakage through tool pipelines, outbound network paths\n- **Insecure transport** -- missing TLS, plaintext credentials in config\n- **Missing auth** -- unauthenticated MCP servers, missing API key requirements\n- **Shell injection** -- arbitrary command execution via tool configurations\n- **Path traversal** -- unrestricted filesystem scope in tool arguments\n- **SQL injection** -- raw SQL patterns in tool definitions\n- **Rate limiting** -- missing request throttling on exposed tools\n- **Package vulnerabilities** -- known CVEs in npm MCP package dependencies\n- **Credential exposure** -- inline secrets, missing rotation policies\n- **Agent trust drift** -- claimed-safe policies that do not match configured tools, network posture, or observed action logs\n- **Weak provenance** -- missing action/evidence capture for risky agent operations\n\n## Requirements\n\n- Node.js >= 20\n- Access to a private audit API. The managed hosted default is `https://audit.leddconsulting.com` when `AGENT_SECURITY_API_KEY` is set. Use `AGENT_SECURITY_BASE_URL` for other hosted HTTPS deployments, or `AGENT_SECURITY_HOST` and `AGENT_SECURITY_PORT` for local/private-network deployments.\n\n## Provenance\n\nVersions `2.0.0` through `2.1.0` were published before the release workflow existed and do not carry provenance attestations. Version `3.0.1` and later are released through the provenance-enabled trusted-publishing workflow.\n\nThe release workflow in [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) publishes `v*` tags with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) (`npm publish --provenance`) via npm trusted publishing (OIDC — no long-lived token). Verify a release with `npm audit signatures` and the provenance badge on npmjs.com.\n\n## License\n\nMIT\n\n---\n\nBuilt by [Ledd Consulting](https://leddconsulting.com)\n",
  "bytes": 7748,
  "sha": "9a0da5682079c3cf21e8524b0b3b07c3af18668b7cc8880ba5e7186b35f2de0b",
  "repo_slug": "joepangallo/mcp-audit-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_joepangallo_mcp_audit_server_16d90b83/readme"
}