Skip to main content
Glama

athenahealth MCP Server

index.tsโ€ข2.39 kB
#!/usr/bin/env node // MUST be first import - redirects all console output to stderr for MCP compatibility import './utils/mcp-logger.js'; import { config } from 'dotenv'; import { AthenaHealthMCPServer } from './mcp-server.js'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; // Get the directory of the current module const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); // Load environment variables from the project root const envPath = join(__dirname, '..', '.env'); config({ path: envPath }); console.error('Loading .env from:', envPath); console.error('Environment check:', { ATHENA_CLIENT_ID: process.env.ATHENA_CLIENT_ID ? 'Set' : 'Not set', ATHENA_CLIENT_SECRET: process.env.ATHENA_CLIENT_SECRET ? 'Set' : 'Not set', ATHENA_BASE_URL: process.env.ATHENA_BASE_URL ? 'Set' : 'Not set', ATHENA_PRACTICE_ID: process.env.ATHENA_PRACTICE_ID ? 'Set' : 'Not set', }); // Handle graceful shutdown let server: AthenaHealthMCPServer | null = null; const gracefulShutdown = async (signal: string) => { console.error(`Received ${signal}, shutting down gracefully`); if (server) { try { await server.stop(); console.error('Server stopped successfully'); } catch (error) { console.error('Error during server shutdown:', error); } } process.exit(0); }; // Register shutdown handlers process.on('SIGINT', () => gracefulShutdown('SIGINT')); process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); process.on('SIGQUIT', () => gracefulShutdown('SIGQUIT')); // Handle uncaught exceptions process.on('uncaughtException', (error) => { console.error('Uncaught exception:', error.message, error.stack); process.exit(1); }); process.on('unhandledRejection', (reason, promise) => { console.error('Unhandled promise rejection:', reason, promise); process.exit(1); }); // Main function async function main() { try { console.error('Starting athenahealth MCP Server'); // Create and initialize server server = new AthenaHealthMCPServer(); await server.initialize(); // Start server await server.run(); } catch (error) { console.error('Failed to start server:', error); process.exit(1); } } // Start the server main().catch((error) => { console.error('Fatal error during server startup:', error); 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/ophydami/Athenahealth-MCP'

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