Skip to content

Conversation

@jerome3o-anthropic
Copy link
Member

Summary

  • Add dev-with-mitm.sh for TUI-based traffic inspection using mitmproxy
  • Add dev-with-mitmweb.sh for web UI-based traffic inspection using mitmweb
  • Fix missing id field in JSON-RPC error responses (required by JSON-RPC 2.0 spec)
  • Migrate from zod-to-json-schema to Zod v4's native z.toJSONSchema()

Details

Dev scripts

The mitmproxy scripts help developers debug MCP traffic by running the server through a reverse proxy that intercepts all client requests:

# TUI mode - run server and mitmproxy with interactive TUI
./dev-with-mitm.sh

# Web UI mode - run server and mitmproxy with web interface at http://localhost:8081
./dev-with-mitmweb.sh

Both scripts:

  • Start the MCP server on port 3232
  • Start mitmproxy reverse proxy on port 8080
  • Clean up both processes on Ctrl+C

JSON-RPC fix

The JSON-RPC 2.0 spec requires an id field in error responses. Added "id": null to all error responses in shttp.ts.

Zod migration

Replaced zod-to-json-schema with Zod v4's built-in z.toJSONSchema() for tool input schema generation.

Test plan

  • Verify dev scripts start both server and mitmproxy
  • Verify JSON-RPC error responses include id field
  • Verify tool schemas are generated correctly

🤖 Generated with Claude Code

- Add dev-with-mitm.sh for TUI-based traffic inspection
- Add dev-with-mitmweb.sh for web UI-based traffic inspection
- Fix missing 'id' field in JSON-RPC error responses (required by spec)
- Migrate from zod-to-json-schema to Zod v4's native z.toJSONSchema()

The mitmproxy scripts help developers debug MCP traffic by running
the server through a reverse proxy that intercepts all client requests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants