mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-19 08:33:23 +02:00
fix(everything): convert to modern TypeScript SDK APIs
Convert the everything server to use the modern McpServer API instead of the low-level Server API. Key changes: - Replace Server with McpServer from @modelcontextprotocol/sdk/server/mcp.js - Convert simple tools to use registerTool() for cleaner code - Convert simple prompts to use registerPrompt() - Keep advanced features using server.server.setRequestHandler() for low-level access - Add type dependencies (@types/jszip, @types/cors) - Update all transport files to use server.server.connect/close pattern - Fix type literals to use 'as const' assertions Tools converted to registerTool(): - echo, add, printEnv, getTinyImage, annotatedMessage, getResourceLinks, structuredContent, zip Tools still using setRequestHandler() (need low-level access): - longRunningOperation (progress tokens) - sampleLLM (sampling protocol) - elicitation (elicitation protocol) - listRoots (client capabilities) - getResourceReference (strict resource content typing) All features maintained: - 13 tools including progress notifications, sampling, elicitation - 3 prompts (simple, complex, resource) - 100 paginated resources with templates - Resource subscriptions - Completions for prompts and resources - Roots protocol support - Logging at various levels - All three transports (stdio, SSE, streamable HTTP) The modern API provides: - Less boilerplate code where applicable - Better type safety with Zod - More declarative registration - Cleaner, more maintainable code
This commit is contained in:
11
package-lock.json
generated
11
package-lock.json
generated
@@ -1341,6 +1341,16 @@
|
||||
"integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/jszip": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.4.0.tgz",
|
||||
"integrity": "sha512-GFHqtQQP3R4NNuvZH3hNCYD0NbyBZ42bkN7kO3NDrU/SnvIZWMS8Bp38XCsRKBT5BXvgm0y1zqpZWp/ZkRzBzg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jszip": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
@@ -4107,6 +4117,7 @@
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.19",
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/jszip": "^3.4.0",
|
||||
"shx": "^0.3.4",
|
||||
"typescript": "^5.6.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user