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
joinUrlPath.ts•488 B
export function joinUrlPath(baseUrl: string, path: string): URL {
// `new URL("/api/...", base)` discards any path prefix in `base`.
// Also note: `new URL("./def", "https://a.com/abc")` => `/def` because `abc`
// is treated like a file; ensure the base pathname ends with `/`.
const base = new URL(baseUrl);
if (!base.pathname.endsWith("/")) {
base.pathname = `${base.pathname}/`;
}
const relativePath = path.replace(/^\//, "");
return new URL(relativePath, base);
}