diff --git a/havre/src/server.js b/havre/src/server.js new file mode 100644 index 0000000..cf7ce95 --- /dev/null +++ b/havre/src/server.js @@ -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; +}