Testing with the MCP Inspector
Why You Need the Inspector
Before wiring your server into a full application, you want to confirm each tool, resource, and prompt actually works. The MCP Inspector is a browser-based tool that connects directly to your server so you can list and run everything by hand — no client app required. It's the fastest way to test and debug an MCP server.
# Start the Inspector against your server
uv run mcp dev mcp_server.py
# It prints a local URL, typically:
# http://127.0.0.1:6274
# Open that in your browser.The UI evolves, the workflow doesn't
The Inspector's interface is actively developed and may look different over time, but the core flow is stable: Connect, then explore the Tools / Resources / Prompts tabs.
Connecting and Listing
When the Inspector opens, click Connect to start and attach to your server — the status changes from Disconnected to Connected (this is the initialize handshake you learned about, happening for you). Then use the tabs to discover what your server exposes.
The Inspector connects to your running server and surfaces its tools, resources, and prompts in tabs.
Testing Tools, Resources, and Prompts
In the Tools tab, click List Tools to see everything your server exposes; select one and the right panel shows its input fields. To test the reader: select read_doc_contents, enter a doc id like deposition.md, click Run Tool, and check the result. The Inspector shows both the success status and the actual returned data.
- 1.Tools: List Tools → select a tool → fill inputs → Run Tool → verify the returned data.
- 2.Resources: separate sections list your direct Resources and your Resource Templates; click one (and supply parameters for templates) to see the exact response and MIME type your client will receive.
- 3.Prompts: the Inspector shows precisely which messages will be sent to Claude, with your arguments interpolated — verify the wording before users rely on it.
State persists between calls
The Inspector keeps your server's state across calls, so you can test interactions: run edit_document to change a doc, then immediately run read_doc_contents to confirm the edit applied. This lets you verify multi-step workflows, not just isolated calls.
The Development Loop
The Inspector turns server development into a tight feedback loop. Instead of writing throwaway test scripts or standing up a full app, you iterate directly: change a tool, reconnect, run it, see the result. This catches schema mistakes, error-handling gaps, and bad descriptions early — before they become confusing failures inside a larger application.
- •Quickly iterate on tool implementations.
- •Test edge cases and error conditions (e.g. an unknown doc id).
- •Verify tool interactions and state management.
- •Debug issues in real time with visible request/response data.
Next: drive the server from code
The Inspector proves your server works by hand. Next we build an MCP client so your own application — and Claude — can use that server programmatically.
Key Takeaways
- ✓The MCP Inspector is a browser-based tool to test a server's tools, resources, and prompts without building a client app.
- ✓Launch it with `uv run mcp dev mcp_server.py`; it serves a local URL (often http://127.0.0.1:6274).
- ✓Click Connect first (this performs the initialize handshake), then use the Tools / Resources / Prompts tabs to discover and run each primitive.
- ✓Testing a tool: List Tools → select → fill inputs → Run Tool → verify status and returned data; templated resources require parameter values.
- ✓For prompts, the Inspector shows the exact interpolated messages that will be sent to Claude — verify them before shipping.
- ✓Server state persists across calls, so you can test multi-step workflows (edit then read) — making it a tight, real-time development loop.
Check Your Understanding
Test what you learned in this lesson.
Q1.What is the MCP Inspector used for?
Q2.Which command launches the Inspector against a server file?
Q3.Why is it useful that the Inspector preserves server state between tool calls?
Q4.When testing a prompt in the Inspector, what does it show you?
Practice This Lesson