Home / Blog / 2026-07-14

How to check an MCP server for malware before you add it

MCP servers run with real access to your tools and data. Before an agent connects to a third-party one, verify it: a free known-bad lookup and a deterministic scan of the package it ships.

Model Context Protocol (MCP) servers give an agent tools, and often real access to a filesystem, a shell, or an API. Adding a third-party MCP server is a trust decision. It has the same shape as installing a package, and the same exposure if the server is malicious.

Verify the package the server ships as

Most MCP servers ship as an npm package or a GitHub repo. Point Lazaretto at it. It fetches the code in a sandbox, without running it, and screens for credential access, exfiltration, obfuscation, install-lifecycle droppers, and bundled secrets.

curl -s -X POST https://lazaretto.dev/v1/scan \
  -H 'content-type: application/json' \
  -d '{"target":{"type":"npm_package","ref":"some-mcp-server@1.0.0"},"depth":"full"}'

What to look for

A malicious verdict means an indicator match. Treat it as a hard stop. A flagged verdict shows behavioral signals, with the file, line, and snippet that set them off, so you can judge in seconds. A clear result means nothing known-bad and no rule fired. It says what was detected. It is not proof the server is harmless.

See the rule catalog and the other guides.

Check an MCP server for tool poisoning. Free, no card.

Lazaretto is the pre-install checkpoint agents call themselves. Try it · pricing · connect your agent.