Skip to main content
Glama
server.test.ts1.51 kB
import { describe, it, expect, vi, beforeEach } from "vitest"; import { CreatifyMcpServer } from "../src/server.js"; // Mock the Creatify client vi.mock("@tsavo/creatify-api-ts", () => ({ Creatify: vi.fn().mockImplementation(() => ({ avatar: { getAvatars: vi.fn().mockResolvedValue([ { id: "avatar1", name: "Test Avatar 1" }, { id: "avatar2", name: "Test Avatar 2" } ]), getVoices: vi.fn().mockResolvedValue([ { id: "voice1", name: "Test Voice 1", language: "en" }, { id: "voice2", name: "Test Voice 2", language: "en" } ]), createLipsync: vi.fn().mockResolvedValue({ id: "video123", status: "processing" }), getLipsync: vi.fn().mockResolvedValue({ id: "video123", status: "completed", video_url: "https://example.com/video.mp4" }) }, workspace: { getRemainingCredits: vi.fn().mockResolvedValue({ remaining_credits: 100 }) }, customTemplates: { getCustomTemplates: vi.fn().mockResolvedValue([ { id: "template1", name: "Test Template 1" } ]) } })) })); describe("CreatifyMcpServer", () => { let server: CreatifyMcpServer; beforeEach(() => { server = new CreatifyMcpServer("test-api-id", "test-api-key"); }); it("should create server instance", () => { expect(server).toBeInstanceOf(CreatifyMcpServer); }); it("should initialize with API credentials", () => { expect(server).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/TSavo/creatify-mcp'

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