Skip to main content
Glama
main-app.test.ts1.09 kB
// Mock the agents library FIRST before any imports jest.mock("agents/mcp", () => ({ McpAgent: class MockMcpAgent { server = { tool: jest.fn(), registerTool: jest.fn(), }; env = {}; async init() {} static serve = jest.fn().mockReturnValue({ fetch: jest.fn(), }); static serveSSE = jest.fn().mockReturnValue({ fetch: jest.fn(), }); }, })); // Mock the github-activity resource to avoid ESM import issues jest.mock("../resources/github-activity", () => ({ registerGitHubActivityResource: jest.fn(), })); import { DuyetMCP } from "../index"; // Mock registerAllTools jest.mock("../tools/index", () => ({ registerAllTools: jest.fn(), })); describe("Main Application Tests", () => { describe("DuyetMCP Class", () => { test("should have DuyetMCP constructor", () => { // Test that the class exists and can be referenced expect(DuyetMCP).toBeDefined(); expect(typeof DuyetMCP).toBe("function"); }); test("should have static serve methods", () => { expect(DuyetMCP.serve).toBeDefined(); expect(DuyetMCP.serveSSE).toBeDefined(); }); }); });

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/duyet/duyet-mcp-server'

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