auditing-mcp-server-pre-trust
Skill3 starsChanged 6 months agoMITView on GitHub
Audits an MCP (Model Context Protocol) server against six security checks — license, source review, network egress, version pin, secret handling, and tool subset — before the server is registered into the Claude Code tool pool. Use whenever the user proposes adding an MCP server to ~/.claude/mcp.json, a project .mcp.json, or a plugin's mcpServers config. Produces a per-check verdict, a blocking-issues list, and a final integrate / integrate-with-constraints / reject recommendation.
- Installs packages
In this repository104 other files it gives its agents.
- auditing-instruction-hierarchySkill
- authoring-pluginSkill
- authoring-skillSkill
- authoring-tool-hookSkill
- running-eval-driven-skill-developmentSkill
- writing-decision-trees-as-skillsSkill
- writing-deny-allow-rulesSkill
- writing-mcp-server-securelySkill
- analyzing-causal-dagSkill
- analyzing-regression-diagnosticsSkill
- applying-differential-privacySkill
- auditing-chunking-strategySkill
- auditing-deep-learning-overfitSkill
- auditing-embedding-driftSkill
- auditing-inference-latency-budgetSkill
- auditing-model-fairnessSkill
- auditing-prompt-token-budgetSkill
- auditing-rlhf-reward-hackingSkill
- auditing-sft-datasetSkill
- auditing-synthetic-data-leakageSkill
- auditing-synthetic-data-utilitySkill
- auditing-train-test-splitSkill
- building-baseline-modelsSkill
- building-canary-rolloutSkill
- building-conformal-prediction-setSkill
- building-data-dictionary-with-consent-classSkill
- building-rag-eval-setSkill
- building-rollback-planSkill
- checking-test-assumptionsSkill
- comparing-models-fairlySkill
- enforcing-leakage-firewallSkill
- evaluating-binary-classifiersSkill
- evaluating-multiclass-classifiersSkill
- evaluating-ood-detectionSkill
- evaluating-rag-retrievalSkill
- evaluating-regression-modelsSkill
- generating-data-dictionarySkill
- generating-shap-explanationsSkill
- interpreting-conflicting-testsSkill
- monitoring-data-driftSkill
- monitoring-prediction-driftSkill
- packaging-model-for-deploymentSkill
- profiling-llm-costSkill
- recommending-model-tierSkill
- reporting-effect-sizesSkill
- running-adversarial-perturbation-suiteSkill
- running-bayesian-workflowSkill
- running-chollet-ratio-checkSkill
- running-eval-before-after-finetuneSkill
- running-hyperparameter-sweepSkill
- running-power-analysisSkill
- scaffolding-pytorch-training-loopSkill
- selecting-embedding-modelSkill
- selecting-statistical-testSkill
- tuning-classification-thresholdSkill
- writing-finetune-spec-sheetSkill
- writing-model-cardsSkill
- applying-secure-coding-rulesSkill
- auditing-graphql-nullabilitySkill
- auditing-pinned-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 74
Verify a LICENSE file exists in the repo root or pyproject.toml / package.json declares a license
- Distinctive: line 82
Read source files (top file at minimum).
- Distinctive: line 87
Read the README and source for documented outbound calls (API endpoints, telemetry, update checks)
- Distinctive: line 98
Verify secrets are NOT logged (search for log/print calls near secret usage)
- Distinctive: line 99
Verify secrets are NOT included in error messages sent to a remote service
- Very specific: line 106
If the MCP exposes destructive tools (file deletion, network requests, shell execution), flag for permission_level: elevated review
- Distinctive: line 110
Integrate: all 6 checks pass; install
- Distinctive: line 119
Per-check verdict table: Check · Verdict (Pass / Warn / Fail) · Evidence · Notes
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auditing an MCP Server Before Pre-Trust
When to use
Trigger this skill when the user asks for or implies one of:
- Adding a new MCP server to
~/.claude/mcp.json, a project.mcp.json, or a plugin'smcpServersconfig - Evaluating whether to install or trust a community / third-party MCP server
- Phrases like "should I add this MCP?", "is this MCP server safe?", "install
<mcp-name>", "audit this MCP"
When NOT to use
Skip this skill and hand off when:
- The user wants to write an MCP server, not audit an existing one → use
claude-code-meta/writing-mcp-server-securely(planned) - The MCP server is already registered and the question is "did it do something weird?" — that is incident-response, not pre-trust
- The user is configuring a first-party Anthropic MCP server bundled with Claude Code that has already gone through Anthropic's audit
Quick start
User says: "I want to add the github-mcp-server from https://github.com/example/github-mcp to my Claude Code setup. Audit it."
Skill response: walks the six checks (license, source, network, version, secret, tool subset), produces a per-check verdict table, lists any blocking issues, and gives a final integrate / integrate-with-constraints / reject recommendation with rationale.
Inputs / Arguments / Flags
| Argument | Type | Required | Default | Description |
| mcp_source | URL or local path | yes | — | The MCP server source — GitHub URL, npm package name, local path, or PyPI package name. |
| install_scope | "user" | "project" | "plugin" | no | "user" | Where the MCP will be registered. Affects blast radius assessment. |
| permission_level | "default" | "elevated" | no | "default" | Whether the MCP would run with default Claude Code permissions or elevated. |
Reviewer stance
Adopt the stance of an expert senior software developer with 30 years of experience in the language(s) and frameworks of the artifact under review. Apply that depth throughout: name the failure modes a junior reviewer would miss, weigh tradeoffs explicitly, and ground every finding in specific evidence from the artifact.
Workflow
Copy this checklist into the response and check off items as each check completes:
Pre-trust audit progress:
- [ ] Check 1: License — present, permissive, redistribution OK
- [ ] Check 2: Source review — last commit, contributor count, signed commits, suspicious patterns
- [ ] Check 3: Network egress — declared outbound calls, no exfiltration risks
- [ ] Check 4: Version pin — install command pins a specific version (not @latest, not unpinned)
- [ ] Check 5: Secret handling — how secrets are passed, never logged, never sent to upstream
- [ ] Check 6: Tool subset — list of tools the MCP exposes; principle of least privilege
- [ ] Final verdict: integrate / integrate-with-constraints / rejectCheck 1: License
- Verify a
LICENSEfile exists in the repo root orpyproject.toml/package.jsondeclares a license - Confirm the license is permissive enough for the user's context (MIT / Apache 2.0 / BSD typically fine; AGPL may not be)
- Flag any "no license = all rights reserved" cases as blocking
Check 2: Source review
- Identify the latest commit date and the count of distinct contributors
- Note whether commits are signed (sigstore / GPG)
- Read source files (top file at minimum); look for: shell command execution with user-controlled input, dynamic import with user-controlled strings, telemetry endpoints, hardcoded credentials
- Flag obvious red flags (obfuscated code, base64-encoded payloads, suspicious network calls) as blocking
Check 3: Network egress
- Read the README and source for documented outbound calls (API endpoints, telemetry, update checks)
- Compare against the MCP's stated purpose — a "filesystem tool" with HTTP calls is suspicious
- Confirm any documented endpoints are owned by the MCP author / well-known third party (GitHub API for a GitHub MCP, etc.)
Check 4: Version pin
The install command MUST pin a specific version. Acceptable forms include npm-style pkg@1.2.3, pip-style pkg==1.2.3, or git-clone with explicit commit sha. Unpinned forms (latest, no version constraint, npx -y, pip install pkg without a constraint) are blocking.
Check 5: Secret handling
- Identify how the MCP consumes secrets (env vars, config file, OAuth flow)
- Verify secrets are NOT logged (search for log/print calls near secret usage)
- Verify secrets are NOT included in error messages sent to a remote service
- For OAuth flows, confirm the callback URL is localhost or under the MCP author's domain
Check 6: Tool subset
- List every tool the MCP exposes (
tools/listoutput if available, or grep the source) - Apply principle of least privilege — does this MCP need ALL these tools, or only some?
- If the MCP exposes destructive tools (file deletion, network requests, shell execution), flag for
permission_level: elevatedreview
Final verdict
- Integrate: all 6 checks pass; install
- Integrate with constraints: 4–5 checks pass; constraints required (subset of tools enabled, network egress blocked at firewall, etc.)
- Reject: ≥ 2 checks fail OR any single blocking issue identified
Outputs
A markdown report:
- MCP identity — name, version, source URL
- Per-check verdict table: Check · Verdict (Pass / Warn / Fail) · Evidence · Notes
- Blocking issues list (if any)
- Final recommendation — integrate / integrate-with-constraints / reject — with rationale
- Install command (if integrate or integrate-with-constraints) — exact pinned command
Failure modes
- Audit theater — going through the checklist without genuine inspection. Caught by: required "Evidence" column on the verdict table (must cite specific files / lines / commits).
- Permissive license bias — assuming permissive license = safe code. License is necessary, not sufficient. Source review (Check 2) is separate.
- Stale source review — auditing one commit and integrating later versions. Caught by: Check 4 requires a specific version/sha pin AND a re-audit on version bumps.
- Tool-subset omission — installing an MCP and accepting all tools by default. Caught by: Check 6 requires explicit tool-subset declaration.
References
reference/audit-table-template.md— the per-check verdict table templatereference/red-flag-patterns.md— specific code patterns that indicate compromise- Claude Code MCP documentation
- MCP specification
Examples
Example 1: Pinned, licensed, low-privilege MCP (happy-path)
Input: "Audit github.com/anthropics/mcp-filesystem v1.2.3 for my project scope."
Output: Skill walks all six checks. License: MIT ✓. Source: 14 contributors, last commit 3 days ago, no signed commits but Anthropic ownership confirmed via GitHub org ✓. Network: no egress declared, source confirms no outbound calls ✓. Version: pinned to v1.2.3 ✓. Secrets: MCP accepts a working directory path; no secrets handled ✓. Tools: read_file, write_file, list_directory (3 tools, all expected for a filesystem MCP) ✓. Final: integrate.
Example 2: Unknown MCP, no license (anti-trigger)
Input: "Add this random MCP I found: https://github.com/randomuser/cool-mcp"
Output: Skill begins audit, immediately fails Check 1 (no LICENSE file in repo root, no license declaration in pyproject.toml). Reports blocking issue. Final: reject. Recommends user contact the author for license clarification before re-audit.
See also
security/auditing-pinned-dependencies— broader supply-chain audit patternclaude-code-meta/writing-mcp-server-securely— the authoring side of this skill (planned)workflow/adversarial-premortem-single— for high-stakes MCP integration decisions
Status & version
- Status: shipped
- Version: 0.1.0
- Last-updated: 2026-05-23
- Provenance: migrated from
~/.claude/skills/mcp-server-pre-trust-audit/; reformatted to Layer-3 contract; slug renamed to enforce gerund convention
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

