From 6b3ecd6e1fc23fb11f548bc30ce4c4dda07c2b92 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Sat, 23 May 2026 20:40:51 +0300 Subject: [PATCH] Align MCP setup with Codex JSON transport --- README.md | 2 +- docs/MCP_TOOLS_CONTRACT.md | 2 +- src/routes/agents.ts | 8 ++++++-- src/scripts/smoke-mcp-e2e.ts | 2 +- src/scripts/smoke-mcp.ts | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 747b6c6..dc09803 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Call MCP tools through the JSON-RPC endpoint: ```bash curl -sS http://127.0.0.1:4100/mcp \ -H 'Content-Type: application/json' \ - -H 'Accept: application/json, text/event-stream' \ + -H 'Accept: application/json' \ -H 'MCP-Protocol-Version: 2025-06-18' \ -H "Authorization: Bearer $TOKEN" \ -d '{"jsonrpc":"2.0","id":"tools","method":"tools/list","params":{}}' | jq diff --git a/docs/MCP_TOOLS_CONTRACT.md b/docs/MCP_TOOLS_CONTRACT.md index a83c46e..a443619 100644 --- a/docs/MCP_TOOLS_CONTRACT.md +++ b/docs/MCP_TOOLS_CONTRACT.md @@ -36,7 +36,7 @@ Required request headers for authenticated tool calls: ```text Authorization: Bearer -Accept: application/json, text/event-stream +Accept: application/json MCP-Protocol-Version: 2025-06-18 ``` diff --git a/src/routes/agents.ts b/src/routes/agents.ts index fdcef05..8d059ae 100644 --- a/src/routes/agents.ts +++ b/src/routes/agents.ts @@ -733,7 +733,7 @@ function buildSetupPacket(session: AgentSessionRecord, publicUrl: string): Recor url: endpoint, headers: { Authorization: `Bearer ${tokenPlaceholder}`, - Accept: "application/json, text/event-stream", + Accept: "application/json", "MCP-Protocol-Version": "2025-06-18", }, }, @@ -741,9 +741,13 @@ function buildSetupPacket(session: AgentSessionRecord, publicUrl: string): Recor mcp_servers: { nodedc_tasker: { url: endpoint, + enabled: true, + required: false, + startup_timeout_sec: 20, + tool_timeout_sec: 60, headers: { Authorization: `Bearer ${tokenPlaceholder}`, - Accept: "application/json, text/event-stream", + Accept: "application/json", "MCP-Protocol-Version": "2025-06-18", }, }, diff --git a/src/scripts/smoke-mcp-e2e.ts b/src/scripts/smoke-mcp-e2e.ts index de5c252..c720db3 100644 --- a/src/scripts/smoke-mcp-e2e.ts +++ b/src/scripts/smoke-mcp-e2e.ts @@ -40,7 +40,7 @@ try { const token = await createToken(agentId); const headers = { Authorization: `Bearer ${token}`, - Accept: "application/json, text/event-stream", + Accept: "application/json", "MCP-Protocol-Version": "2025-06-18", }; diff --git a/src/scripts/smoke-mcp.ts b/src/scripts/smoke-mcp.ts index e7c15e8..2913dd3 100644 --- a/src/scripts/smoke-mcp.ts +++ b/src/scripts/smoke-mcp.ts @@ -38,7 +38,7 @@ try { const token = await createToken(agentId); const headers = { Authorization: `Bearer ${token}`, - Accept: "application/json, text/event-stream", + Accept: "application/json", "MCP-Protocol-Version": "2025-06-18", };