Files
servers-modelcontextprotocol-1/src/everything/tools/index.ts
cliffhall 0f3e27ef87 [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
2025-12-08 19:14:06 -05:00

23 lines
894 B
TypeScript

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.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";
/**
* Register the tools with the MCP server.
* @param server
*/
export const registerTools = (server: McpServer) => {
registerAddTool(server);
registerEchoTool(server);
registerLongRunningOperationTool(server);
registerPrintEnvTool(server);
registerSamplingRequestTool(server);
registerToggleLoggingTool(server);
registerToggleSubscriberUpdatesTool(server);
};