MCP: initialize fails with -32603 when a client sends object-valued experimental capabilities (breaks Codex CLI integration)

Open
#2,780 5 comments 1 reaction 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Sep 30, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
swift
Domain
api, backend

Research direction

Start at the bundled /Applications/Proxyman.app/Contents/MacOS/mcp-server entry point and trace decoding of the MCP initialize request, especially ClientCapabilities.experimental. Reproduce the object-valued capability case with the provided stdio script; done means initialize succeeds for arbitrary experimental values and Codex can list and call tools.

Written by the indexing model from the issue text.

Description

✅ Done bug

Summary

Proxyman's bundled mcp-server rejects the MCP initialize handshake with
-32603 Internal error: The data couldn't be read because it isn't in the correct format.
whenever the client advertises an experimental client capability whose value is not a string.

The MCP specification defines ClientCapabilities.experimental as a map of capability
names to arbitrary objects. OpenAI's Codex CLI always advertises
experimental: {"codex/auth-change": {}}, so Proxyman's MCP server cannot be used
from Codex at all
— the server fails before any tool becomes available.

Claude Code is unaffected because it does not send an experimental field.

Environment

Proxyman 26.0.1 (build 260001), direct download (non-Setapp)
macOS 26.6.2 (25G83), Apple Silicon (arm64)
Server binary /Applications/Proxyman.app/Contents/MacOS/mcp-server
Client Codex CLI 0.158.0
Protocol version 2025-06-18

Reproduction

Minimal script — drives mcp-server over stdio and varies only the value type inside
capabilities.experimental:

#!/usr/bin/env python3
import json, subprocess, threading, time

SERVER = ['/Applications/Proxyman.app/Contents/MacOS/mcp-server']

def probe(label, caps):
    p = subprocess.Popen(SERVER, stdin=subprocess.PIPE,
                         stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
    out = []
    threading.Thread(target=lambda: [out.append(l) for l in p.stdout], daemon=True).start()
    req = {"jsonrpc": "2.0", "id": 1, "method": "initialize",
           "params": {"protocolVersion": "2025-06-18", "capabilities": caps,
                      "clientInfo": {"name": "probe", "version": "1"}}}
    p.stdin.write((json.dumps(req) + "\n").encode()); p.stdin.flush()
    time.sleep(2)
    try: p.terminate(); p.wait(timeout=2)
    except Exception: p.kill()
    verdict = "no response"
    if out:
        d = json.loads(out[0].decode('utf-8', 'replace'))
        verdict = "FAIL: " + d['error']['message'] if 'error' in d else "OK"
    print(f"{label:46s} -> {verdict}")

probe('capabilities: {}',                        {})
probe('experimental: {}',                        {"experimental": {}})
probe('experimental: {"foo": "bar"}   (string)', {"experimental": {"foo": "bar"}})
probe('experimental: {"foo": {}}      (object)', {"experimental": {"foo": {}}})
probe('experimental: {"foo": 123}     (number)', {"experimental": {"foo": 123}})
probe('experimental: {"foo": null}    (null)',   {"experimental": {"foo": None}})
probe('experimental: {"codex/auth-change": {}}', {"experimental": {"codex/auth-change": {}}})
Observed output
capabilities: {}                               -> OK
experimental: {}                               -> OK
experimental: {"foo": "bar"}   (string)        -> OK
experimental: {"foo": {}}      (object)        -> FAIL: Internal error: The data couldn't be read because it isn't in the correct format.
experimental: {"foo": 123}     (number)        -> FAIL: Internal error: The data couldn't be read because it isn't in the correct format.
experimental: {"foo": null}    (null)          -> FAIL: Internal error: The data couldn't be read because it isn't in the correct format.
experimental: {"codex/auth-change": {}}        -> FAIL: Internal error: The data couldn't be read because it isn't in the correct format.

Only string values decode. The capability name is irrelevant — "foo" fails exactly
like "codex/auth-change", so this is not a key-format (slash) problem.

Root cause

This matches a known upstream defect in the official Swift MCP SDK, which models the
field as [String: String]? instead of a map to arbitrary JSON values:

  • modelcontextprotocol/swift-sdk#287 — ClientCapabilities.experimental fails to decode object-valued capabilities (open, affects 0.12.1 and HEAD)

The same bug has hit several other Swift-based MCP servers, all of which fixed it on
their side while the SDK issue remains open:

  • openclaw/Peekaboo#745 (fixed)
  • repoprompt/repoprompt-ce#995 (fixed)
  • MongLong0214/logic-pro-mcp#1051 (fix PR)
  • openai/codex#45269, openai/codex#45889 (Codex-side reports)

Expected behavior

Per the MCP spec, experimental values are arbitrary objects. An unknown or
unparseable optional capability must not fail initialize
— it should be ignored so
the handshake completes and tools become available.

Suggested fix

Decode experimental as [String: JSONValue]? (or equivalent), or decode it leniently
and drop entries the server does not understand. The workaround adopted by the other
affected servers is to keep string values and discard every other type rather than
failing the whole request; decoding to a permissive JSON value type is cleaner and
spec-correct.

Because the field is optional and Proxyman does not appear to consume it, simply
ignoring undecodable entries would be sufficient.

Current workaround (user side)

A stdio shim that strips the offending key from initialize before forwarding to
mcp-server restores full functionality — after it, tools/list returns all 72 tools
and tools/call works normally. This confirms the failure is isolated to decoding this
one optional field, and that nothing else in the server is affected.

Dominant language
No language data
Stars
7.1k
Forks
238
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ProxymanApp/Proxyman

All issues in ProxymanApp/Proxyman

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.