DEV Community

Sunil Gentyala
Sunil Gentyala

Posted on Edited on

A 10-minute security gate for any MCP server you plan to connect to an agent

Before I connect an agent to an MCP server, I now run through the same short list. I turned it into a repo so anyone can copy it into a pull request or a review ticket.

The problem in one paragraph. An MCP client calls tools/list, and whatever text the server returns, tool descriptions included, goes into the model's context. So a server can hide instructions in a description (tool poisoning), or change a tool after you approved it (a rug pull). The protocol does not require that call to be authenticated, so you have to check it yourself.

What the checklist covers, in six sections:

  1. Tool descriptions: read the raw tools/list output, look for instructions aimed at the model and for hidden Unicode.
  2. Changes after approval: hash each approved tool definition and re-check it on every session and on notifications/tools/list_changed. A hash catches definition changes but not behavioral drift, so pair it with a tool allowlist and per-call approval for anything that writes, executes or spends (thanks to a reader comment for this point).
  3. Authentication: the spec makes authorization optional, so if a server uses HTTP authorization, check audience validation, no token passthrough and exact redirect matching. Unauthenticated listing is still a finding for me.
  4. Client-side safety: reject odd URL schemes in authorization endpoints, show the full install command, keep Inspector tooling patched.
  5. Server-side tool safety: validate inputs, contain file paths, block flag injection, treat tool output as untrusted input.
  6. Supply chain and logging: exact package name, locked dependencies, read install scripts, log every call, be able to switch one server off quickly.

Every item is a yes/no question with a quick way to test it, and each says whether it is a spec MUST or beyond the spec (the spec has no rug-pull control at all). Sections 1 to 3 are blockers, so you end up with a pass or fail instead of a pile of advice. Where a MITRE ATLAS technique exists (tool poisoning, rug pull, supply chain), the item is mapped to it.

Real cases show why patch level matters: CVE-2025-6514 (OS command injection in mcp-remote through an untrusted server, CVSS 9.6) and CVE-2025-32711 (EchoLeak in M365 Copilot, CVSS 9.3).

It is not the first MCP checklist. SlowMist has a good one, and I link it in the README. Mine is built as a review gate rather than a reference guide. If you find an item that is untestable, wrong, or missing, a pull request is welcome.

Repo: https://github.com/sunilgentyala/mcp-security-checklist

Two companion checklists, built the same way (every item is a yes/no with a test and a primary source, plus a list of what I could not verify):

Top comments (2)

Collapse
 
agentwareshq profile image
agentwares •

Good framing — making sections 1–3 blockers instead of advice is the right call, since one poisoned description can undo the rest of the list.

One gap worth calling out on the hash check in section 2: hashing the tool definition catches description and schema changes, but it doesn't catch behavioral drift. A server can keep the exact same description and schema while changing what the tool actually does on the back end, and the hash will still match. The re-check on notifications/tools/list_changed only helps if the client actually re-hashes and re-prompts for approval when that notification arrives, rather than just refreshing the displayed list.

In practice I pair the hash check with two things: a client-side allowlist that only enables the specific tools the agent actually needs for the task, and per-call approval for the high-impact ones — anything that writes, executes, or spends. That way even a server that passes the hash check still can't act outside its approved scope without a fresh human decision.

Collapse
 
sunilgentyala profile image
Sunil Gentyala •

Thanks, this is a fair gap, and I agree with all of it. The hash is a tripwire for what the server tells the client, not for what it does. A server can keep its description and schema byte-identical and change the backend behavior, and a hash will never see that. Your point about notifications/tools/list_changed is the same failure mode: if the client just refreshes the list instead of re-hashing and re-prompting, the re-check is cosmetic.

The allowlist plus per-call approval for anything that writes, executes, or spends is the right complement. It moves trust from "this server looked fine when I approved it" to "this call is fine right now." I'd add two more layers for the behavioral side:

  • Contain the blast radius. Run local servers in a container or sandbox with an egress allowlist and no ambient credentials. Hand each server a scoped, short-lived token instead of your own. Then a server that turns hostile still can't reach much.
  • Pin and log. For servers you run, pin to a version or image digest, so a behavior change needs a deliberate upgrade. For remote servers you can't pin, log tool inputs and outputs so you can spot drift after the fact.

I'm adding a short "what the hash does not cover" note to section 2 and the README, covering the allowlist and per-call approval pattern. Thanks for the push on this.