Skip to main content
Glama

MCP Server Giphy

index.test.ts1.37 kB
import { main } from "./index.js"; import { server } from "./server.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; // Mock the server and StdioServerTransport jest.mock("./server.js", () => ({ server: { connect: jest.fn(), }, })); jest.mock("@modelcontextprotocol/sdk/server/stdio.js", () => ({ StdioServerTransport: jest.fn().mockImplementation(() => ({ // Mock implementation of StdioServerTransport })), })); // Mock console.error to avoid cluttering test output const originalConsoleError = console.error; beforeEach(() => { console.error = jest.fn(); }); afterEach(() => { console.error = originalConsoleError; }); describe("Index Module", () => { it("should connect the server with StdioServerTransport", async () => { // Call the main function await main(); // Check that a StdioServerTransport was created expect(StdioServerTransport).toHaveBeenCalled(); // Verify server.connect was called with the transport expect(server.connect).toHaveBeenCalled(); // Verify the console message was logged expect(console.error).toHaveBeenCalledWith("GIPHY MCP Server running..."); }); it("should handle process events", () => { // Check that process.on exists (simple check rather than trying to mock it) expect(typeof process.on).toBe("function"); }); });

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

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