- Users reported: "Claude.ai shows no tools available"
- Original integration tests: All passed ✅
- Reality: Server was completely broken 🚨
# What the tests did (WRONG)
server = AuthenticatedMCPServer(...) # Created object
tools = server.mcp_server.mcp._tool_manager._tools # Accessed mock
assert len(tools) == 17 # ✅ Passed but meaningless
# What they should have done (RIGHT)
response = requests.post("http://server/", json=mcp_request) # Real HTTP call
assert response.status_code == 200 # Would have failed ❌- Never tested actual
/tools/listendpoint that Claude.ai calls - Never started a real HTTP server
- Never tested MCP JSON-RPC protocol
- Tested object creation, not functionality
- No validation that tools are actually served over HTTP
- No simulation of Claude.ai's actual workflow
curl -X POST http://server/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Expected Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{"name": "claude_code", "description": "...", "inputSchema": {...}},
{"name": "read", "description": "...", "inputSchema": {...}},
// ... 15 more tools
]
}
}# Response:
{"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Bad Request: Missing session ID"}}# Native FastMCP server fails:
POST http://127.0.0.1:8360/ → 405 Method Not Allowed
POST http://127.0.0.1:8360/mcp → 404 Not Found
POST http://127.0.0.1:8360/sse → 404 Not Found# Authenticated server fails:
POST http://server/path → 400 Bad Request: Missing session ID- MCP servers expect specific session management
- Authentication layer breaks MCP protocol
- Path routing is incorrect
The new E2E test immediately caught the issue:
def test_real_server_startup_and_tools_endpoint(self):
# Start REAL HTTP server
server.run_sse_with_auth(host="127.0.0.1", port=port, path="/test-mcp")
# Make REAL HTTP request (like Claude.ai does)
response = requests.post(f"http://127.0.0.1:{port}/test-mcp/", ...)
# CRITICAL ASSERTION that would have caught the bug
assert response.status_code == 200 # ❌ FAILED: Got 400 "Missing session ID"
tools_data = response.json()
assert len(tools_data["result"]["tools"]) > 0 # ❌ Would have failedResult: Test immediately failed with the exact same error Claude.ai encountered.
❌ Test only object creation
❌ Test only mock interactions
❌ Test only internal methods
❌ Skip HTTP protocol testing
❌ Skip end-user workflows
✅ Start real HTTP servers
✅ Make real HTTP requests
✅ Test exact protocol that clients use
✅ Simulate end-user workflows
✅ Test error conditions
✅ Validate actual responses
- Immediate: Fix MCP server protocol handling
- Short-term: Add E2E tests to CI/CD pipeline
- Long-term: Establish "production parity" testing
Every integration test must:
- Start real HTTP server
- Make real HTTP requests
- Test actual MCP protocol
- Validate tools/list endpoint
- Simulate Claude.ai workflow
The integration test failure is a textbook example of why mock-heavy testing is insufficient for integration testing. The tests gave false confidence while the system was completely broken in production.
The comprehensive end-to-end test would have caught this immediately and prevented the user-facing issue.
This demonstrates the critical importance of testing the actual interfaces and protocols that external systems rely on, not just internal object interactions.