Skip to content

Tutorial "Build an MCP Server" does not work under zod v4 #1072

@Ranzeplay

Description

@Ranzeplay

Describe the bug
Tutorial "Build an MCP Server" does not work under zod v4. No parameters accepted by the MCP server.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the tutorial to build a weather forecast MCP server
  2. Run it and use an LLM to call it
  3. Found that no interface accepts parameters

Expected behavior
Both interface should accept parameters

Logs

> echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node ./build/index.js
{"result":{"tools":[{"name":"get_alerts","description":"Get weather alerts for a state","inputSchema":{"type":"object","properties":{},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_forecast","description":"Get weather forecast for a location","inputSchema":{"type":"object","properties":{},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}]},"jsonrpc":"2.0","id":1}

Additional context
Downgrade to zod v3 could solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions