Skip to main content
Glama

mcp-omnisearch

index.ts1.73 kB
#!/usr/bin/env node import { ValibotJsonSchemaAdapter } from '@tmcp/adapter-valibot'; import { StdioTransport } from '@tmcp/transport-stdio'; import { McpServer } from 'tmcp'; import type { GenericSchema } from 'valibot'; import { validate_config } from './config/env.js'; import { initialize_providers } from './providers/index.js'; import { setup_handlers } from './server/handlers.js'; import { register_tools } from './server/tools.js'; import { readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const pkg = JSON.parse( readFileSync(join(__dirname, '..', 'package.json'), 'utf8'), ); const { name, version } = pkg; class OmnisearchServer { private server: McpServer<GenericSchema>; constructor() { const adapter = new ValibotJsonSchemaAdapter(); this.server = new McpServer( { name, version, description: 'MCP server for integrating Omnisearch with LLMs', }, { adapter, capabilities: { tools: { listChanged: true }, resources: { listChanged: true }, }, }, ); // Validate environment configuration validate_config(); // Initialize and register providers initialize_providers(); // Register tools and setup handlers register_tools(this.server); setup_handlers(this.server); // Error handling process.on('SIGINT', async () => { process.exit(0); }); } async run() { const transport = new StdioTransport(this.server); transport.listen(); console.error('Omnisearch MCP server running on stdio'); } } const server = new OmnisearchServer(); server.run().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/spences10/mcp-omnisearch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server