We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { joinUrlPath } from "@common/lib/helpers/joinUrlPath";
describe("joinUrlPath", () => {
test("keeps path prefix when baseUrl ends with /", () => {
expect(
joinUrlPath(
"http://localhost/convex/",
"/api/check_admin_key",
).toString(),
).toBe("http://localhost/convex/api/check_admin_key");
});
test("keeps path prefix when baseUrl does not end with /", () => {
expect(
joinUrlPath("http://localhost/convex", "/api/check_admin_key").toString(),
).toBe("http://localhost/convex/api/check_admin_key");
});
test("accepts a path without a leading /", () => {
expect(
joinUrlPath("http://localhost/convex", "api/check_admin_key").toString(),
).toBe("http://localhost/convex/api/check_admin_key");
});
test("joins relative to the root when baseUrl has no prefix", () => {
expect(
joinUrlPath("http://localhost/", "/api/check_admin_key").toString(),
).toBe("http://localhost/api/check_admin_key");
});
test("joins relative to the root when baseUrl has no path", () => {
expect(
joinUrlPath("http://localhost", "/api/check_admin_key").toString(),
).toBe("http://localhost/api/check_admin_key");
});
test("preserves port and nested path prefixes", () => {
expect(
joinUrlPath(
"https://example.com:1234/abc/def/",
"/api/check_admin_key",
).toString(),
).toBe("https://example.com:1234/abc/def/api/check_admin_key");
});
});