Claude Code errors / Schema

invalid_type expected string received undefined at path protocolVersion

platform: Claude Code / category: Schema

Cause

Claude Code's MCP init layer drops the protocolVersion field before sending the initialize request to stdio servers, so schema validation fails before any data is sent.

Fix

Use a wrapper shell script instead of referencing the server directly: export MCP_PROTOCOL_VERSION=2025-03-26 and exec your server binary. Register the wrapper: claude mcp add <name> /path/to/wrapper.sh. This bypasses the internal validation step.

Source thread →

Part of the Automation Error Index — Claude Code errors: browse all.

Hitting an automation error we have not covered?

AutomateLab builds and debugs n8n, Make, and agent workflows as fixed-scope projects. If something is broken in production, tell us what you are seeing.

Describe the problem