Skip to content

Commit d30fcb9

Browse files
committed
chore: update MCP SDK compatibility range to >=1.11
Updates minimum MCP SDK version requirement from 1.3 to 1.11 across the project. This ensures compatibility with newer SDK features while maintaining backward compatibility with versions 1.11 and above. Changes: - Update GitHub workflow to test versions >=1.11 - Update devDependency to @modelcontextprotocol/sdk@1.11 - Update peerDependencies requirement to >=1.11 - Update compatibility module for SDK version 1.11+ support
1 parent cb0c91b commit d30fcb9

File tree

5 files changed

+114
-79
lines changed

5 files changed

+114
-79
lines changed

.github/workflows/mcp-compatibility.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
with:
3333
version: 9
3434

35-
- name: Fetch all available MCP SDK versions (≥1.3)
35+
- name: Fetch all available MCP SDK versions (≥1.11)
3636
id: get-versions
3737
run: |
38-
# Get all versions >= 1.3 and filter to get latest patch for each minor version
38+
# Get all versions >= 1.11 and filter to get latest patch for each minor version
3939
VERSIONS=$(pnpm view @modelcontextprotocol/sdk versions --json | jq -c '
4040
map(select(test("^[0-9]+\\.[0-9]+\\.[0-9]+$"))) |
4141
map(select(
4242
(split(".")[0] | tonumber > 1) or
43-
((split(".")[0] | tonumber == 1) and (split(".")[1] | tonumber >= 3))
43+
((split(".")[0] | tonumber == 1) and (split(".")[1] | tonumber >= 11))
4444
)) |
4545
group_by(split(".")[0:2] | join(".")) |
4646
map(max_by(split(".") | map(tonumber))) |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"packageManager": "pnpm@10.11.0",
5555
"devDependencies": {
5656
"@changesets/cli": "^2.29.4",
57-
"@modelcontextprotocol/sdk": "1.17.1",
57+
"@modelcontextprotocol/sdk": "1.11",
5858
"@types/node": "^22.15.21",
5959
"@typescript-eslint/eslint-plugin": "^8.32.1",
6060
"@typescript-eslint/parser": "^8.32.1",
@@ -69,7 +69,7 @@
6969
"vitest": "^3.1.4"
7070
},
7171
"peerDependencies": {
72-
"@modelcontextprotocol/sdk": ">=1.3.1"
72+
"@modelcontextprotocol/sdk": ">=1.11"
7373
},
7474
"dependencies": {
7575
"@opentelemetry/otlp-transformer": "^0.203.0",

pnpm-lock.yaml

Lines changed: 44 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/compatibility.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
import { HighLevelMCPServerLike, MCPServerLike } from "../types.js";
22
import { writeToLog } from "./logging.js";
33

4+
/**
5+
* MCPCat Compatibility Module
6+
*
7+
* This module ensures compatibility with Model Context Protocol TypeScript SDK.
8+
* MCPCat only supports MCP SDK version 1.11 and above.
9+
*
10+
* Version 1.11+ is required because it introduced stable APIs for:
11+
* - Tool registration and handling
12+
* - Request handler access patterns
13+
* - Client version detection
14+
* - Server info structure
15+
*/
16+
417
// Function to log compatibility information
518
export function logCompatibilityWarning(): void {
619
writeToLog(
7-
"MCPCat SDK Compatibility: This version supports MCP SDK versions v1.0 - v1.12",
20+
"MCPCat SDK Compatibility: This version only supports Model Context Protocol TypeScript SDK v1.11 and above. Please upgrade if using an older version.",
821
);
922
}
1023

@@ -30,7 +43,7 @@ export function isCompatibleServerType(
3043
if (!server || typeof server !== "object") {
3144
logCompatibilityWarning();
3245
throw new Error(
33-
"MCPCat SDK compatibility error: Server must be an object.",
46+
"MCPCat SDK compatibility error: Server must be an object. Ensure you're using MCP SDK v1.11 or higher.",
3447
);
3548
}
3649

@@ -42,13 +55,13 @@ export function isCompatibleServerType(
4255
) {
4356
logCompatibilityWarning();
4457
throw new Error(
45-
"MCPCat SDK compatibility error: High-level server must have _registeredTools object.",
58+
"MCPCat SDK compatibility error: High-level server must have _registeredTools object. This requires MCP SDK v1.11 or higher.",
4659
);
4760
}
4861
if (typeof server.tool !== "function") {
4962
logCompatibilityWarning();
5063
throw new Error(
51-
"MCPCat SDK compatibility error: High-level server must have tool() method.",
64+
"MCPCat SDK compatibility error: High-level server must have tool() method. This requires MCP SDK v1.11 or higher.",
5265
);
5366
}
5467

@@ -69,29 +82,29 @@ function validateLowLevelServer(server: any): void {
6982
if (typeof server.setRequestHandler !== "function") {
7083
logCompatibilityWarning();
7184
throw new Error(
72-
"MCPCat SDK compatibility error: Server must have a setRequestHandler method.",
85+
"MCPCat SDK compatibility error: Server must have a setRequestHandler method. This requires MCP SDK v1.11 or higher.",
7386
);
7487
}
7588

7689
if (!server._requestHandlers || !(server._requestHandlers instanceof Map)) {
7790
logCompatibilityWarning();
7891
throw new Error(
79-
"MCPCat SDK compatibility error: Server._requestHandlers is not accessible.",
92+
"MCPCat SDK compatibility error: Server._requestHandlers is not accessible. This requires MCP SDK v1.11 or higher.",
8093
);
8194
}
8295

8396
// Validate that _requestHandlers contains functions with compatible signatures
8497
if (typeof server._requestHandlers.get !== "function") {
8598
logCompatibilityWarning();
8699
throw new Error(
87-
"MCPCat SDK compatibility error: Server._requestHandlers must be a Map with a get method.",
100+
"MCPCat SDK compatibility error: Server._requestHandlers must be a Map with a get method. This requires MCP SDK v1.11 or higher.",
88101
);
89102
}
90103

91104
if (typeof server.getClientVersion !== "function") {
92105
logCompatibilityWarning();
93106
throw new Error(
94-
"MCPCat SDK compatibility error: Server.getClientVersion must be a function.",
107+
"MCPCat SDK compatibility error: Server.getClientVersion must be a function. This requires MCP SDK v1.11 or higher.",
95108
);
96109
}
97110

@@ -102,7 +115,7 @@ function validateLowLevelServer(server: any): void {
102115
) {
103116
logCompatibilityWarning();
104117
throw new Error(
105-
"MCPCat SDK compatibility error: Server._serverInfo is not accessible or missing name.",
118+
"MCPCat SDK compatibility error: Server._serverInfo is not accessible or missing name. This requires MCP SDK v1.11 or higher.",
106119
);
107120
}
108121
}

0 commit comments

Comments
 (0)