MCP server security: what to audit before you add one | Claude Code Toolkit
Deep dives

MCP server security: what to audit before you add one

A checklist for evaluating MCP servers before they touch your production data — permissions, provenance, network scope, and the questions our team asks every time.

MK
Mateo K. August 19, 2026 · 11 min read

MCP servers are useful. They're also unlicensed code running with whatever permissions your Claude Code session has. When someone on the team suggests adding one, our default answer should not be "yes, install it" and it should not be "no, we don't trust it." It should be "let's audit it, then decide."

This post is the checklist we run. Not every question has to be a hard block — most audits end in "yes with conditions" or "yes for staging, not for prod." But the audit itself is the point. The MCP ecosystem is young enough that "everyone uses it" is not evidence of security, and old enough that any high-value integration probably already has a well-maintained option.

The one-sentence question

Before any of the details: if this MCP server was malicious, what could it do to us? Not "would it," but "could it." A weather API MCP that only calls one public endpoint has almost no attack surface. A GitHub MCP with a personal access token has, potentially, every repository you can see. A shell-exec MCP has the whole machine.

The rest of this checklist exists to make that question answerable. But start there. If the honest answer is "it could delete all our production data," the bar for provenance and scope has to be much higher than for a read-only public API.

Assume every MCP server is a supply chain risk until you've proven otherwise. That doesn't mean rejecting them — it means auditing them the way you would any dependency your CI pipeline pulls.

Provenance: who ships this?

Provenance is the fastest filter. Not all MCP servers are equal in terms of who's behind them:

  • Official from a vendor — GitHub's own MCP server, Anthropic's reference servers, official from a database vendor. Highest trust; treat like a first-party SDK.
  • Community project from a known maintainer — check GitHub, look for a track record of other open-source contributions, ideally with real signing/attestation. Medium trust; audit code before enabling privileged scopes.
  • Anonymous or new — no attribution, single-purpose repo, no history. Treat as unknown; either audit the source fully or don't use it.
  • Fork of an existing server — check what the fork changed. Sometimes forks add valuable features; sometimes they add exfiltration.

For our team, the informal rule is: official vendor or major-lab servers get one review. Community servers get code review. Anonymous servers get rejected unless someone owns the audit end-to-end.

Permissions and scope

What credentials does the server need, and what does it do with them? Every MCP server has a permission surface. The audit is: is that surface minimum-viable for what we want the server to do?

Common trap

Many MCP servers ask for broad tokens (all-repos, all-projects) when they only need one. The server may work fine either way. Give it the narrowest token you can — a repo-scoped PAT rather than user-scoped, a service account rather than an admin, read-only rather than read-write when the workflow allows.

For each MCP integration, we document: what token, what scope, why that scope, where it's stored, and how it rotates. It's three lines in a spreadsheet, not a compliance program — but writing it down forces the question. When you can't articulate why a server needs write access, that's usually the answer.

Network scope

What endpoints does the server call? Ideally, the answer is one domain — api.github.com, sentry.io, your own internal API. Reality is often messier: telemetry endpoints, npm registry, GitHub for update checks. Some of these are benign. Some are not.

For servers we're unsure about, we run them once with network monitoring and observe what they hit. tcpdump on macOS, mitmproxy for HTTP inspection, or just watching the process's outbound connections. If it's calling a domain we don't recognize, that's a question to answer before green-lighting production use.

A quick network audit script

bash
# Log all outbound connections from an MCP server for 60 seconds
# Adjust process name to match the server you're testing
sudo lsof -i -P -n | grep node > /tmp/mcp-baseline.txt

# Then trigger the server via Claude Code, and check again
sudo lsof -i -P -n | grep node > /tmp/mcp-active.txt
diff /tmp/mcp-baseline.txt /tmp/mcp-active.txt

Source code review — what to actually look for

For community MCP servers, we do a code review before shipping to production. Not a full audit — a targeted read looking for specific things:

  1. How are credentials handled? Are they read once from environment, or repeatedly? Are they logged? Does the server ever write them to disk in a debug path?
  2. What outbound calls happen? Grep for fetch, axios, http. Every external endpoint should be justified by the server's stated purpose.
  3. What data does it send? Look at request bodies. Some servers include unnecessary metadata (tool names, user identifiers, project paths) in every request. Sometimes benign; sometimes concerning.
  4. How are errors handled? Errors that dump credentials in stack traces are common. Check that sensitive values are scrubbed before logging.
  5. Any dynamic code execution? eval, Function constructor, vm.runInContext, child_process.exec with user input. Any of these should be justified explicitly.

This isn't a two-week security review. On a small MCP server (few hundred lines), it's 20-40 minutes of focused reading. On a larger one, it's 1-2 hours. The ratio of "time spent auditing" to "months of running it in production" is very good.

Incident and update history

Is the server maintained? Check the last commit. Check whether recent issues have been triaged. Check the release notes for the last few versions — patterns like "fix credential logging bug" are useful signal, both in what they fixed and how they handled disclosure.

Servers that had a security incident, fixed it publicly, and communicated the fix are often more trustworthy than servers that have never had one — because you know they take issues seriously. Servers that have been abandoned are less trustworthy regardless of their initial quality.

Signal to look for

Attestation/signing on releases (SLSA levels, sigstore), CI-run tests visible on the repo, an explicit SECURITY.md file. None of these are required, but their presence upgrades trust meaningfully.

Environment isolation

Independent of the audit result, we treat MCP servers as untrusted-by-default in how we run them. That means:

  • Servers with production credentials run only on developer machines that have those credentials anyway, not in shared/CI contexts.
  • Servers with write access run behind human approval for destructive operations (delete, drop, force-push, mutation writes).
  • When possible, we use scoped/short-lived tokens over long-lived personal access tokens — GitHub Apps with a private key over classic PATs, for instance.
  • For particularly risky servers, we experiment with running them in a container or a separate userspace. The overhead is real but so is the isolation.

What we don't require

A few things we don't block on, because they'd be perfectionist:

  • Formal security audits — most MCP servers won't have them. Their absence is normal.
  • Multiple maintainers — single-maintainer projects are fine if the maintainer is known and the code is clean.
  • Enterprise support — nice to have; not required.
  • Zero dependencies — some dependencies are fine; we care about specific patterns, not totals.

The audit is not "is this server perfect?" It's "can we explain what this server does and why we trust it enough for this specific use?" If the answer is yes, ship it. If not, either narrow the use case, do more audit work, or find an alternative.

The checklist, one page

Consolidated for reference:

  • Provenance: who ships it, what's their track record?
  • One-sentence risk: if malicious, what could it do?
  • Scope: credentials, tokens, permissions — narrowest possible?
  • Network: what endpoints, verified once?
  • Source review for community servers (credentials, outbound calls, dynamic code)
  • Update history: maintained? incident history sensible?
  • Isolation: how do we contain this if it goes wrong?

None of this is unusual for how you'd evaluate any dependency. MCP servers just look easier to add than they are — the "npm install" shape of it can create the impression that they're disposable, when in practice each one is a small trust decision. Treating them accordingly costs an hour up front and prevents the whole class of problems where the retrospective is "we didn't realize it had that much access."

MK

Written by

Mateo K.

Mateo focuses on platform engineering, agentic workflows, and turning experimental patterns into infrastructure that scales.

Get cctk running in one command

85 slash commands, 12 subagents, 12 MCP integrations, 12 hooks. All the patterns from this post are shipped in cctk.

npx cctk@latest init Get cctk v1.5.2 →