mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 00:03:23 +02:00
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
23 lines
894 B
TypeScript
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);
|
|
};
|