Skip to main content
Glama

Convex MCP server

Official
by get-convex
client.ts1.54 kB
import createClient from "openapi-fetch"; import type { paths as ConvexManagementPaths } from "./generatedManagementApi.js"; import type { paths as ConvexDeploymentPaths } from "./generatedDeploymentApi.js"; import { version } from "./version.js"; export const productionProvisionHost = "https://api.convex.dev"; export const provisionHost = (globalThis as any)?.process?.env?.CONVEX_PROVISION_HOST || productionProvisionHost; export type ConvexAuth = { kind: "accessToken"; accessToken: string; }; export function createManagementClient(accessToken: string) { const baseUrl = `${provisionHost}/v1`; const auth = { kind: "accessToken", accessToken, }; const headers: Record<string, string> = { // Yep, even API keys go use Bearer. Everyone else does it. Authorization: `Bearer ${auth.accessToken}`, "Convex-Client": `convex-platform-${version}`, }; const client = createClient<ConvexManagementPaths>({ baseUrl, headers, }); return client; } export function createDeploymentClient(nameOrUrl: string, token: string) { const deploymentUrl = nameOrUrl.startsWith("http") ? nameOrUrl : `https://${nameOrUrl}.convex.cloud`; const baseUrl = `${deploymentUrl}/api/v1`; const headers: Record<string, string> = { // Yep, even API keys go use Bearer. Everyone else does it. Authorization: `Convex ${token}`, "Convex-Client": `convex-platform-${version}`, }; const client = createClient<ConvexDeploymentPaths>({ baseUrl, headers, }); return client; }

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/get-convex/convex-backend'

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