Skip to main content

Testing and Debugging

8.1 MCP Inspector

The official interactive debugging tool that lets you test every capability of your Server in a browser.
The Inspector opens a web interface where you can:
  • View all tools, resources, and prompts exposed by the Server
  • Manually enter parameters and execute tools
  • Inspect the raw JSON-RPC requests and responses
  • Validate inputSchema and outputSchema
  • Test resource reading and subscriptions
  • Test prompt retrieval (with argument filling)
  • View the Server’s declared capabilities

Testing Remote Servers with Inspector

The Inspector also supports testing Streamable HTTP Servers:
You can attach authentication headers:

8.2 Unit Testing

Test each tool’s execution logic (without involving the MCP protocol layer):

Testing Tool Error Handling

8.3 Integration Testing

Test the complete MCP protocol interaction, including initialization, capability negotiation, and tool calls:

8.4 Protocol Compliance Verification

Key checkpoints to ensure your Server conforms to the MCP specification:

8.5 Common Debugging Techniques

stderr Logging

Logs from a stdio Server must be output to stderr:

Log Levels

The MCP specification defines standard log levels. Servers can send log messages to the Client via notifications/message:
The Client can set the minimum log level it wants to receive via logging/setLevel.

Debugging Streamable HTTP

For remote Servers, you can use curl to manually send JSON-RPC requests:

Next Chapter: Deployment Guide — Local deployment vs remote deployment