Skip to main content

MCP supply chain security scanner

Project description

MCPCheck 🔒

PyPI version License: MIT Python 3.11+

MCP supply chain security scanner. Detect tool poisoning, prompt injection, data exfiltration, and other attacks in MCP server definitions.

Installation

pip install mcpcheck

Usage

Basic scan

mcpcheck ./my-mcp-server

JSON output

mcpcheck ./my-mcp-server --format json

SARIF for CI/CD

mcpcheck ./my-mcp-server --format sarif > results.sarif

Severity filter

mcpcheck ./my-mcp-server --min-severity HIGH

Exclude patterns

mcpcheck ./my-mcp-server --exclude "vendor/*" --exclude "node_modules/*"

Detected Vulnerabilities

Rule ID Category Severity Description
tool_poisoning_instructions TOOL_POISONING CRITICAL Detects prompt injection patterns such as "ignore previous instructions", "you are now in admin mode", "override previous", "disregard", and "new instructions:" in tool names and descriptions.
hidden_behavior HIDDEN_BEHAVIOR HIGH Detects hidden actions and concealed behaviors like "secretly send/copy/read", "without notifying the user", hidden instructions/directives, and directives that the user must not notice.
data_exfiltration DATA_EXFILTRATION HIGH Detects hidden data sending patterns such as "send all data to", "exfiltrate", and covert data exfiltration in tool descriptions.
behavioral_mismatch BEHAVIORAL_MISMATCH HIGH Detects when tool descriptions contradict their stated purpose — e.g. tools described as benign but containing keywords like "secretly", "silently", "covertly", or "ignore the user".
external_url EXTERNAL_URL MEDIUM Flags any external URL in tool descriptions (excluding localhost/127.0.0.1) that could indicate callback or data exfiltration endpoints.
parameter_smuggling PARAMETER_SMUGGLING MEDIUM Detects hidden or undocumented parameters and attempts to embed secret data in responses or metadata.

Exit Codes

Code Meaning
0 Clean — no CRITICAL or HIGH findings detected
1 One or more CRITICAL or HIGH findings were detected

CI/CD Integration

MCPCheck includes a GitHub Action (action.yml) for seamless CI/CD integration. It runs a scan, uploads results as a SARIF artifact, and integrates with GitHub Code Scanning.

name: MCPCheck Scan
on:
  push:
    branches: [main]
  pull_request:

jobs:
  mcpcheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run MCPCheck
        uses: onicarps/MCPSafe@main
        with:
          path: "."
          severity: "LOW"
          version: "0.1.0"

      # The action automatically uploads SARIF results to GitHub Code Scanning.
      # Findings will appear under the "Security" tab in your repository.

You can also invoke MCPCheck directly in any CI pipeline:

pip install mcpcheck
mcpcheck ./my-mcp-server --format sarif > results.sarif

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_scan_safe-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_scan_safe-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_scan_safe-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_scan_safe-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_scan_safe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4fc737cbb09cb16640eeb06e4ad84b2cd193dab4b8736516421292a615478da
MD5 e315358dad7fce1d52f1b02a7365871d
BLAKE2b-256 209bb98a558bd0db78fafc59b55b9a04df0de324ecba3d5c7aca97eb5f13022a

See more details on using hashes here.

File details

Details for the file mcp_scan_safe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_scan_safe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_scan_safe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd3c9be92ea31af92edea6b99812a0a7ac2d2625f5a540bf720d047f02efc8c4
MD5 e1830aba4cb7870beccd2c4b74fe5c93
BLAKE2b-256 d747f03dd9e03cf820d55f2e87b689cb6d6b8b85b994a8387edd719be368fa81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page