diff --git a/server/mcp/index.ts b/server/mcp/index.ts index 2436a4066f..51a6638bba 100644 --- a/server/mcp/index.ts +++ b/server/mcp/index.ts @@ -49,9 +49,11 @@ export function createMcpServer( ], }, { + // The lists never change during a request, so subscriptions/listen + // completes at once instead of holding a stream open. capabilities: { - tools: {}, - resources: {}, + tools: { listChanged: false }, + resources: { listChanged: false, subscribe: false }, extensions: { [skillsExtensionId]: {}, }, diff --git a/server/routes/mcp/index.test.ts b/server/routes/mcp/index.test.ts index 7cb5236007..ec55bce762 100644 --- a/server/routes/mcp/index.test.ts +++ b/server/routes/mcp/index.test.ts @@ -131,6 +131,30 @@ describe("POST /mcp/", () => { expect(result?.content?.[0]?.text).toContain(collection.id); }); + it("should complete a subscriptions/listen request at once", async () => { + const { accessToken } = await buildOAuthUser(); + const { body, resultId } = mcpRequest("subscriptions/listen", { + notifications: { + toolsListChanged: true, + resourcesListChanged: true, + }, + _meta: modernMeta("2026-07-28"), + }); + const res = await server.post("/mcp/", { + headers: { + ...mcpHeaders(accessToken), + "MCP-Protocol-Version": "2026-07-28", + "Mcp-Method": "subscriptions/listen", + }, + body, + }); + expect(res.status).toEqual(200); + + const text = await res.text(); + expect(text).toContain('"resultType":"complete"'); + expect(text).toContain(`"id":${resultId}`); + }); + it("should handle initialize and return capabilities", async () => { const { accessToken } = await buildOAuthUser(); const { body } = mcpRequest("initialize", {