mcpscc
Health Warn
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Pass
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Security Command Center for Model Context Protocol (MCP) servers. Detect prompt injection, tool poisoning, secrets, and vulnerabilities. The Trivy of MCP security.
MSCC — MCP & Agent Security Scanner
Scan the things that inject text into your AI agent's context — before that text becomes an instruction.
MSCC audits the agent-context attack surface: MCP servers, MCP client
configurations, agent skills, and persistent memory files. These are
different artifacts with one shared failure mode — untrusted text crosses a
boundary into an agent's context and is then treated as instruction (a
poisoned tool description, a malicious SKILL.md, a planted line inCLAUDE.md). MSCC finds that text, including the credential-exfiltration
flows that are written in plain English and have no code signature for a
traditional scanner to match.
What it scans
| Surface | What MSCC looks at | Why it matters |
|---|---|---|
| MCP servers (source) | Server code across 6 languages, tool manifests, capability declarations | Command injection, secret exposure, over-broad permissions |
| MCP servers (live) | A running stdio server's tools, resources, prompts | Tool poisoning and injection in the descriptions the model actually sees |
| MCP client configs | claude_desktop_config.json, .mcp.json, mcp.json, … |
Unpinned packages (supply-chain), plaintext secrets, plain-HTTP servers |
| Agent skills | SKILL.md and skill Markdown |
Natural-language exfiltration, instruction overrides, embedded secrets |
| Agent memory | CLAUDE.md, AGENTS.md, MEMORY.md, SOUL.md, … |
Planted instructions that persist across sessions (OWASP ASI06) |
The headline capability is toxic-flow detection: MSCC flags an artifact
that both instructs the agent to read something sensitive and to send data
out — the shape of a credential-exfiltration attack expressed in prose.
Install
# Core scanner + CLI (no server components)
pip install mscc
# Run without installing (recommended for a one-off machine audit)
uvx mscc surface
Optional extras:
pip install "mscc[pdf]" # PDF report export
pip install "mscc[api]" # FastAPI server, Celery workers, Postgres/Redis
pip install "mscc[dev]" # test + lint toolchain
Requires Python 3.10+.
Quick start
Audit this whole machine
mscc surface
Discovers every MCP client config, installed skill, and agent memory file for
Claude, Cursor, Windsurf, VS Code, Gemini, Codex, Zed and others, scans them
all, and prints a per-source risk table plus any exfiltration flows it finds.
Scan a directory or file
mscc scan ./my-mcp-server
mscc scan ./skills/my-skill/SKILL.md
mscc scan . --profile dev-fast
mscc scan . --max-risk 70 -o results.sarif # for CI
Scan a Git repository
mscc scan-repo https://github.com/org/mcp-server --branch main --subpath src
Scan a live MCP server
# Launches the server over stdio and audits its advertised tools/prompts.
# Only run servers you trust to start locally.
mscc scan-server "npx -y @modelcontextprotocol/server-github"
Python SDK
from mscc import MSCCClient, scan_local
result = scan_local("./my-mcp-server")
print(f"Risk score: {result.risk_score}/100 ({len(result.findings)} findings)")
for f in result.findings:
loc = f"{f.file_path}:{f.line_number}" if f.file_path else "-"
print(f"[{f.severity.value}] {f.title} ({loc})")
# Export
result.to_sarif() # dict, ready for GitHub code scanning
open("report.html", "w").write(result.to_html())
An AsyncMSCCClient with the same API (await client.scan(...),scan_multiple(...)) is available for concurrent scans.
Detection coverage
MSCC combines four detection engines:
- Static patterns — 60+ compiled regex rules across Python, JavaScript/
TypeScript, Go, Rust, Java, and C#, plus config and prose rules. Rules are
scoped to the languages they apply to, so a Java rule never fires on a
Python file. - Context analysis — prose-oriented detection for skill and memory files:
toxic flows, standing instructions to read secrets, instruction overrides,
embedded credentials, and external references loaded into memory. - YARA rules — packaged rules for the OWASP MCP Top 10 and secret
detection, extensible with your own.yarfiles. - MCP client-config analysis — supply-chain and secret checks on the
mcpServersblocks of client configuration files.
Findings are mapped to the OWASP MCP Top 10, OWASP ASI06 (persistent
context poisoning), and CWE identifiers where applicable. Seedocs/detection-coverage.md for the full rule
catalog.
Suppressing a finding
Add an inline marker on the offending line:
os.system(cmd) # mscc:ignore # suppress all rules here
os.system(cmd) # mscc:ignore[command-injection-shell] # suppress one rule
Scan profiles
| Profile | Engines | Severity floor | Use case |
|---|---|---|---|
dev-fast |
static + context | medium and up | quick local checks |
ci-standard (default) |
static + context + YARA | low and up | CI/CD gating |
full-enterprise |
static + context + YARA | all, incl. info | deep audits, mscc surface |
Reports
Every result exports to JSON, SARIF 2.1.0 (with a populated rule
catalog and repo-relative paths for GitHub code scanning), Markdown,
HTML, an SVG badge, and PDF (mscc[pdf]). All report formats
HTML-escape finding content, so hostile payloads in a scanned file can't
inject into the report.
Output format is chosen by the -o file extension:
mscc scan . -o report.json
mscc scan . -o report.sarif
mscc scan . -o report.html
mscc scan . -o badge.svg
CI/CD
name: MCP Security Scan
on: [push, pull_request]
jobs:
mscc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install mscc
- run: mscc scan . --max-risk 70 -o results.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: results.sarif
Exit codes: 0 pass, 1 findings exceeded threshold (or a critical finding),2 the scan itself failed to run. A failed scan never reports as a pass.
A reusable workflow is provided in.github/workflows/mscc-scan.yml.
API server (optional)
The mscc[api] extra ships a FastAPI service for centralized scanning.
pip install "mscc[api]"
uvicorn mscc.api.app:app --host 0.0.0.0 --port 8000
# or: docker compose up --build
| Method | Endpoint | Description |
|---|---|---|
| GET | /health, /ready |
Liveness / readiness |
| GET | /docs |
OpenAPI documentation |
| POST | /api/v1/scans |
Scan a path |
| POST | /api/v1/scans/manifest |
Scan a manifest file |
Deploy it safely — see docs/api.md:
- Set
MSCC_API_KEYto require theX-API-Keyheader (compared in constant time). - Set
MSCC_SCAN_ROOTto confine scanning to one directory. Without it the API
will scan any path the process can read and echo matched content in findings. - Set
MSCC_CORS_ORIGINSto an explicit origin list in production.
Documentation
| Doc | Contents |
|---|---|
| docs/architecture.md | How the engines fit together |
| docs/cli.md | Full command reference |
| docs/sdk.md | Python SDK reference |
| docs/detection-coverage.md | Every rule and category |
| docs/agent-context.md | Skills, memory, and toxic-flow model |
| docs/api.md | REST API and production deployment |
| docs/configuration.md | Environment variables |
| docs/writing-rules.md | Adding static and YARA rules |
Scope & honesty
MSCC is a detection aid, not a proof of safety. Static and prose analysis
have false positives and false negatives; a clean scan is not a guarantee.
Treat findings as leads to review, not verdicts. The roadmap
(SCOPE.md) tracks planned work — including a cross-surface
provenance graph — which is not implemented yet and is not claimed here.
Contributing
See CONTRIBUTING.md. Detection rules live insrc/mscc/scanner/static.py (patterns), src/mscc/scanner/context.py (prose),
and src/mscc/rules/ (YARA).
Security
Report vulnerabilities per SECURITY.md.
License
Apache-2.0 — see LICENSE.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found