Skip to main content
Glama
index.js900 B
#!/usr/bin/env node require('dotenv').config(); const {startSSEServer} = require("./server/sse"); const {startStdioServer} = require("./server/stdio"); const {logger} = require("./utils/logger"); const {initDB} = require("./utils/sqlite"); const args = process.argv.slice(2) const sseMode = args.includes("--sse") || args.includes("-s") const main = async () => { await initDB(); let server; if(sseMode) { server = await startSSEServer(); } else { server = await startStdioServer(); } if(!server) { logger.error("Failed to start server") process.exit(1) } const handleShutdown = async () => { await server.close() process.exit(0) } // Handle process termination process.on("SIGINT", handleShutdown) process.on("SIGTERM", handleShutdown) } main().catch(e => { logger.error("main error", e); })

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/dddd-community/hexiaoyi-mcp-js'

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