MCP & Connectors

How do you view and debug logs for MCP servers?

QUICK ANSWER

In stdio MCP servers, route logs to stderr using console.error() instead of console.log(). In Claude Desktop, inspect logs at ~/Library/Logs/Claude/mcp.log to review JSON-RPC errors.

Log Locations

  • macOS Log File: ~/Library/Logs/Claude/mcp.log
  • Windows Log File: %APPDATA%\Claude\Logs\mcp.log

Ensure you write logs to standard error in your custom code:

console.error("Debugging database query result count: " + results.length);
Verified against: Claude Desktop v0.18.0