Debugging the MCP Server


Debugging with MCP Inspector

MCP Inspector is a debugging tool for MCP servers.

Debug locally over stdio transport

You can inspect a local Apollo MCP Server by running it with MCP Inspector.

  1. Run the MCP Server with Inspector:

YAML
Example config for debugging over stdio
1operations:
2  source: local
3  paths:
4    - <absolute path to this git repo>/graphql/weather/operations/
5schema:
6  source: local
7  path: <absolute path to this git repo>/graphql/weather/api.graphql
8transport:
9  type: stdio
sh
1npx @modelcontextprotocol/inspector \
2  target/debug/apollo-mcp-server <path to the preceding config>
Example output
sh
Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀
  1. In a browser, go to the URL returned by Inspector, then click Connect and List Tools. You should see the tools for the operations you provided.

Debug over the Streamable HTTP transport

When running the MCP Server over the Streamable HTTP transport, you can run MCP Inspector as follows.

  1. Start the MCP Server in Streamable HTTP mode:

tip
You can also deploy the server as a container using the instructions in Deploying a Container.
YAML
Example config for running in Streamable HTTP
1operations:
2  source: local
3  paths:
4    - <absolute path to this git repo>/graphql/weather/operations/
5schema:
6  source: local
7  path: <absolute path to this git repo>/graphql/weather/api.graphql
8transport:
9  type: streamable_http
10  address: 127.0.0.1
11  port: 5000
sh
1target/debug/apollo-mcp-server <path to the above config>
  1. Start the MCP Inspector:

sh
1npx @modelcontextprotocol/inspector
  1. In a browser, go to the URL returned by Inspector, then fill in the details:

    • Transport Type: Select Streamable HTTP

    • URL: Enter http://127.0.0.1:5000/mcp, where the port must match the transport.port option

  2. Click Connect and List Tools. You should see the tools for the operations you provided.

Feedback

Edit on GitHub

Ask Community