From aed1e87bb199a34c3a2629b5e040efa370e95e18 Mon Sep 17 00:00:00 2001 From: "linear-code[bot]" <222613912+linear-code[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:55:10 -0400 Subject: [PATCH] chore: update @modelcontextprotocol/sdk to 1.32.1 (#14145) * chore: update MCP SDK to 1.32.1 Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com> * feat: Limit MCP tool argument elements to 1000 --------- Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com> Co-authored-by: Tom Moor --- package.json | 2 +- server/mcp/index.ts | 3 +++ server/routes/mcp/index.test.ts | 12 ++++++++++++ yarn.lock | 10 +++++----- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8d3ab33590..77392bceb1 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@koa/router": "^15.7.0", "@koa/send": "^6.0.0", "@linear/sdk": "^97.0.0", - "@modelcontextprotocol/sdk": "^1.31.0", + "@modelcontextprotocol/sdk": "^1.32.1", "@noble/hashes": "^2.4.0", "@node-oauth/oauth2-server": "^5.3.0", "@notionhq/client": "^2.3.0", diff --git a/server/mcp/index.ts b/server/mcp/index.ts index de890cc309..998691f218 100644 --- a/server/mcp/index.ts +++ b/server/mcp/index.ts @@ -57,6 +57,9 @@ export function createMcpServer( }, }, instructions, + + // Tool arguments are flat, so a large element count is never legitimate. + maxToolInputElements: 1000, } ); diff --git a/server/routes/mcp/index.test.ts b/server/routes/mcp/index.test.ts index 4ecda7c262..5349bf0f01 100644 --- a/server/routes/mcp/index.test.ts +++ b/server/routes/mcp/index.test.ts @@ -199,6 +199,18 @@ describe("POST /mcp/", () => { await user.reload(); expect(user.getFlag(UserFlag.MCP)).toEqual(1); }); + + it("should reject tool arguments with too many elements", async () => { + const { accessToken } = await buildOAuthUser(); + + const res = await callMcpTool(server, accessToken, "list_collections", { + extra: Array.from({ length: 1001 }, (_, i) => i), + }); + expect(res?.result?.isError).toBe(true); + expect(res?.result?.content?.[0]?.text).toContain( + "more than the maximum of 1000 elements" + ); + }); }); describe("resources", () => { diff --git a/yarn.lock b/yarn.lock index 34f60e992b..b03088c16d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2713,9 +2713,9 @@ __metadata: languageName: node linkType: hard -"@modelcontextprotocol/sdk@npm:^1.31.0": - version: 1.31.0 - resolution: "@modelcontextprotocol/sdk@npm:1.31.0" +"@modelcontextprotocol/sdk@npm:^1.32.1": + version: 1.32.1 + resolution: "@modelcontextprotocol/sdk@npm:1.32.1" dependencies: "@hono/node-server": "npm:^1.19.9 || ^2.0.5" ajv: "npm:^8.17.1" @@ -2742,7 +2742,7 @@ __metadata: optional: true zod: optional: false - checksum: 10c0/2c4f011a765fb3346ec578455591d062008a842a0f6f8a763baa97b6a01e0f1febb97d1cc44024ee6d0761d43df56e9c71f72a37d47c7ea6aeb1c4f8be0f06d9 + checksum: 10c0/8b6c8ff6aa5358aeb316fedfa2094a4241ce12d98a0f818cee42510ec9149fed21fc75244c5f0e8cb453337f243c09fa8a90425cd2533fd481964d8583a1f0c9 languageName: node linkType: hard @@ -14389,7 +14389,7 @@ __metadata: "@koa/router": "npm:^15.7.0" "@koa/send": "npm:^6.0.0" "@linear/sdk": "npm:^97.0.0" - "@modelcontextprotocol/sdk": "npm:^1.31.0" + "@modelcontextprotocol/sdk": "npm:^1.32.1" "@noble/hashes": "npm:^2.4.0" "@node-oauth/oauth2-server": "npm:^5.3.0" "@notionhq/client": "npm:^2.3.0"