Skip to main content
Glama
index.ts1.26 kB
#!/usr/bin/env node import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { ApiClient } from './api-client.js'; import { HandlerRegistry } from './handler-registry.js'; class RagDocsServer { private server: Server; private apiClient: ApiClient; private handlerRegistry: HandlerRegistry; constructor() { this.server = new Server( { name: 'mcp-ragdocs', version: '0.1.0', }, { capabilities: { tools: {}, }, } ); this.apiClient = new ApiClient(); this.handlerRegistry = new HandlerRegistry(this.server, this.apiClient); // Error handling this.server.onerror = (error) => console.error('[MCP Error]', error); process.on('SIGINT', async () => { await this.cleanup(); process.exit(0); }); } private async cleanup() { await this.apiClient.cleanup(); await this.server.close(); } async run() { const transport = new StdioServerTransport(); await this.server.connect(transport); console.error('RAG Docs MCP server running on stdio'); } } const server = new RagDocsServer(); 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/hannesrudolph/mcp-ragdocs'

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