Skip to main content
Glama
index.ts1.33 kB
#!/usr/bin/env node /** * Docfork MCP Server * * A Model Context Protocol server that provides documentation search capabilities. * Supports both stdio and HTTP transports with proper session management. * * Features: * - Search for documentation libraries by name or ID * - Search within specific library documentation for detailed content * - Modern Streamable HTTP transport with session management * - Flexible configuration through environment variables */ import { getServerConfig } from "./server/middleware.js"; import { startStdioServer } from "./transport/stdio.js"; import { startHttpServer } from "./transport/http.js"; async function main() { const config = getServerConfig(); // Determine transport type from config if (config.transport === "streamable-http") { await startHttpServer(config); } else { // Default to stdio transport for MCP client compatibility await startStdioServer(config); } } // Handle graceful shutdown process.on("SIGINT", async () => { console.error("Received SIGINT, shutting down gracefully..."); process.exit(0); }); process.on("SIGTERM", async () => { console.error("Received SIGTERM, shutting down gracefully..."); process.exit(0); }); main().catch((error) => { console.error("Fatal error running server:", error); process.exit(1); });

Latest Blog Posts

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/docfork/docfork-mcp'

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