34 lines
852 B
TypeScript
34 lines
852 B
TypeScript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
import { t as i18nT } from "i18next";
|
|
import { z } from "zod/v3";
|
|
import { createScopedLogger } from "~/utils/logger.server";
|
|
|
|
const mcpToolsLogger = createScopedLogger("mcp.tools");
|
|
|
|
export function registerMcpTools(server: McpServer) {
|
|
// Public tools - no authentication required
|
|
|
|
server.registerTool(
|
|
"healthcheck",
|
|
{
|
|
description: i18nT("mcp.tools.healthcheck.description"),
|
|
inputSchema: z.object({}),
|
|
},
|
|
async () => {
|
|
mcpToolsLogger.info("[MCP] healthcheck");
|
|
return {
|
|
content: [
|
|
{
|
|
type: "text",
|
|
text: JSON.stringify({
|
|
status: "ok",
|
|
version: "1.0.0",
|
|
timestamp: new Date().toISOString(),
|
|
}),
|
|
},
|
|
],
|
|
};
|
|
}
|
|
);
|
|
}
|