Debug an MCP Server Before Connecting Your Coding Agent
An agent failing to use a tool does not immediately tell you where the problem is. The server may not start, the connection may use the wrong transport, the tool may be missing, or its response may violate the contract your application expects. Changing the prompt before separating those possibilities can turn a small integration bug into a long conversation.
MCP Inspector provides a way to examine the server directly. This guide uses a deliberately small workflow: establish a connection, inspect the tool contract, call a harmless operation, and turn the useful checks into a repeatable smoke test. It is a documentation-based guide checked on November 12, 2026, not a report of a live server benchmark.
What Inspector adds
The official Inspector README describes a developer tool with web, command-line and terminal interfaces. The web interface is the default entry point; the CLI suits repeatable checks. An experimental connection-oriented interface, mcpdo, also exists, but you do not need it for this workflow.
Inspector is useful for developers building an MCP server or diagnosing an integration they control. It lets you ask a narrower question than “why did the agent fail?”: can this client connect to the server and invoke the operation with the input you intended?
Start with the right version and a test target
At this check, the npm package reports Inspector 2.15.0, with the Node engine range ^22.23.4 || ^24.22.1 || >=26.12.1. Check your runtime before copying a command. The migration guide explains why older v1 instructions can mislead: v2 changed the architecture, CLI behavior and configuration handling. In particular, a read-only session configuration and a writable catalog are different inputs.
The project's support policy lists v2 as actively supported and v1 as receiving security fixes only. Prefer the current supported line for new work; do not install the old separate client/server packages expecting a v2 setup.
For the example below, assume you already have a trusted local MCP server compiled to build/index.js. It exposes a read-only tool called lookup_issue, accepting an id string, and your test dataset contains DEMO-42. These names describe an illustrative server contract, not built-in Inspector tools. Replace them with your own server and fixture.
Separate connection from tool behavior
Begin with a handshake probe:
npx --yes @modelcontextprotocol/inspector@2.15.0 --cli node build/index.js --method initialize --format jsonThe official smoke-testing guide describes initialization as a connection-only check. A successful handshake establishes that the server speaks MCP; it does not establish that the application feature works.
Next inspect the available tools and call the fixture:
npx --yes @modelcontextprotocol/inspector@2.15.0 --cli node build/index.js --method tools/list --format json
npx --yes @modelcontextprotocol/inspector@2.15.0 --cli node build/index.js --method tools/call --tool-name lookup_issue --tool-arg id=DEMO-42 --format jsonThe CLI reference documents tool listing, explicit tool calls and argument passing. For an HTTP server, use its MCP endpoint and the documented transport options instead of a local process. Do not mix a URL target with a stdio transport.
Our suggested order is intentional. If initialization fails, investigate launch settings, transport and authentication first. If listing succeeds but your tool is absent, investigate registration. If the call succeeds but returns the wrong issue, investigate the server implementation and fixture. Only after those checks should you move back to agent-side tool selection and instructions.
Turn the useful check into a small CI gate
A smoke test should tell you whether a critical path remains usable, not attempt to prove the whole integration correct. The official smoke-testing guide recommends pinning an exact Inspector version in CI, using machine-readable output, bounding connection attempts and choosing an operation safe to repeat. Keep diagnostics separate from the JSON output you parse.
For our hypothetical issue lookup, define three explicit expectations before writing assertions:
- The tool list contains
lookup_issuewith the expected input schema. - Calling it with
DEMO-42returns the fixture issue, not merely a nonempty response. - A nonexistent fixture identifier produces the documented error behavior.
Those assertions are our proposed application contract. Adapt the response checks to your server's actual structured or text output. A generic “command exited successfully” assertion can miss a server that returns the wrong business result.
Keep broader server unit tests for edge cases and authorization rules. Then run a separate agent integration check with a fixed task, such as asking the agent to summarize DEMO-42. That final check answers whether the real client discovers and uses the tool as intended. Inspector success alone cannot answer it.
Inspect where credentials are stored
The secret-storage documentation explains that OAuth credentials and stdio environment values use a secret store. When available, the OS keychain is the default; environments without a usable keychain can fall back to a file. The README warns that the fallback is unencrypted unless a key is supplied.
There is a separate detail for configured HTTP headers: the storage guide says they remain in the configuration as written. A configuration containing an authorization header therefore needs review before you commit or share it. Use test credentials scoped to the fixture system and check the documented storage mode for your environment rather than assuming a headless runner behaves like a desktop.
When a simpler approach is enough
If you are testing a pure function inside your server, use its ordinary unit tests. If a known HTTP endpoint is down, start with the service's own health checks and logs. Inspector earns its place when you need to test the MCP boundary: discovery, schemas, invocation and protocol behavior.
Budget for the system you actually call. A fixture lookup can be cheap, while a tool that triggers a model, external API or paid service can incur charges even when invoked from a debugging client. Calling a tool through Inspector can also perform its real side effects; choose the test target accordingly.
The practical payoff is a clearer handoff to your coding agent: a known server, a known tool contract, a reproducible input and a specific expected result. For the surrounding architecture, see our guide to MCP, skills and plugins.



