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
  2. Usage
  3. CI and exit codes
  4. Detection rules
  5. Shield: continuous monitoring
  6. Help and issues

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

OptionWhat it does
-r, --recursiveRecurse into directories
-j, --jsonEmit JSON instead of the human report
--sarifEmit SARIF 2.1.0 (upload with github/codeql-action/upload-sarif)
--ignore RULESuppress a rule ID; pass it more than once for several rules
--no-colorDisable 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.

IDSeverityRuleWhat it catches
OGN-100HighSuspicious server URLIP addresses, ngrok and other tunnel hosts, free TLDs, or .onion in a server URL
OGN-101CriticalUnencrypted remote serverA remote MCP server using HTTP instead of HTTPS
OGN-200CriticalHardcoded credential in envAPI key, token, or private key material in a server's env config
OGN-201CriticalCredential in command argsA token passed through CLI args, where process listings can see it
OGN-202CriticalCredential pattern in fileA token pattern in the raw config file outside structured fields
OGN-300CriticalPrompt injection in tool descriptionInjection patterns in tool descriptions that hijack agent behavior
OGN-400HighDangerous permission grantedA server requesting a high-risk capability such as shell_exec, admin, or sudo
OGN-500MediumUnverified package serverAn unpinned npx, uvx, or pip command, which is a supply-chain attack surface
OGN-600HighTLS certificate expiring soonA remote MCP server's TLS certificate expires within 14 days
OGN-601CriticalTLS certificate expiredA remote MCP server's TLS certificate is expired or fails verification
OGN-602CriticalRemote endpoint serves HTTPA remote MCP endpoint on plain HTTP, where traffic and credentials are visible on the network path
OGN-603HighRemote endpoint unreachable or failingA remote MCP server that returns a non-success HTTP status or cannot be reached
OGN-604MediumResponse header discloses software identityHeaders 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/mo

Set 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

CommandWhat it does
shield activate KEYActivate Shield with your license key
shield license [--refresh]Show license status; --refresh skips the 24 hour cache and re-verifies
shield add [--remote] TARGETRegister a config path, or a remote endpoint URL with --remote
shield remove [--remote] TARGETUnregister a path or remote endpoint
shield statusShow Shield state
shield scan-nowForce an immediate scan of everything registered
shield logs [-n N]Show recent Shield events (last 20 by default)
shield start / stopStart the daemon in the foreground, or stop it
shield install-launchdInstall a macOS launchd job for unattended monitoring
shield uninstall-launchdRemove the macOS launchd job
shield deactivateStop 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:

ChannelEnvironment 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)
SlackOGUNSCAN_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