Install¶
You need QuPath 0.7 and an MCP client such as Claude Code.
Warning
The MCP server lets the connected agent run any code in QuPath, as you, with access to your files. Give it only as much trust as you give your coding agent. It is on whenever the jar is installed. See Security.
Install the extension¶
Install it from QuPath's extension manager, which also offers updates when a new version is released:
- In QuPath, choose Extensions ▸ Manage extensions, then Manage extension catalogs.
- Paste
https://github.com/earthmover-support/qupath-mcpinto Catalog URL and click Add. Close the catalog window. - In the extension manager, find QuPath MCP and click its install button (the tooltip says Install extension), then Install.
Restart QuPath after installing or updating. An update replaces the jar on disk, but QuPath keeps running the version it started with until it restarts.
To build it yourself instead, run ./gradlew shadowJar in a clone of the repository and drag
build/libs/qupath-gui-driver-<version>-all.jar onto QuPath.
The MCP server starts with QuPath and logs MCP server on http://127.0.0.1:51515/mcp. Untick Extensions ▸ MCP server ▸ Enabled to stop it; the choice persists across restarts. The port is the MCP server port preference (default 51515) and applies the next time the server starts.
Extensions ▸ MCP server ▸ Show agent actions sets what qupath-mcp shows you in QuPath while the agent works: Mark (the default), Paced or Off. See Watching the agent.
Register the server¶
Every client connects to the same URL, http://127.0.0.1:51515/mcp, over MCP's Streamable HTTP transport.
claude mcp add -s user --transport http qupath http://127.0.0.1:51515/mcp
-s user makes the server available in every project; without it, only in the current one.
Claude Code MCP docs
In ~/.cursor/mcp.json, or .cursor/mcp.json in a project:
{ "mcpServers": { "qupath": { "url": "http://127.0.0.1:51515/mcp" } } }
In .vscode/mcp.json, or your user configuration (MCP: Open User Configuration). The top-level key is
servers:
{ "servers": { "qupath": { "type": "http", "url": "http://127.0.0.1:51515/mcp" } } }
In ~/.gemini/settings.json. Use httpUrl; Gemini CLI reads url as the older SSE transport:
{ "mcpServers": { "qupath": { "httpUrl": "http://127.0.0.1:51515/mcp" } } }
Claude Desktop can't connect to this server directly: its config file takes only local commands, and its
custom connectors need a server reachable from the internet. A bridge such as the third-party
mcp-remote package can run as a local command and forward to the
URL; this is untested.
Start QuPath before the client¶
The client connects to the running QuPath, so QuPath must be open first. Open it yourself, or an agent with a shell can start it on macOS without taking focus from your windows:
open -g -a QuPath-0.7.0-arm64
Check it works¶
Ask the agent to call qupath_describe, or check the server directly:
curl localhost:51515/windows
Uninstall¶
In Extensions ▸ Manage extensions, remove QuPath MCP (its tooltip says Remove extension), and remove the qupath entry from your client (claude mcp remove -s user qupath in Claude Code).