By Shakil Ahmed, Android developer & software engineer
Debug an MCP Connection with One Read-Only Tool
A working URL can still hide a broken MCP connection. Use one read-only call to distinguish routing, login, discovery, and tool failures.
Your MCP server works in one client. In another, the only clue is “could not connect.” Before changing the server, pick one harmless operation with a predictable answer. For a blog, that might be listing the title of a known public post. Use that same operation throughout the investigation. If you change the URL, credentials, and tool at once, even a successful retry teaches you very little.
Find the first step that fails
Open the official MCP Inspector on your development machine. For a remote Streamable HTTP endpoint, select the matching transport and enter the exact server URL. A successful visit to the blog homepage in a browser tells you nothing about whether the MCP route accepts a protocol request.
| What you observe | What to inspect next |
|---|---|
| The response is HTML showing the homepage | Check the path and proxy rewrite before touching the tool code. |
| The intended server responds with 401 | Compare its authentication challenge with the method the client supports. |
| A connection opens but the tool is absent | Inspect the discovered tool names and the permissions of this account. |
| The tool is listed but calling it returns an application error | Check its arguments and server logs for that call. |
These are leads, not diagnoses. A reverse proxy can return its own 401 before your application sees the request. A useful log entry records the time, route template, status, and request identifier. Leave out tokens, cookies, and any URL segment that contains a key.
Make the two clients comparable
Suppose Inspector can list a known public post using a manually configured authorization header. That proves the route worked from that machine with that credential. A hosted assistant may reach the server from another network or support a different login flow. Compare the transport, endpoint, account, and authentication method one at a time. The guide to MCP authentication explains why those differences matter.
Repeat the same read operation after changing one setting. If it succeeds, record a short result: “Client B can discover the list tool and retrieve the expected public title.” That is a stronger connection test than a green indicator, and it leaves your production content untouched.
Related articles
A timeout can hide a successful write. Design an idempotent scheduling tool and test what happens when its first response is lost.
Ten practical prompt engineering rules for developers, with before/after examples, JSON output formats, eval tables and a prompt injection warning.
GitHub's recent Android security research shows the value of focused AI audits. Here is how to turn suspected vulnerabilities into verified fixes.
MCP connects AI assistants to application tools, but a working demo is only the beginning. Authentication and predictable operations determine reliability.
