When you build or configure an MCP server, sometimes it just… doesn’t work. The AI hallucinates a response, or the tool call fails silently.
To fix this, you need to see exactly what is happening “on the wire.” Enter the MCP Inspector.
What is MCP Inspector?
It is a developer tool provided by the Model Context Protocol team. It acts as a “Man in the Middle” or a “Client Simulator.” It lets you:
- List available tools on a server.
- Manually call a tool and see the raw JSON response.
- View the logs.
How to Run It
It’s a web-based tool you can run locally via npx.
npx @modelcontextprotocol/inspector <command-to-run-your-server>
Example:
npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem /Users/me/projects
Using the Interface
Once running, it opens a browser window (usually localhost:5173).
1. The “Tools” Tab
Here you can see the schema. Does get_weather expect city or location? If the schema is wrong, the AI will often fail to call it correctly.
2. Testing a Call
You can type “London” into the input box and click “Run.” You will see the raw JSON output.
- If the output is massive, you might be overflowing the AI’s context window.
- If the output is empty, your logic is wrong.
Why Debugging Matters
AI models are polite. If a tool fails, they often try to “guess” the answer instead of complaining.
- Without Inspector: You think the AI read the file, but it actually failed and the AI is hallucinating the content.
- With Inspector: You see the error
File Not Foundin the logs, so you know exactly what to fix.
Mastering the Inspector is the difference between “hoping it works” and “knowing it works.”