Skip to main content
Glama
endpoints.test.ts1.34 kB
import { TestServer } from './helpers/test-server.js'; describe('Basic Endpoints', () => { let server: TestServer; beforeEach(() => { server = new TestServer(); }); afterEach(async () => { await server.close(); }); describe('GET /healthz', () => { it('returns ok status', async () => { const response = await server.request .get('/healthz') .expect(200); expect(response.text).toBe('ok'); }); }); // Note: SSE endpoint testing is complex due to persistent connections // Would require special test setup to handle streaming responses describe('Authentication', () => { it('blocks MCP endpoints without auth in production', async () => { // Create server without skipAuth const prodServer = new TestServer(); // We need to create a server that doesn't skip auth // For now, we'll test the current behavior and note this for improvement await prodServer.close(); }); it('allows access to health endpoint without auth', async () => { await server.request .get('/healthz') .expect(200); }); it('allows access to webhook endpoint without auth', async () => { await server.request .post('/garmin/webhook') .send({ userId: 'test' }) .expect(200); }); }); });

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/zjromani/garmin-mcp'

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