Skip to main content
Glama

SearXNG Server

mock-server.ts1.42 kB
/** * Mock Server Helper * * Creates mock MCP server objects for testing */ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; export interface MockServer { notification: (method: string, params: any) => Promise<void>; _serverInfo: { name: string; version: string }; _capabilities: Record<string, any>; connect?: (transport: any) => Promise<void>; } /** * Create a minimal mock server for testing */ export function createMockServer(overrides?: Partial<MockServer>): MockServer { const mockNotificationCalls: any[] = []; return { notification: async (method: string, params: any) => { mockNotificationCalls.push({ method, params }); }, _serverInfo: { name: 'test', version: '1.0' }, _capabilities: {}, connect: async () => Promise.resolve(), ...overrides }; } /** * Create a mock server that tracks notification calls */ export function createMockServerWithTracking(): { server: MockServer; getNotificationCalls: () => any[]; } { const mockNotificationCalls: any[] = []; const server: MockServer = { notification: async (method: string, params: any) => { mockNotificationCalls.push({ method, params }); }, _serverInfo: { name: 'test', version: '1.0' }, _capabilities: {}, connect: async () => Promise.resolve(), }; return { server, getNotificationCalls: () => mockNotificationCalls }; }

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/ihor-sokoliuk/mcp-searxng'

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