Skip to content

Commit 3475f29

Browse files
authored
feat: add MCP SDK 1.24+ compatibility (#19)
Support both (SDK 1.23-) and (SDK 1.24+) property names in RegisteredTool to maintain backwards compatibility. Changes: - Update RegisteredTool type to accept either callback or handler - Add utility functions to abstract property name detection - Extract MCP SDK compat helpers into dedicated module - Preserve original property name when wrapping tools - Remove 1.24 version restriction from CI compatibility workflow Tested with MCP SDK versions 1.23.0 and 1.24.2.
1 parent 08a7cb6 commit 3475f29

File tree

7 files changed

+322
-177
lines changed

7 files changed

+322
-177
lines changed

.github/workflows/mcp-compatibility.yml

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

35-
- name: Fetch all available MCP SDK versions (≥1.11, <1.24)
35+
- name: Fetch all available MCP SDK versions (≥1.11)
3636
id: get-versions
3737
run: |
38-
# Get all versions >= 1.11 and < 1.24, filter to get latest patch for each minor version
39-
# Note: Versions 1.24+ have known compatibility issues
38+
# Get all versions >= 1.11, filter to get latest patch for each minor version
4039
VERSIONS=$(pnpm view @modelcontextprotocol/sdk versions --json | jq -c '
4140
map(select(test("^[0-9]+\\.[0-9]+\\.[0-9]+$"))) |
4241
map(select(
4342
(split(".")[0] | tonumber == 1) and
44-
(split(".")[1] | tonumber >= 11) and
45-
(split(".")[1] | tonumber < 24)
43+
(split(".")[1] | tonumber >= 11)
4644
)) |
4745
group_by(split(".")[0:2] | join(".")) |
4846
map(max_by(split(".") | map(tonumber))) |

package.json

Lines changed: 1 addition & 1 deletion
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.8",
57-
"@modelcontextprotocol/sdk": "~1.23.0",
57+
"@modelcontextprotocol/sdk": "~1.24.2",
5858
"@types/node": "^22.15.21",
5959
"@typescript-eslint/eslint-plugin": "^8.32.1",
6060
"@typescript-eslint/parser": "^8.32.1",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)