Skip to main content
Glama

mcp-server-code-runner

index.ts636 B
import { startStdioMcpServer } from "./stdio.js"; import { startStreamableHttpMcpServer, McpServerEndpoint } from "./streamableHttp.js"; export type Transport = 'stdio' | 'http'; export interface HttpServerOptions { port?: number; } export async function startMcpServer(transport: Transport, options?: HttpServerOptions): Promise<void | McpServerEndpoint> { if (transport === 'stdio') { return startStdioMcpServer(); } else if (transport === 'http') { return startStreamableHttpMcpServer(options?.port); } else { throw new Error('Invalid transport. Must be either "stdio" or "http"'); } }

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/formulahendry/mcp-server-code-runner'

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