---
title: "Fix JSON-RPC error -32603: Internal error (STDOUT Pollution) (-32603)"
slug: "json-rpc-32603-internal-error"
code: "-32603"
category: "Protocol & Serialization"
severity: "High"
canonical: "https://mcp-codex.com/errors/json-rpc-32603-internal-error"
source: "MCP Codex (https://mcp-codex.com)"
dateModified: "2026-09-28"
---

# Fix JSON-RPC error -32603: Internal error (STDOUT Pollution) (-32603)

**Category**: Protocol & Serialization | **Severity**: High

## Symptom
Tools fail to list or fail during execution with generic error code -32603.

## Root Cause
The MCP server wrote non-JSON debug strings to standard output (STDOUT) instead of standard error (STDERR). In stdio transport, STDOUT is strictly reserved for JSON-RPC messages; any `console.log()` breaks JSON parsing.

## Remediation & Quick Fix
Switch all logging inside your custom MCP server from `console.log()` to `console.error()`. For Python servers, write logs exclusively to `sys.stderr`.

## OS Remediation Commands

### MAC
```bash
# Check MCP host logs for raw output:
tail -n 50 ~/Library/Logs/Claude/mcp.log
```

### WINDOWS
```bash
# Check Claude logs in PowerShell:
Get-Content -Path $env:APPDATA\Claude\logs\mcp.log -Tail 50
```

### LINUX
```bash
# Tail Linux MCP logs:
tail -n 50 ~/.config/Claude/logs/mcp.log
```

## Correct Configuration Example
```json
// In TypeScript MCP Server:
// ❌ WRONG: console.log("Server starting...");
// ✅ CORRECT:
console.error("Server starting on stdio transport...");
```

## Canonical Diagnostic Link
https://mcp-codex.com/errors/json-rpc-32603-internal-error

## Weekly Protocol & Patch Diffs
Subscribe to verified runtime fixes and schema changes: https://mcp-codex.com#newsletter
