Skip to main content
Glama

github-manager MCP Server

RequestHandler.ts969 B
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js'; /** * Simple error handler for MCP server operations */ export class RequestHandler { constructor( private logger: (level: 'debug' | 'info' | 'warn' | 'error', message: string, data?: any) => void ) {} /** * Execute a request and handle errors appropriately for MCP */ async executeRequest<T>( operation: () => Promise<T>, context: string ): Promise<T> { try { return await operation(); } catch (error) { this.logger('error', `Error in ${context}`, error); throw this.wrapError(error as Error, context); } } /** * Convert errors to appropriate MCP error types */ private wrapError(error: Error, context: string): McpError { const message = `Failed to ${context}: ${error.message}`; if (error instanceof McpError) { return error; } return new McpError(ErrorCode.InternalError, message); } }

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/wheelhousedev/github-mcp'

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