card #97: update havre/src/server.js

This commit is contained in:
time committed 2026-10-19 16:11:19 +00:00
1 parent f793c09aa7
commit d687f8de72
1 file changed
+14
+14
View File
@@ -0,0 +1,14 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
// Stateless by construction: a fresh server per connection, handlers are pure functions of their input.
// Add tools here; nothing in this file may read or write disk, a database, or a stored secret.
export function createServer() {
const server = new McpServer({ name: "havre", version: "0.0.0" });
server.registerTool(
"havre_ping",
{ description: "Placeholder tool: echoes a message back (default 'pong').", inputSchema: { message: z.string().max(200).optional() } },
async ({ message }) => ({ content: [{ type: "text", text: message ?? "pong" }] }),
);
return server;
}