Commit fa0e36a
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- .github/workflows
- src
- modules
- tests
- test-utils
15 files changed
+1490
-205
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments