Home Products
VivaGuard TamperCheck Vybscan
About Blog Book a Demo

How do I scan an MCP server's code for security vulnerabilities?

Manjula Sridhar Nov 19, 2026 5 min read
← Back to Blog

An MCP server is a program that carries out actions for an AI model. The model picks the tool and fills in the arguments, and those arguments often come from text the model read: a web page, an issue, a file. So every tool argument is untrusted input, just like a form field on a website. The common MCP vulnerabilities are old ones in a new place: command injection, path traversal, server-side request forgery and leaked credentials.

Two different MCP risks

There are two separate questions. Is the server's code safe? And are its tool descriptions honest? The second covers tool poisoning, rug pulls and tool shadowing, where a description tells the model to do something the user never asked for. Scanners such as Invariant Labs' MCP-Scan and Cisco's MCP Scanner read the descriptions of servers you connect to. This page is about the first question: the server's own code, which you can check before you ship it.

What to check in the server's code

  • Tool arguments in a shell command. exec, spawn with a shell, or subprocess with shell=True. The classic case is a file name argument pasted into a command line.
  • Tool arguments in a file path. A path joined onto a base directory with no check that the result stays inside it.
  • Tool arguments used as a URL. A tool that fetches whatever address the model passes can reach internal services and cloud metadata endpoints.
  • Tool arguments in SQL or eval.
  • Credentials in tool results. An API key from the environment, or an error object carrying request headers, returned to the model. Whatever is in a tool result can end up in the chat, in logs, or in another tool's arguments.
  • A credentialed request to a URL the model chose. The server adds its own token to a request whose address came from a tool argument.

Three published MCP CVEs

These three advisories are all command injection in a tool's code. We ran Vybscan on the vulnerable release and on the fixed release of each.

ServerAdvisoryVulnerable releaseFixed release
ios-simulator-mcpCVE-2025-52573flagged (1.3.2)clean (1.3.3)
mcp-server-kubernetesCVE-2025-53355flagged (2.4.9)injection findings gone (2.5.0)
@cyanheads/git-mcp-serverCVE-2025-53107flagged (2.1.4)clean (2.1.5)

Damn Vulnerable MCP Server is a training project with 15 challenges. The code checks find 7 of them. The other 8 are prompt-level attacks, such as poisoned descriptions, rug pulls and forged token claims, which live in text rather than code. That is the split above, in practice.

We also ran the checks on the official reference servers, both official SDKs, Playwright MCP and AWS's MCP servers. Together they raised one finding, in an example that fetches a URL the tool chooses.

How Vybscan checks this

Vybscan recognises MCP server code in TypeScript and Python: tools registered with the official SDKs (server.tool, registerTool, the CallTool request handler, and @mcp.tool() in Python). It treats every tool argument as untrusted and follows it to the places it must not reach. It also checks what goes back to the model in a tool result. These checks run only in MCP server files, so a command-line program that happens to have a run(args) function is not reported. Every pull request and push is checked, together with the rest of the code, the dependencies and leaked keys.

Frequently asked questions

Is a local MCP server safe because it only runs on my machine?

No. Its input comes from the model, and the model's input comes from whatever it read. A local server with a command injection runs the attacker's command on your laptop.

Does Vybscan detect tool poisoning?

No. Tool poisoning lives in the descriptions a server sends while it runs. Use a description scanner such as MCP-Scan for that. Vybscan covers the server's code.

Which languages does it cover?

TypeScript, JavaScript and Python MCP servers built on the official SDKs. Servers written in other languages still get Vybscan's general checks for those languages.

What does Vybscan check?

MCP tool arguments reaching shells, file paths, URLs, SQL and eval, credentials returned in tool results, plus the rest of the code, dependencies and secrets, on every pull request and push. It installs as a GitHub App or connects to GitLab.

Scan your MCP server

Vybscan checks TypeScript and Python MCP servers on every pull request, with the rest of the code.

Try Vybscan →
← Back to Blog