// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

import { logger } from './logger.js';

/**
 * Wraps the official MCP SDK's high-level server, whose `.tool()` API
 * `registerTools()` (Story 12) uses to attach `search`/`get`/`call` with
 * Zod-validated input shapes.
 */
export function createMcpServer(): McpServer {
  return new McpServer({ name: '{{ project_name }}', version: '0.1.0' });
}

export async function connectStdio(server: McpServer): Promise<void> {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  logger.info('MCP server connected over stdio');
}
