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.
Added print-env, and sampling-request tools
* Updated architecture.md
* In tools/index.ts
- import registerPrintEnvTool and registerSamplingRequestTool
- in registerTools
- call registerPrintEnvTool and registerSamplingRequestTool
* Added tools/print-env.ts
- registers a tool that takes no args and returns the environment variables
* Added tools/sampling-request
- registers a tool that
- takes prompt and maxTokens args
- sends client a sampling request
- returns the client response in the result
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { registerEchoTool } from "./echo.js";
|
||||
import { registerAddTool } from "./add.js";
|
||||
import { registerEchoTool } from "./echo.js";
|
||||
import { registerLongRunningOperationTool } from "./long-running-operation.js";
|
||||
import { registerPrintEnvTool } from "./print-env.js";
|
||||
import { registerSamplingRequestTool } from "./sampling-request.js";
|
||||
import { registerToggleLoggingTool } from "./toggle-logging.js";
|
||||
import { registerToggleSubscriberUpdatesTool } from "./toggle-subscriber-updates.js";
|
||||
import { registerLongRunningOperationTool } from "./long-running-operation.js";
|
||||
|
||||
/**
|
||||
* Register the tools with the MCP server.
|
||||
* @param server
|
||||
*/
|
||||
export const registerTools = (server: McpServer) => {
|
||||
registerEchoTool(server);
|
||||
registerAddTool(server);
|
||||
registerEchoTool(server);
|
||||
registerLongRunningOperationTool(server);
|
||||
registerPrintEnvTool(server);
|
||||
registerSamplingRequestTool(server);
|
||||
registerToggleLoggingTool(server);
|
||||
registerToggleSubscriberUpdatesTool(server);
|
||||
registerLongRunningOperationTool(server);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user