Skip to main content
Glama

AI Code Toolkit

by AgiFlow
setup.ts978 B
import { beforeEach, vi } from 'vitest'; // Note: fs-extra mock is in tests/__mocks__/fs-extra.ts // Vitest will automatically use it when vi.mock('fs-extra') is called // Mock @modelcontextprotocol/sdk vi.mock('@modelcontextprotocol/sdk/server/index.js', () => { class MockServer { public name: string; public version: string; public requestHandlers: Map<any, Function>; constructor(info: any, _options?: any) { this.name = info.name; this.version = info.version; this.requestHandlers = new Map(); } setRequestHandler(schema: any, handler: Function) { this.requestHandlers.set(schema, handler); } connect = vi.fn(); } return { Server: MockServer, }; }); vi.mock('@modelcontextprotocol/sdk/types.js', () => ({ CallToolRequestSchema: {}, ListToolsRequestSchema: {}, ListPromptsRequestSchema: {}, GetPromptRequestSchema: {}, })); // Global test setup beforeEach(() => { vi.clearAllMocks(); });

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/AgiFlow/aicode-toolkit'

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