Skip to main content
Glama

Git MCP Server

index.test.ts1.39 kB
import type { FastifyInstance, LightMyRequestResponse } from "fastify"; import { afterEach, describe, expect, it } from "vitest"; import { createApp } from "../src/index.ts"; const instances: FastifyInstance[] = []; type HealthPayload = { status: string; allowedRoots: string[]; }; function isHealthPayload(value: unknown): value is HealthPayload { if (typeof value !== "object" || value === null) { return false; } const candidate = value as Record<string, unknown>; return ( typeof candidate.status === "string" && Array.isArray(candidate.allowedRoots) && candidate.allowedRoots.every((item) => typeof item === "string") ); } afterEach(async () => { while (instances.length > 0) { const instance: FastifyInstance | undefined = instances.pop(); if (instance) { await instance.close(); } } }); describe("mcp-git", () => { it("exposes health endpoint", async () => { const app: FastifyInstance = createApp(); instances.push(app); const response: LightMyRequestResponse = await app.inject({ method: "GET", url: "/health" }); expect(response.statusCode).toBe(200); const payload: unknown = response.json(); if (!isHealthPayload(payload)) { throw new Error("Unexpected payload shape"); } expect(payload.status).toBe("ok"); expect(Array.isArray(payload.allowedRoots)).toBe(true); }); });

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/yevheniikravchuk/git-mcp'

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