Skip to main content

mcp-sdk-audit

Upgrading your MCP SDK isn't always enough. This finds the code that stays exposed after you upgrade.

CI License: MIT Python 3.11+ Zero dependencies

mcp-sdk-audit checks projects that use the official Model Context Protocol SDKs (TypeScript, Python, Go). It does two things:

  1. Dependencies. It reads your lockfiles, including transitive dependencies, and matches every resolved MCP SDK version against the GitHub Advisory Database.
  2. Code. Several 2026 advisories say that upgrading changes nothing unless you also change your code. The tool flags code that still has one of those problems, even when the SDK is already patched.

mcp-sdk-audit output

Why this exists

Between December 2025 and November 2026 the official MCP SDKs received a run of security advisories. Several of them have a fix that is off by default, or that only works once your code changes:

Advisory What upgrading alone leaves open
GHSA-6qxp-vccf-f47h (TS) / GHSA-qx49-fqc8-xw99 (Py) Bundled client-credentials and private-key-JWT providers still send secrets to whichever authorization server the MCP server names, until you pass expectedIssuer / issuer=.
GHSA-rvq5-wwqv-78pq (TS) / GHSA-w4fh-qvv9-3v23 (Py) Bearer auth accepts tokens issued for other services until you set expectedResource / validate_token_resource=True.
GHSA-345p-7cg4-v4c7, GHSA-jm63-cq47-j5jp (TS) A transport or server created once at startup and shared across clients sends one client's responses to another. Older README examples showed this pattern, and patched SDKs now fail at runtime on it.
GHSA-6prh-2h8m-c8cw (TS) / GHSA-5h93-6whr-6q8j (Py) redirectPolicy: 'follow' or a follow_redirects=True client brings back cross-origin redirect leaks of API keys and token-request bodies.
GHSA-w48q-cv73-mx4w, GHSA-9h52-p55h-vw2f, GHSA-vj7q-gjh5-988w Hand-built Express apps and low-level Python transports get no DNS-rebinding / Host-header protection unless you add it.

Dependabot, npm audit, pip-audit and osv-scanner stop being useful once the version is bumped. That's exactly the point where these advisories still need a code change.

Install

pipx install mcp-sdk-audit
# or
pip install mcp-sdk-audit

Python 3.11+ and no third-party dependencies.

Usage

mcp-sdk-audit                       # scan the current directory
mcp-sdk-audit path/to/project
mcp-sdk-audit --online              # use the latest advisories instead of the bundled snapshot
mcp-sdk-audit -f sarif -o mcp.sarif # SARIF for GitHub code scanning
mcp-sdk-audit -f json               # machine-readable
mcp-sdk-audit --fail-on high        # exit 1 only on high/critical (default: medium)
mcp-sdk-audit --include-tests       # also check test files (skipped by default)
mcp-sdk-audit --list-rules

Exit codes: 0 nothing at or above --fail-on, 1 findings, 2 usage error.

GitHub Action

name: mcp-sdk-audit
on: [push, pull_request]
permissions:
  contents: read
  security-events: write   # for SARIF upload
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: garag0l/mcp-sdk-audit@v0.1.2
        with:
          fail-on: high        # critical | high | medium | low | none
          # upload-sarif: "true"
          # online: "true"     # fetch fresh advisories with the job's GITHUB_TOKEN

Findings show up under Security → Code scanning, and the text report is added to the job summary.

What it reads

Ecosystem Files
npm package-lock.json, npm-shrinkwrap.json, pnpm-lock.yaml, yarn.lock (v1 and Berry), bun.lock
PyPI uv.lock, poetry.lock, pdm.lock, Pipfile.lock, requirements*.txt (pinned)
Go go.mod

Packages: @modelcontextprotocol/{sdk,client,server,server-legacy,core,node,express,hono,fastify}, mcp (PyPI), github.com/modelcontextprotocol/go-sdk.

Source rules

ID Lang Severity Flags
MCPA001 TS high ClientCredentialsProvider / PrivateKeyJwtProvider / StaticPrivateKeyJwtProvider / CrossAppAccessProvider without expectedIssuer
MCPA002 TS medium requireBearerAuth() / verifyBearerToken() without expectedResource
MCPA003 TS medium redirectPolicy: 'follow'
MCPA004 TS high Stateless HTTP server transport created at module scope in a file that serves HTTP
MCPA005 TS high Module-scope McpServer/Server that connect()s inside a request handler
MCPA006 TS medium Deprecated experimental taskStore / InMemoryTaskStore
MCPA007 TS low express() + HTTP MCP transport with no Host-header validation or auth
MCPA101 Py high ClientCredentialsOAuthProvider / PrivateKeyJWTOAuthProvider / RFC7523OAuthClientProvider without issuer=
MCPA102 Py medium AuthSettings(...) without validate_token_resource
MCPA103 Py medium follow_redirects=True in files that use MCP client transports
MCPA104 Py low StreamableHTTPSessionManager / SseServerTransport / websocket_server without security_settings

The rules are deliberately simple text heuristics. Comments and strings are masked, and definitions, spread or **kwargs options, and options passed by variable are skipped rather than guessed at. Every finding names the advisory behind it, so you can confirm or dismiss it in seconds. Tuning: against the official typescript-sdk, python-sdk, servers and github-mcp-server repos, the remaining findings are SDK examples that leave expectedResource / validate_token_resource unset. The advisories themselves describe that pattern.

No Go source rules yet: the Go advisories are fixed by upgrading alone. Go dependencies are still version-checked.

Keeping advisories current

The package ships a snapshot of the advisories in src/mcp_sdk_audit/data/advisories.json. A scheduled workflow refreshes it daily and opens a PR. --online (and the Action's default) queries the GitHub Advisory Database at scan time instead, using GITHUB_TOKEN if it's set.

Scope and responsible use

This is a defensive tool for code you own or are authorized to assess. It reads files and makes no network calls except --online advisory lookups to api.github.com. It doesn't exploit anything.

Contributing

Issues and PRs are welcome, especially new rules when an advisory says "upgrading alone is not enough", false-positive reports with a minimal snippet, and more lockfile formats.

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest && ruff check . && ruff format --check .

License

MIT

Metadata

Release files for mcp-sdk-audit 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-sdk-audit 0.1.2
File Size Uploaded Provenance Actions
mcp_sdk_audit-0.1.2.tar.gz 32.3 kB With provenance Details for mcp_sdk_audit-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-sdk-audit 0.1.2
File Interpreter ABI Platform Actions
mcp_sdk_audit-0.1.2-py3-none-any.whl Python 3 none any Details for mcp_sdk_audit-0.1.2-py3-none-any.whl

Total release size: 56.5 kB

Release files / mcp_sdk_audit-0.1.2.tar.gz

Download URL mcp_sdk_audit-0.1.2.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a262a3249bd60015b5e46ef3e9082ccb7b9defac778eda001e4e76b5a7f0ff01
BLAKE2b-256 checksum
How to use checksums
829535d4a18df3b86d047abec2dffdff04959b687bd296f27853b2a2f3d6dad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / mcp_sdk_audit-0.1.2-py3-none-any.whl

Download URL mcp_sdk_audit-0.1.2-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc37b10da2a59bcae8d7601792e73d21646e1565ccec08e395c9b650ebc6cb05
BLAKE2b-256 checksum
How to use checksums
c8354231723ce18914f672eb8145c945cc8b5fe60bedd2465f667b1e054fa56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for mcp-sdk-audit 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_sdk_audit-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page