Skip to content

Where clients write MCP logs

Spec
2026-07-28
Evidence
E3Tested in a real clientarm64
MCP Inspector
@modelcontextprotocol/inspector@2.12.0
Verified

When a stdio server fails, the reason is almost always in its own stderr output, and the client keeps that output somewhere. This page lists where. Over Streamable HTTP, the client never sees the server’s stderr: read the logs of the server process itself.

Client Where to look Checked by us
Claude Code ~/.cache/claude-cli-nodejs/<project>/mcp-logs-<server>/ on Linux; /mcp in a session Yes, Linux 2.1.312
Claude Desktop macOS ~/Library/Logs/Claude/mcp*.log; Windows %APPDATA%\Claude\logs\mcp*.log No
Codex Inline in codex exec; plaintext log only with -c log_dir=… Partly, 0.164.0
Cursor Output panel → MCP Logs No
Cherry Studio The server’s details in Settings → MCP No
MCP Inspector Your terminal Yes, 2.12.0

Claude Code writes one JSON Lines file per connection attempt:

~/.cache/claude-cli-nodejs/<project path with / replaced by ->/mcp-logs-<server name>/<timestamp>.jsonl

We found this location on Linux. It did not move when we set CLAUDE_CONFIG_DIR. We have not checked macOS or Windows.

Each line is one event. For a server that exited because a variable was missing, the file contained, among others:

{"debug":"Starting connection with timeout of 30000ms", …}
{"error":"Server stderr: needs-env: DEMO_API_KEY is not set\n", …}
{"debug":"Connection failed after 401ms, 402ms of it awake (CONNECTION_CLOSED): Connection closed", …}

A successful connection logs the negotiated protocol, for example "protocolEra":"modern","negotiatedProtocolVersion":"2026-07-28".

Quicker ways to see the same problem:

  • claude mcp get <name> prints an Issue: line, such as CONNECTION_CLOSED: Connection closed or ENOENT: Executable not found in $PATH: "…".
  • /mcp in a session shows each server’s status and the same issue text.
  • claude --debug-file /tmp/claude-debug.log writes Claude Code’s own debug log to a file.

From the MCP documentation, not tested by us:

Terminal window
# macOS
tail -n 20 -F ~/Library/Logs/Claude/mcp*.log
Terminal window
# Windows
type "$env:AppData\Claude\logs\mcp*.log"

The files match mcp*.log; the documentation says they record connection events, configuration problems, runtime errors and message exchanges. For errors in the app itself, the documentation describes turning on Chrome DevTools with {"allowDevTools": true} in developer_settings.json in the Claude configuration folder, then pressing Command-Option-I (macOS) or Ctrl+Alt+I (Windows).

  • codex exec prints messages to the terminal instead of a log file. RUST_LOG controls how much it prints; codex exec shows only errors unless you set a more verbose value such as RUST_LOG=debug.

  • Interactive codex records diagnostics in local stores in ~/.codex (or $CODEX_HOME) by default. A plain text log is opt-in:

    Terminal window
    RUST_LOG=debug codex -c log_dir=./.codex-log
    tail -F ./.codex-log/codex-tui.log

From Cursor’s documentation, not tested by us: open the Output panel (Cmd+Shift+U on macOS) and choose MCP Logs in the drop-down. It shows server startup, tool calls and errors.

From Cherry Studio’s documentation, not tested by us: open Settings → MCP, then the failing server’s details, and read its log there. The documentation recommends reading and fixing the logged error before deleting and re-adding a server.

The Inspector starts the server itself and prints the server’s stderr in your terminal, followed by its own result or error. This makes it the fastest way to see why a server exits:

Terminal window
npx -y @modelcontextprotocol/inspector@2.12.0 --cli \
node /absolute/path/to/server.js --protocol-era auto --method tools/list

See Test a server with the MCP Inspector.

Connection logs can include commands, arguments, environment variable names and server error text. Before you paste a log into an issue or a chat, remove tokens, keys, internal URLs and personal paths.

Sources

MCPDev is community documentation. It is not affiliated with the Model Context Protocol project or with the vendors of the clients it covers.