We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/todo-for-ai/todo-for-ai-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
base.ts•835 B
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
/**
* Base transport interface for MCP communication
*/
export abstract class BaseTransport {
protected server?: Server;
protected running = false;
/**
* Get the transport type
*/
abstract getType(): 'stdio' | 'http';
/**
* Check if the transport is running
*/
isRunning(): boolean {
return this.running;
}
/**
* Set the MCP server instance
*/
protected setServer(server: Server): void {
this.server = server;
}
/**
* Set the running state
*/
protected setRunning(running: boolean): void {
this.running = running;
}
/**
* Start the transport with the given server
*/
abstract start(server: Server): Promise<void>;
/**
* Stop the transport
*/
abstract stop(): Promise<void>;
}