Skip to main content
Glama
mcp-server.test.ts1.16 kB
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { createLiaraClient } from '../../api/client.js'; describe('MCP Server Integration', () => { const originalEnv = process.env.LIARA_API_TOKEN; beforeEach(() => { vi.clearAllMocks(); }); afterEach(() => { if (originalEnv) { process.env.LIARA_API_TOKEN = originalEnv; } else { delete process.env.LIARA_API_TOKEN; } }); describe('Tool Registration', () => { it('should register all list tools with pagination support', async () => { // This would require importing and testing the actual server class // For now, we verify the structure exists expect(true).toBe(true); // Placeholder - would need actual server instance }); }); describe('Error Handling', () => { it('should handle missing API token gracefully', () => { delete process.env.LIARA_API_TOKEN; expect(() => { createLiaraClient(); }).toThrow('LIARA_API_TOKEN environment variable is required'); }); }); });

Latest Blog Posts

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/razavioo/liara-mcp'

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