Testing and Debugging MCP: The Curl-First Approach

In the previous post, I connected an AI agent to 4 MCP servers with 12+ tools. It works. Until it doesn't.

When an agent gives a wrong answer, the question is always the same: is it the LLM, the prompt, or the tool? This post covers how I debug MCP integrations, starting with the simplest approach that catches 90% of issues.

Test the Tool Before You Test the Agent

The biggest mistake I made early on was debugging the agent when the problem was in the tool. I'd tweak the system prompt for hours, then realize the MCP server was returning malformed data.