Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/api/routes/chatgpt-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ const mcpHandler = McpConnectAgent.serve("/chatgpt/mcp", {
binding: "MCP_AGENT",
});

// Deprecation headers — this route is being retired in favor of the canonical
// mcp.chitty.cc aggregator. ChatGPT clients should re-register against
// https://mcp.chitty.cc/ (unified OAuth, same scopes, same tools, unified audit).
// Sunset window: 2026-08-15.
chatgptMcp.use("*", async (c, next) => {
await next();
// The downstream MCP handler returns a streamed Response (SSE) whose headers
// are immutable; mutating c.res.headers in place can throw. Rebuild the
// Response so deprecation headers attach cleanly without buffering the body.
const res = new Response(c.res.body, c.res);
// RFC 9745: Deprecation is a structured-field Date (@<unix-seconds>), not a
// boolean. @1778976000 = 2026-05-17T00:00:00Z, the date this route entered
// deprecation.
res.headers.set("Deprecation", "@1778976000");
res.headers.set("Sunset", "Sat, 15 Aug 2026 00:00:00 GMT");
res.headers.set(
"Link",
'<https://mcp.chitty.cc/mcp>; rel="successor-version", <https://mcp.chitty.cc/sse>; rel="alternate"',
);
c.res = res;
});

/**
* Authentication middleware.
* Extracts bearer token or API key. Validation is deferred to the DO layer
Expand Down
Loading