OgunScan documentation
OgunScan audits Model Context Protocol (MCP) server configs for prompt injection, exposed credentials, suspicious server origins, and supply-chain risks. The CLI is free, open source, and has zero runtime dependencies.
1. Installation
Requires Python 3.9 or newer.
Free CLI
pip install ogunscan
The free CLI has no dependencies beyond the Python standard library.
With Shield
pip install "ogunscan[shield]"
The shield extra adds watchdog, which the Shield daemon uses to watch config files for changes. Keep the quotes: some shells (zsh included) treat the square brackets as a pattern otherwise.
Check the install
ogunscan --version
ogunscan --help
2. Usage
# Auto-detect known MCP config locations (Claude Desktop, Cursor, and others)
ogunscan scan
# Scan a specific file
ogunscan scan ~/.cursor/mcp.json
# Scan a directory, recursively
ogunscan scan ./configs --recursive
# Path-first shorthand (the scan verb is optional)
ogunscan ~/.cursor/mcp.json
# JSON output for scripts
ogunscan scan ~/.cursor/mcp.json --json
# SARIF 2.1.0 output for the GitHub Security tab
ogunscan scan . --recursive --sarif > ogunscan.sarif
# Suppress specific rules (repeatable)
ogunscan scan . --ignore OGN-500 --ignore OGN-100
# List every detection rule
ogunscan rules
Scan options
| Option | What it does |
|---|---|
| -r, --recursive | Recurse into directories |
| -j, --json | Emit JSON instead of the human report |
| --sarif | Emit SARIF 2.1.0 (upload with github/codeql-action/upload-sarif) |
| --ignore RULE | Suppress a rule ID; pass it more than once for several rules |
| --no-color | Disable color output |
3. CI and exit codes
The CLI exits 1 when any CRITICAL or HIGH finding is reported and 0 otherwise, so it can gate a pipeline directly.
name: Security
on: [push, pull_request]
jobs:
mcp-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ogunscan
- run: ogunscan scan . --recursive --json > ogunscan-report.json
- if: always()
uses: actions/upload-artifact@v4
with:
name: ogunscan-report
path: ogunscan-report.json
4. Detection rules
The config rules (OGN-1xx to OGN-5xx) run on every scan. The remote endpoint rules (OGN-6xx) run when Shield monitors a remote MCP server registered with ogunscan shield add --remote. Run ogunscan rules for the list that ships with your installed version.
| ID | Severity | Rule | What it catches |
|---|---|---|---|
| OGN-100 | High | Suspicious server URL | IP addresses, ngrok and other tunnel hosts, free TLDs, or .onion in a server URL |
| OGN-101 | Critical | Unencrypted remote server | A remote MCP server using HTTP instead of HTTPS |
| OGN-200 | Critical | Hardcoded credential in env | API key, token, or private key material in a server's env config |
| OGN-201 | Critical | Credential in command args | A token passed through CLI args, where process listings can see it |
| OGN-202 | Critical | Credential pattern in file | A token pattern in the raw config file outside structured fields |
| OGN-300 | Critical | Prompt injection in tool description | Injection patterns in tool descriptions that hijack agent behavior |
| OGN-400 | High | Dangerous permission granted | A server requesting a high-risk capability such as shell_exec, admin, or sudo |
| OGN-500 | Medium | Unverified package server | An unpinned npx, uvx, or pip command, which is a supply-chain attack surface |
| OGN-600 | High | TLS certificate expiring soon | A remote MCP server's TLS certificate expires within 14 days |
| OGN-601 | Critical | TLS certificate expired | A remote MCP server's TLS certificate is expired or fails verification |
| OGN-602 | Critical | Remote endpoint serves HTTP | A remote MCP endpoint on plain HTTP, where traffic and credentials are visible on the network path |
| OGN-603 | High | Remote endpoint unreachable or failing | A remote MCP server that returns a non-success HTTP status or cannot be reached |
| OGN-604 | Medium | Response header discloses software identity | Headers such as Server or X-Powered-By revealing software versions |
5. Shield: continuous monitoring
The free CLI scans on demand. Shield runs in the background, rescans your registered configs when they change and on a schedule (every 6 hours by default), checks remote MCP endpoints, and alerts you when a new risk appears. Shield is $9/month and is activated with a license key.
Get Shield, $9/moSet up
# 1. Install with the Shield extra
pip install "ogunscan[shield]"
# 2. Activate with the license key from your purchase email
ogunscan shield activate YOUR-LICENSE-KEY
# 3. Register what to watch
ogunscan shield add ~/.cursor/mcp.json
ogunscan shield add --remote https://mcp.example.com/mcp
# 4. Start monitoring
ogunscan shield start # foreground
ogunscan shield install-launchd # macOS: run unattended under launchd
Shield commands
| Command | What it does |
|---|---|
| shield activate KEY | Activate Shield with your license key |
| shield license [--refresh] | Show license status; --refresh skips the 24 hour cache and re-verifies |
| shield add [--remote] TARGET | Register a config path, or a remote endpoint URL with --remote |
| shield remove [--remote] TARGET | Unregister a path or remote endpoint |
| shield status | Show Shield state |
| shield scan-now | Force an immediate scan of everything registered |
| shield logs [-n N] | Show recent Shield events (last 20 by default) |
| shield start / stop | Start the daemon in the foreground, or stop it |
| shield install-launchd | Install a macOS launchd job for unattended monitoring |
| shield uninstall-launchd | Remove the macOS launchd job |
| shield deactivate | Stop the daemon, release the seat, and remove the license key |
Alerts
New and resolved findings are always recorded in Shield's event history (ogunscan shield logs) and printed to the daemon's output. Email and Slack alerts switch on when their environment variables are set in the daemon's environment:
| Channel | Environment variables |
|---|---|
| Email (SMTP) | OGUNSCAN_SMTP_HOST, OGUNSCAN_SMTP_PORT, OGUNSCAN_SMTP_USER, OGUNSCAN_SMTP_APP_PASS, OGUNSCAN_ALERT_EMAIL (optional, defaults to the SMTP user) |
| Slack | OGUNSCAN_SLACK_WEBHOOK (a https://hooks.slack.com/... incoming webhook URL) |
A Shield setup guide is also available as a PDF: OgunScan Shield setup guide.
6. Help and issues
- Source and issues: github.com/Ten30studio/ogunscan
- Package: pypi.org/project/ogunscan
- Contact: admin@ten30studio.com