Skip to content

get_std_lib_item hangs with get_source_file=false for std.heap.WasmAllocator #8

@DanielTowerz

Description

@DanielTowerz

Calling the get_std_lib_item tool for std.heap.WasmAllocator with get_source_file=false causes the server to hang indefinitely. When get_source_file=true, it responds correctly.

The suspected cause is an infinite recursion during the "rich doc" generation, possibly from a circular reference between the type (WasmAllocator) and its value (wasm_allocator).

Steps to Reproduce

Command that hangs:

npx @modelcontextprotocol/inspector --cli \
  npx -y zig-mcp @latest --version 0.15.1 --update-policy manual \
  --method tools/call --tool-name get_std_lib_item \
  --tool-arg name=std.heap.WasmAllocator \
  --tool-arg get_source_file=false

Command that works:

npx @modelcontextprotocol/inspector --cli \
  npx -y zig-mcp @latest --version 0.15.1 --update-policy manual \
  --method tools/call --tool-name get_std_lib_item \
  --tool-arg name=std.heap.WasmAllocator \
  --tool-arg get_source_file=true

Environment

  • OS: Darwin Kernel Version 24.1.0 arm64
  • CPU: Apple M1
  • Node: v23.7.0
  • npm: 10.9.2
  • @modelcontextprotocol/inspector: Not available (--version starts the server).
  • Zig std version: 0.15.1

Workaround

Set get_source_file=true.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions