Labsco
MCP SERVER

MCP Tool Poisoning Attacks

by RyosukeDTomita

A paired MCP client and IP-lookup server, packaged as a dev container, for demonstrating tool poisoning attacks against an LLM.

Summary
Both ends visible, which is the point.

Studying tool poisoning needs the tool description and the model's reasoning side by side, and that is what this gives you: two tiny tools with no interesting behaviour of their own, and a client that prints every step. It is a lab bench, not something to install for daily use.

What it is

A small teaching setup rather than a service: an MCP client that talks to Anthropic's API, plus an `ipinfo` server it connects to, wired together so you can watch a model choose and call a tool. The point is to have both halves under your control while studying how tool descriptions influence what the model does.

What you get
  • `ipinfo` — return information about the machine's own IP address, no arguments
  • `ipinfo_target_ipjson` — return information about a target IP supplied in the request parameters
  • A client that prints the tool list, the request sent to the model, the model's tool selection, the server's result and the final answer — so the whole decision chain is visible in the terminal
  • A `mcpservers.json` file that accepts both a spawned stdio server and an SSE endpoint, so you can point the client at your own server while experimenting
Requirements

An Anthropic API key, written to `mcp_client/.env` as `ANTHROPIC_API_KEY`. Node.js v22 and the MCP TypeScript SDK; the repository ships a dev container and a Docker Compose file, and `docker compose run -it mcp_client` starts the client. The `ipinfo` server is launched over `npx` straight from the GitHub repository, which is why a `package.json` sits at the repository root. Only the first server listed in `mcpservers.json` is currently used.

Setup effort

Build from source — clone the repository and build it, then point your client at the binary