{"_id":"@baichen_yu/mcp-guard","_rev":"4-1f1bb2365f949067411093107ea80030","name":"@baichen_yu/mcp-guard","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.0":{"name":"@baichen_yu/mcp-guard","version":"0.3.0","keywords":["mcp","model-context-protocol","security","audit","sarif","cli","lint"],"_id":"@baichen_yu/mcp-guard@0.3.0","maintainers":[{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"}],"homepage":"https://tomas-1226.github.io/MCP-shariff/","bugs":{"url":"https://github.com/TomAs-1226/MCP-shariff/issues"},"bin":{"mcp-guard":"dist/cli.js"},"dist":{"shasum":"e2f980bdd005424b7ceb3c0808bdfa7fbc13e92f","tarball":"https://registry.npmjs.org/@baichen_yu/mcp-guard/-/mcp-guard-0.3.0.tgz","fileCount":54,"integrity":"sha512-vgdQDzzDqXEpCcEvgvovQWSipzTrkUtBYZbL3okUxZLwYYKF9JWBsi1y7c5XiqRcPsYaI03wB7c6VWbLJkhe8A==","signatures":[{"sig":"MEYCIQCmytPEIlvnmKC4vqri3wIXi0HpCKnbkpeo/UF5Y8fEDwIhAPM7K/o0FU8eqOmSd3AZqFhKufo7Y4QMzDvX0Q99b4Ap","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60114},"main":"dist/cli.js","type":"module","types":"dist/cli.d.ts","engines":{"node":">=20"},"gitHead":"5204fbe47d8b43a4cb72283ad42853f77bb45645","scripts":{"dev":"tsx src/cli.ts","lint":"tsc -p tsconfig.json --noEmit","test":"vitest run","build":"tsc -p tsconfig.json","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs","fixtures:gen":"tsx scripts/gen-fixtures.ts"},"_npmUser":{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"},"repository":{"url":"git+https://github.com/TomAs-1226/MCP-shariff.git","type":"git"},"_npmVersion":"10.9.3","description":"Security auditing and policy gating for MCP servers (STDIO/HTTP) with Markdown + SARIF reports","directories":{},"_nodeVersion":"22.19.0","dependencies":{"js-yaml":"^4.1.0","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^2.1.8","vitepress":"^1.6.3","typescript":"^5.7.2","@types/node":"^22.10.2","@types/js-yaml":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/mcp-guard_0.3.0_1771137399486_0.3481223044062691","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"@baichen_yu/mcp-guard","version":"3.1.0","keywords":["mcp","model-context-protocol","security","audit","sarif","cli","lint"],"_id":"@baichen_yu/mcp-guard@3.1.0","maintainers":[{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"}],"homepage":"https://tomas-1226.github.io/mcp-guard/","bugs":{"url":"https://github.com/TomAs-1226/mcp-guard/issues"},"bin":{"mcp-guard":"dist/cli.js"},"dist":{"shasum":"fc2dd783035bdcf373025a1aa20a6be20ee93efb","tarball":"https://registry.npmjs.org/@baichen_yu/mcp-guard/-/mcp-guard-3.1.0.tgz","fileCount":55,"integrity":"sha512-lyGhPaZgDHSKRfU6xxUR5nnIdWQ95rbhEoC6KrZodbkCR1tZ2sqhXK27+dY4Cv5c8wBici1ymAGlRt4CrxOxJQ==","signatures":[{"sig":"MEQCIH1srot1jckFZEcZIK4iU7Ny2+Ah7cbdIEwNq44fc5tkAiAedsqiKEgfe9opbtrqyd/AX01yGgVK5uWIIo80qt7I1g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71798},"main":"dist/cli.js","type":"module","types":"dist/cli.d.ts","engines":{"node":">=20"},"gitHead":"2f2da27132b0363e1216f2cbd22de616e13ef71e","scripts":{"dev":"tsx src/cli.ts","lint":"tsc -p tsconfig.json --noEmit","test":"vitest run","build":"tsc -p tsconfig.json","prepack":"npm run build","pretest":"npm run fixtures:gen","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs","fixtures:gen":"tsx scripts/gen-fixtures.ts","prepublishOnly":"npm run lint && npm test"},"_npmUser":{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"},"repository":{"url":"git+https://github.com/TomAs-1226/mcp-guard.git","type":"git"},"_npmVersion":"10.9.3","description":"Security auditing and policy gating for MCP servers (STDIO/HTTP) with Markdown + SARIF reports","directories":{},"_nodeVersion":"22.19.0","dependencies":{"js-yaml":"^4.1.0","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^2.1.8","vitepress":"^1.6.3","typescript":"^5.7.2","@types/node":"^22.10.2","@types/js-yaml":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/mcp-guard_3.1.0_1771141998499_0.26154969677964957","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@baichen_yu/mcp-guard","version":"0.3.1","keywords":["mcp","model-context-protocol","security","audit","sarif","cli","lint"],"_id":"@baichen_yu/mcp-guard@0.3.1","maintainers":[{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"}],"homepage":"https://tomas-1226.github.io/mcp-guard/","bugs":{"url":"https://github.com/TomAs-1226/mcp-guard/issues"},"bin":{"mcp-guard":"dist/cli.js"},"dist":{"shasum":"846dd9997412a0a0c32abb460cb14c02249014e2","tarball":"https://registry.npmjs.org/@baichen_yu/mcp-guard/-/mcp-guard-0.3.1.tgz","fileCount":55,"integrity":"sha512-cu900QJ886owW3RiMDAbs9y1n+O38Q6znh+Mgq4RcbA2/1T4uqdrlJ7k8dQjz2N0RM2uICovgswGIvo+xLKaiA==","signatures":[{"sig":"MEYCIQDTyWKMOXkcT45vqbpQX3r3VvbFXCl6VVdrKoY8qq4KMQIhAJdrIQug3vxPnTKu7YHF0yma3I48DyKY7s5vqvgSyGIG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71798},"main":"dist/cli.js","type":"module","types":"dist/cli.d.ts","engines":{"node":">=20"},"gitHead":"2f2da27132b0363e1216f2cbd22de616e13ef71e","scripts":{"dev":"tsx src/cli.ts","lint":"tsc -p tsconfig.json --noEmit","test":"vitest run","build":"tsc -p tsconfig.json","prepack":"npm run build","pretest":"npm run fixtures:gen","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs","fixtures:gen":"tsx scripts/gen-fixtures.ts","prepublishOnly":"npm run lint && npm test"},"_npmUser":{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"},"repository":{"url":"git+https://github.com/TomAs-1226/mcp-guard.git","type":"git"},"_npmVersion":"10.9.3","description":"Security auditing and policy gating for MCP servers (STDIO/HTTP) with Markdown + SARIF reports","directories":{},"_nodeVersion":"22.19.0","dependencies":{"js-yaml":"^4.1.0","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^2.1.8","vitepress":"^1.6.3","typescript":"^5.7.2","@types/node":"^22.10.2","@types/js-yaml":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/mcp-guard_0.3.1_1771142183197_0.4843357093879199","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@baichen_yu/mcp-guard","version":"0.3.2","description":"Security auditing and policy gating for MCP servers (STDIO/HTTP) with Markdown + SARIF reports","type":"module","bin":{"mcp-guard":"dist/cli.js"},"engines":{"node":">=20"},"scripts":{"build":"tsc -p tsconfig.json","prepack":"npm run build","dev":"tsx src/cli.ts","pretest":"npm run fixtures:gen","test":"vitest run","lint":"tsc -p tsconfig.json --noEmit","fixtures:gen":"tsx scripts/gen-fixtures.ts","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs","prepublishOnly":"npm run lint && npm test","release:offline":"bash scripts/build-release-local.sh","npm:test-run":"PKG=$(npm pack --silent | tail -n 1) && npx --yes --package \"./$PKG\" mcp-guard --help && rm -f \"$PKG\""},"dependencies":{"commander":"^12.1.0","js-yaml":"^4.1.0"},"devDependencies":{"@types/js-yaml":"^4.0.9","@types/node":"^22.10.2","tsx":"^4.19.2","typescript":"^5.7.2","vitest":"^2.1.8","vitepress":"^1.6.3"},"repository":{"type":"git","url":"git+https://github.com/TomAs-1226/mcp-guard.git"},"homepage":"https://tomas-1226.github.io/mcp-guard/","bugs":{"url":"https://github.com/TomAs-1226/mcp-guard/issues"},"publishConfig":{"access":"public"},"main":"dist/cli.js","types":"dist/cli.d.ts","keywords":["mcp","model-context-protocol","security","audit","sarif","cli","lint"],"_id":"@baichen_yu/mcp-guard@0.3.2","gitHead":"2f2da27132b0363e1216f2cbd22de616e13ef71e","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-ETnYmluCPJvi/79qsgYWQSCMi8xEG0B57QjdPvVSjA2m1dl8Uvp4ccouFsadfSbmZUdoKk12c7ranIfI+FPbqw==","shasum":"6f7ef23617da5205aa304bf11b26ab3b5599eef4","tarball":"https://registry.npmjs.org/@baichen_yu/mcp-guard/-/mcp-guard-0.3.2.tgz","fileCount":55,"unpackedSize":73185,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCm0stGMMAcEvWdR2Cw2PT0BivqIUmCH1GAJjUnudgqSwIhAI10GydsWHlN52Ha+FkoUArDICni9UMGs9Lt8V2dh9i9"}]},"_npmUser":{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"},"directories":{},"maintainers":[{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-guard_0.3.2_1771144240091_0.7128126130046151"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-15T06:36:39.354Z","modified":"2026-02-15T08:30:40.333Z","0.3.0":"2026-02-15T06:36:39.673Z","3.1.0":"2026-02-15T07:53:18.654Z","0.3.1":"2026-02-15T07:56:23.348Z","0.3.2":"2026-02-15T08:30:40.230Z"},"bugs":{"url":"https://github.com/TomAs-1226/mcp-guard/issues"},"homepage":"https://tomas-1226.github.io/mcp-guard/","keywords":["mcp","model-context-protocol","security","audit","sarif","cli","lint"],"repository":{"type":"git","url":"git+https://github.com/TomAs-1226/mcp-guard.git"},"description":"Security auditing and policy gating for MCP servers (STDIO/HTTP) with Markdown + SARIF reports","maintainers":[{"name":"baichen_yu","email":"yu_thomas1226@outlook.com"}],"readme":"# mcp-guard\n\n<div align=\"center\">\n\n![mcp-guard logo](docs/public/brand-mark.svg)\n\n**Security auditing and policy gating for MCP servers (local + CI).**  \nDeterministic checks. Actionable findings. Reproducible reports.\n\n[![CI](https://img.shields.io/github/actions/workflow/status/TomAs-1226/mcp-guard/ci.yml?label=CI&style=for-the-badge)](./.github/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/%40baichen_yu%2Fmcp-guard?style=for-the-badge)](https://www.npmjs.com/package/@baichen_yu/mcp-guard)\n[![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](./LICENSE)\n[![Node >=20](https://img.shields.io/badge/node-%3E%3D20-3C873A?style=for-the-badge)](./package.json)\n[![Docs](https://img.shields.io/badge/docs-github%20pages-7C3AED?style=for-the-badge)](https://tomas-1226.github.io/mcp-guard/)\n\n</div>\n\n---\n\n> [!IMPORTANT]\n> Remote mode supports **HTTP JSON-RPC** (`--http`) and **SSE** (`--sse`, optional `--sse-post`).\n\n## Why people use mcp-guard\n\n- ✅ **Deterministic contract tests** (no fuzzy behavior, no mystery calls)\n- ✅ **Policy gate in CI** (`--fail-on off|low|medium|high`)\n- ✅ **Security-focused rule packs** with profile controls (`default`, `strict`, `paranoid`)\n- ✅ **Review-friendly output formats** (`report.md`, `report.json`, `report.sarif`)\n- ✅ **Config discovery + redaction** for common MCP client config layouts\n\n### Quick stats\n\n| Signal | Value |\n|---|---:|\n| Transports | STDIO + HTTP JSON-RPC + SSE |\n| Report formats | Markdown, JSON, SARIF |\n| Rule profiles | 3 |\n| Contract scenarios | list, call, error shape, cancellation behavior, large payload, timeout |\n| Registry modes | lint, verify, score |\n\n---\n\n## 30-second quickstart\n\n### 1) No install (`npx`)\n\n```bash\nnpx @baichen_yu/mcp-guard audit \\\n  --stdio \"node /absolute/path/to/your-mcp-server.cjs\" \\\n  --out reports \\\n  --fail-on off\n```\n\n> [!TIP]\n> `--stdio` runs in your **current working directory**. Use an absolute path or `cd` into the project that contains your server first.\n\n### Local demo (from this repo root)\n\n```bash\nnpm run fixtures:gen\nnpx @baichen_yu/mcp-guard audit \\\n  --stdio \"node fixtures/servers/hello-mcp-server/server.cjs\" \\\n  --out reports \\\n  --fail-on off\n```\n\n### 2) Global install\n\n```bash\nnpm i -g @baichen_yu/mcp-guard\nmcp-guard --help\n```\n\n### 3) Package + command naming\n\n- npm package: **`@baichen_yu/mcp-guard`**\n- runtime CLI command: **`mcp-guard`**\n- first scoped publish command: **`npm publish --access public`**\n\n---\n\n## Architecture\n\n```mermaid\nflowchart LR\n  CLI[mcp-guard CLI] --> T[Transport layer\\nSTDIO HTTP SSE]\n  T --> RPC[JSON-RPC client]\n  RPC --> TESTS[Contract tests]\n  RPC --> RULES[Rules and profiles]\n  TESTS --> REPORTS[Reports\\nMD JSON SARIF]\n  RULES --> REPORTS\n  REPORTS --> GATE[Policy gate fail-on]\n  GATE --> CI[CI and code scanning]\n```\n\n### Audit pipeline\n\n```mermaid\nflowchart TD\n  A[Start audit] --> B[Initialize session]\n  B --> C[List tools]\n  C --> D[Run contract suite]\n  C --> E[Run schema and security rules]\n  D --> F[Apply profile tuning]\n  E --> F\n  F --> G[Compute score]\n  G --> H[Emit reports]\n  H --> I[Exit by policy threshold]\n```\n\n---\n\n## Report preview\n\n```text\n# MCP Guard Report\n- Risk score: 100/100\n- Key findings: 0\n- Contract tests: 6/6\n- Target: node fixtures/servers/hello-mcp-server/server.cjs (stdio)\n```\n\n---\n\n## Commands\n\n```bash\n# Validate / Test / Audit\nmcp-guard validate --stdio \"node server.cjs\" --profile default --out reports\nmcp-guard test --stdio \"node server.cjs\" --out reports\nmcp-guard audit --stdio \"node server.cjs\" --profile strict --fail-on medium --sarif reports/report.sarif\n\n# Remote audit (HTTP JSON-RPC)\nmcp-guard audit --http \"http://127.0.0.1:4010\" --timeout-ms 30000 --fail-on off\n\n# Remote audit (SSE stream + POST endpoint)\nmcp-guard audit --sse \"http://127.0.0.1:4013/sse\" --sse-post \"http://127.0.0.1:4013/message\" --timeout-ms 30000 --fail-on off\n\n# Config scan\nmcp-guard scan --repo . --format md --out reports\n\n# Registry checks\nmcp-guard registry lint registry/servers.yaml\nmcp-guard registry verify registry/servers.yaml --sample 5\nmcp-guard registry score registry/servers.yaml\n```\n\n---\n\n## CI integration (drop-in)\n\n```yaml\njobs:\n  mcp-audit:\n    runs-on: ubuntu-latest\n    permissions:\n      security-events: write\n      actions: read\n      contents: read\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n      - uses: ./.github/actions/mcp-guard\n        with:\n          stdio_command: node fixtures/servers/hello-mcp-server/server.cjs\n          fail_on: high\n```\n\n---\n\n## Automated releases\n\n- On each push to `main`, `.github/workflows/release.yml` now:\n  - runs lint/test/build\n  - computes the next available version above local and npm latest\n  - builds release assets (package tarball + compiled `dist` archive)\n  - creates/updates a GitHub Release with GitHub generated (auto/AI-style) release notes + uploaded assets\n  - publishes the new package to npm (requires `NPM_TOKEN`)\n- For npm publishing in CI, set `NPM_TOKEN` to an **npm Automation token** (no interactive password/OTP required).\n\n## Docs site (GitHub Pages)\n\n- URL pattern: `https://<owner>.github.io/mcp-guard/`\n- Current docs: https://tomas-1226.github.io/mcp-guard/\n- One-time setup: **Settings → Pages → Source → GitHub Actions**\n\n---\n\n## Troubleshooting\n\n<details>\n<summary><strong>Publishing ENOENT / package.json not found</strong></summary>\n\nRun `npm publish` from the project root (the directory containing `package.json`).\n\n</details>\n\n<details>\n<summary><strong>HTTP target fails</strong></summary>\n\nConfirm endpoint supports JSON-RPC via HTTP POST and increase `--timeout-ms` if startup is slow.\n\n</details>\n\n<details>\n<summary><strong>Windows command quoting</strong></summary>\n\nWrap `--stdio` values in double quotes.\n\n</details>\n\n---\n\n## Release helper\n\nBuild release artifacts locally/offline (after one online `npm ci`):\n\n```bash\nnpm run release:offline\n```\n\n---\n\n## Links\n\n- Docs: https://tomas-1226.github.io/mcp-guard/\n- GitHub: https://github.com/TomAs-1226/mcp-guard\n- npm: https://www.npmjs.com/package/@baichen_yu/mcp-guard\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\n\n### npm package run check\n\n```bash\nnpm run npm:test-run\n```\n","readmeFilename":"README.md"}