Skip to main content
Glama

GroundDocs

Official
by GroundDocs
index.ts2.05 kB
#!/usr/bin/env node import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { setupJsonConsole } from "./utils/console.js"; import { GetPythonDocumentationTool } from "./tools/python-documentation.js"; import { GetKubernetesDocumentationTool } from "./tools/kubernetes-documentation.js"; setupJsonConsole(); const VERSION = "0.1.0"; const server = new McpServer({ name: "grounddocs", version: VERSION, }); // Register tools new GetPythonDocumentationTool().register(server); new GetKubernetesDocumentationTool().register(server); async function runServer() { const transport = new StdioServerTransport(); console.log(`Starting server v${VERSION} (PID: ${process.pid})`); let isShuttingDown = false; const cleanup = () => { if (isShuttingDown) return; isShuttingDown = true; console.log(`Shutting down server (PID: ${process.pid})...`); try { transport.close(); } catch (error) { console.error(`Error closing transport (PID: ${process.pid}):`, error); } console.log(`Server closed (PID: ${process.pid})`); process.exit(0); }; transport.onerror = (error: Error) => { console.error(`Transport error (PID: ${process.pid}):`, error); cleanup(); }; transport.onclose = () => { console.log(`Transport closed unexpectedly (PID: ${process.pid})`); cleanup(); }; process.on("SIGTERM", () => { console.log(`Received SIGTERM (PID: ${process.pid})`); cleanup(); }); process.on("SIGINT", () => { console.log(`Received SIGINT (PID: ${process.pid})`); cleanup(); }); process.on("beforeExit", () => { console.log(`Received beforeExit (PID: ${process.pid})`); cleanup(); }); await server.connect(transport); console.log(`Server started (PID: ${process.pid})`); } runServer().catch((error) => { console.error(`Fatal error running server (PID: ${process.pid}):`, error); if (!process.exitCode) { process.exit(1); } });

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/GroundDocs/grounddocs'

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