mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-02-19 11:54:58 -05:00
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
40 lines
1.1 KiB
JSON
40 lines
1.1 KiB
JSON
{
|
|
"name": "@modelcontextprotocol/server-everything",
|
|
"version": "0.6.2",
|
|
"description": "MCP server that exercises all the features of the MCP protocol",
|
|
"license": "MIT",
|
|
"author": "Anthropic, PBC (https://anthropic.com)",
|
|
"homepage": "https://modelcontextprotocol.io",
|
|
"bugs": "https://github.com/modelcontextprotocol/servers/issues",
|
|
"type": "module",
|
|
"bin": {
|
|
"mcp-server-everything": "dist/index.js"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc && shx cp instructions.md dist/ && shx chmod +x dist/*.js",
|
|
"prepare": "npm run build",
|
|
"watch": "tsc --watch",
|
|
"start": "node dist/index.js",
|
|
"start:sse": "node dist/sse.js",
|
|
"start:streamableHttp": "node dist/streamableHttp.js"
|
|
},
|
|
"dependencies": {
|
|
"@modelcontextprotocol/sdk": "^1.19.1",
|
|
"cors": "^2.8.5",
|
|
"express": "^4.21.1",
|
|
"jszip": "^3.10.1",
|
|
"zod": "^3.23.8",
|
|
"zod-to-json-schema": "^3.23.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/cors": "^2.8.19",
|
|
"@types/express": "^5.0.0",
|
|
"@types/jszip": "^3.4.0",
|
|
"shx": "^0.3.4",
|
|
"typescript": "^5.6.2"
|
|
}
|
|
}
|