Skip to main content
Glama
index.js1.34 kB
#!/usr/bin/env node import dotenv from 'dotenv'; import { GhostServer } from './core/server.js'; import { registerToolHandlers } from './tools/index.js'; import { runStdio, runSSE, runHTTP } from './transports/index.js'; // Load environment variables dotenv.config({ path: './.env' }); /** * Initialize and run the Ghost MCP server */ async function main() { try { // Create server instance const server = new GhostServer(); // Register all tool handlers registerToolHandlers(server); // Determine transport mode from command line arguments const useSSE = process.argv.includes('--sse'); const useHTTP = process.argv.includes('--http'); // Run server with appropriate transport if (useHTTP) { console.log('Starting Ghost server with HTTP transport'); await runHTTP(server); } else if (useSSE) { console.log('Starting Ghost server with SSE transport'); await runSSE(server); } else { console.log('Starting Ghost server with stdio transport'); await runStdio(server); } } catch (error) { console.error('Failed to start Ghost server:', error); process.exit(1); } } // Run the server main().catch(console.error);

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/oculairmedia/Ghost-MCP'

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