Skip to main content
Glama

Civo MCP Server

disk-images.test.ts1.36 kB
import { listDiskImages, getDiskImage } from './disk-images.js'; import { CIVO_API_URL } from './civo.js'; jest.mock('./civo', () => ({ ...jest.requireActual('./civo'), checkRateLimit: jest.fn(), })); global.fetch = jest.fn(); describe('Disk Images API', () => { beforeEach(() => { (fetch as jest.Mock).mockClear(); }); it('should list disk images', async () => { const mockData = { items: [{ id: '1', name: 'test-image' }] }; (fetch as jest.Mock).mockResolvedValueOnce({ ok: true, json: () => Promise.resolve(mockData), }); const result = await listDiskImages({}); expect(fetch).toHaveBeenCalledWith( `${CIVO_API_URL}/disk_images`, expect.any(Object) ); expect(result).toEqual({ items: mockData }); }); it('should get a disk image', async () => { const mockData = { id: '1', name: 'test-image' }; (fetch as jest.Mock).mockResolvedValueOnce({ ok: true, json: () => Promise.resolve(mockData), }); const params = { id: '1', region: 'lon1' }; const result = await getDiskImage(params); const expectedUrl = new URL(`${CIVO_API_URL}/disk_images/1`); expectedUrl.searchParams.set('region', 'lon1'); expect(fetch).toHaveBeenCalledWith( expectedUrl.toString(), expect.any(Object) ); expect(result).toEqual(mockData); }); });

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/tao12345666333/civo-mcp'

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