Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa0e36a

Browse files
committed
feat: add dynamic tool registration support for high-level MCP servers
- Add support for TypeScript MCP SDK's high-level server API that uses .tool() method for registration - Implement dynamic proxying of _registeredTools to inject context parameters and tracing at runtime - Support both low-level (direct handler) and high-level (wrapper with .server property) server architectures - Add new tracingV2 module that handles tool registration via proxy interceptors - Update compatibility checks to differentiate between server types - Ensure backward compatibility with existing low-level server implementations - Add RegisteredTool and HighLevelMCPServerLike types for better type safety - Update tests to support both server architectures This enables MCPCat to work seamlessly with servers using the TypeScript MCP SDK's simplified API while maintaining full compatibility with direct protocol implementations.
1 parent acd2cd8 commit fa0e36a

File tree

15 files changed

+1490
-205
lines changed

15 files changed

+1490
-205
lines changed

.github/workflows/mcp-compatibility.yml

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

35-
- name: Fetch all available MCP SDK versions (≥1.0)
35+
- name: Fetch all available MCP SDK versions (≥1.3)
3636
id: get-versions
3737
run: |
38-
# Get all versions >= 1.0 and filter to get latest patch for each minor version
38+
# Get all versions >= 1.3 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]+$"))) |
41-
map(select(split(".")[0] | tonumber >= 1)) |
41+
map(select(
42+
(split(".")[0] | tonumber > 1) or
43+
((split(".")[0] | tonumber == 1) and (split(".")[1] | tonumber >= 3))
44+
)) |
4245
group_by(split(".")[0:2] | join(".")) |
4346
map(max_by(split(".") | map(tonumber))) |
4447
sort_by(split(".") | map(tonumber))

eslint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export default [
1717
rules: {
1818
"@typescript-eslint/no-unused-vars": [
1919
"error",
20-
{ argsIgnorePattern: "^_" },
20+
{
21+
argsIgnorePattern: "^_",
22+
varsIgnorePattern: "^_",
23+
},
2124
],
2225
"@typescript-eslint/no-explicit-any": "off",
2326
},

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"packageManager": "[email protected]",
5555
"devDependencies": {
5656
"@changesets/cli": "^2.29.4",
57-
"@modelcontextprotocol/sdk": "1.3.0",
57+
"@modelcontextprotocol/sdk": "1.17.1",
5858
"@types/node": "^22.15.21",
5959
"@typescript-eslint/eslint-plugin": "^8.32.1",
6060
"@typescript-eslint/parser": "^8.32.1",
@@ -69,11 +69,12 @@
6969
"vitest": "^3.1.4"
7070
},
7171
"peerDependencies": {
72-
"@modelcontextprotocol/sdk": ">=1.0.0"
72+
"@modelcontextprotocol/sdk": ">=1.3.1"
7373
},
7474
"dependencies": {
7575
"mcpcat-api": "0.1.3",
76-
"redact-pii": "3.4.0"
76+
"redact-pii": "3.4.0",
77+
"zod": "3.25.30"
7778
},
7879
"lint-staged": {
7980
"*.{ts,js}": [

0 commit comments

Comments
 (0)