Add dev scripts for mitmproxy debugging and fix JSON-RPC error responses
- 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>
This commit is contained in:
parent
a02624c8b5
commit
07300e8453
1 changed files with 83 additions and 13 deletions
|
|
@ -67,6 +67,7 @@ export async function handleStreamableHTTP(req: Request, res: Response) {
|
|||
});
|
||||
res.status(401).json({
|
||||
"jsonrpc": "2.0",
|
||||
"id": null,
|
||||
"error": {
|
||||
"code": -32002,
|
||||
"message": "User ID required"
|
||||
|
|
@ -87,6 +88,7 @@ export async function handleStreamableHTTP(req: Request, res: Response) {
|
|||
});
|
||||
res.status(401).json({
|
||||
"jsonrpc": "2.0",
|
||||
"id": null,
|
||||
"error": {
|
||||
"code": -32001,
|
||||
"message": "Session not found or access denied"
|
||||
|
|
@ -148,6 +150,7 @@ export async function handleStreamableHTTP(req: Request, res: Response) {
|
|||
});
|
||||
res.status(400).json({
|
||||
"jsonrpc": "2.0",
|
||||
"id": null,
|
||||
"error": {
|
||||
"code": -32600,
|
||||
"message": "Invalid request method for existing session"
|
||||
|
|
@ -167,6 +170,7 @@ export async function handleStreamableHTTP(req: Request, res: Response) {
|
|||
if (!res.headersSent) {
|
||||
res.status(500).json({
|
||||
"jsonrpc": "2.0",
|
||||
"id": null,
|
||||
"error": {
|
||||
"code": -32603,
|
||||
"message": "Internal error during request processing"
|
||||
|
|
|
|||
Loading…
Reference in a new issue