mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 08:03:26 +02:00
[WIP] Refactor everything server to be more modular and use recommended APIs
In src/everything:
* Refactor / move streamableHttp.ts, sse.ts, and stdio.ts to transports/
* Move everything.ts to server/ for reference
* Add server/index.js
- exports the createServer function
- import registerTools from tools/index.js
- in createServer()
- read instructions.md and include in ServerOptions for McpServer constructor
- construct McpServer instead of Server
- call registerTools, passing server
* Add tools/echo.ts
- define EchoSchema
- define tool config
- export addToolEcho function
- in addToolEcho()
- register handler for Echo tool
* Add tools/index.ts
- import addToolEcho
- export registerTools function
- in registerTools()
- call addToolEcho
This commit is contained in:
11
src/everything/tools/index.ts
Normal file
11
src/everything/tools/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { addToolEcho } from "./echo.js";
|
||||
|
||||
|
||||
/**
|
||||
* Register the tools with the MCP server.
|
||||
* @param server
|
||||
*/
|
||||
export const registerTools = (server: McpServer) => {
|
||||
addToolEcho(server);
|
||||
};
|
||||
Reference in New Issue
Block a user