Skip to content

Releases: tdav/Mcp.ComputerUse

fist

20 May 21:22

Choose a tag to compare

fist Pre-release
Pre-release
fix: wire McpJsonContext into MCP SDK to prevent AOT schema crash

The AOT-published mcp-computeruse.exe crashed on initialize with
NotSupportedException because the MCP SDK 1.3.0 builds JSON schemas
for every [McpServerTool] method using a JsonSerializerOptions whose
TypeInfoResolver chain only contains the SDK's internal source-gen
contexts. Our McpJsonContext was never connected, so types like
PingResult had no JsonTypeInfo and reflection fallback is stripped
by AOT.

Fix: extract host configuration into HostStartup.Configure and pass
a combined JsonSerializerOptions to each WithTools<T>(jsonOpts)
overload (the 1.3.0 SDK exposes this overload). The options merge
McpJsonContext.Default into the SDK's default resolver chain.

Verified: bug reproduces in JIT (dotnet run) before fix; after fix,
initialize returns a valid JSON-RPC response. 14/14 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>