Skip to main content
Glama

MCP Test Server

by zgh2hh
server.ts1.03 kB
import { MCPServer, MCPServerOptions } from '@browsermcp/mcp'; export interface ServerConfig { port: number; host: string; debug?: boolean; } export class TestMCPServer { private server: MCPServer; private config: ServerConfig; constructor(config: ServerConfig) { this.config = config; const options: MCPServerOptions = { port: config.port, host: config.host }; this.server = new MCPServer(options); } async start(): Promise<void> { try { await this.server.start(); if (this.config.debug) { console.log(`MCP Server started on ${this.config.host}:${this.config.port}`); } } catch (error) { console.error('Failed to start MCP server:', error); throw error; } } async stop(): Promise<void> { try { await this.server.stop(); if (this.config.debug) { console.log('MCP Server stopped'); } } catch (error) { console.error('Failed to stop MCP server:', error); throw error; } } }

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/zgh2hh/mcp-test'

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