Align MCP setup with Codex JSON transport

This commit is contained in:
DCCONSTRUCTIONS 2026-05-23 20:40:51 +03:00
parent 526371014a
commit 6b3ecd6e1f
5 changed files with 10 additions and 6 deletions

View File

@ -119,7 +119,7 @@ Call MCP tools through the JSON-RPC endpoint:
```bash ```bash
curl -sS http://127.0.0.1:4100/mcp \ curl -sS http://127.0.0.1:4100/mcp \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \ -H 'Accept: application/json' \
-H 'MCP-Protocol-Version: 2025-06-18' \ -H 'MCP-Protocol-Version: 2025-06-18' \
-H "Authorization: Bearer $TOKEN" \ -H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","id":"tools","method":"tools/list","params":{}}' | jq -d '{"jsonrpc":"2.0","id":"tools","method":"tools/list","params":{}}' | jq

View File

@ -36,7 +36,7 @@ Required request headers for authenticated tool calls:
```text ```text
Authorization: Bearer <agent-token> Authorization: Bearer <agent-token>
Accept: application/json, text/event-stream Accept: application/json
MCP-Protocol-Version: 2025-06-18 MCP-Protocol-Version: 2025-06-18
``` ```

View File

@ -733,7 +733,7 @@ function buildSetupPacket(session: AgentSessionRecord, publicUrl: string): Recor
url: endpoint, url: endpoint,
headers: { headers: {
Authorization: `Bearer ${tokenPlaceholder}`, Authorization: `Bearer ${tokenPlaceholder}`,
Accept: "application/json, text/event-stream", Accept: "application/json",
"MCP-Protocol-Version": "2025-06-18", "MCP-Protocol-Version": "2025-06-18",
}, },
}, },
@ -741,9 +741,13 @@ function buildSetupPacket(session: AgentSessionRecord, publicUrl: string): Recor
mcp_servers: { mcp_servers: {
nodedc_tasker: { nodedc_tasker: {
url: endpoint, url: endpoint,
enabled: true,
required: false,
startup_timeout_sec: 20,
tool_timeout_sec: 60,
headers: { headers: {
Authorization: `Bearer ${tokenPlaceholder}`, Authorization: `Bearer ${tokenPlaceholder}`,
Accept: "application/json, text/event-stream", Accept: "application/json",
"MCP-Protocol-Version": "2025-06-18", "MCP-Protocol-Version": "2025-06-18",
}, },
}, },

View File

@ -40,7 +40,7 @@ try {
const token = await createToken(agentId); const token = await createToken(agentId);
const headers = { const headers = {
Authorization: `Bearer ${token}`, Authorization: `Bearer ${token}`,
Accept: "application/json, text/event-stream", Accept: "application/json",
"MCP-Protocol-Version": "2025-06-18", "MCP-Protocol-Version": "2025-06-18",
}; };

View File

@ -38,7 +38,7 @@ try {
const token = await createToken(agentId); const token = await createToken(agentId);
const headers = { const headers = {
Authorization: `Bearer ${token}`, Authorization: `Bearer ${token}`,
Accept: "application/json, text/event-stream", Accept: "application/json",
"MCP-Protocol-Version": "2025-06-18", "MCP-Protocol-Version": "2025-06-18",
}; };