Skip to main content
Glama

Convex MCP server

Official
by get-convex
components.ts1.19 kB
import { queryPrivateSystem } from "../secretSystemTables"; import { Doc, Id } from "../../_generated/dataModel"; export const list = queryPrivateSystem({ args: {}, handler: async function ({ db }) { const componentDocs = await db.query("_components").collect(); const idToDoc = new Map<Id<"_components">, Doc<"_components">>( componentDocs.map((doc) => [doc._id, doc]), ); const idToPath = new Map<string, string>(); function computeIdToPath(doc: Doc<"_components">): string { if (idToPath.has(doc._id)) { return idToPath.get(doc._id)!; } let path = ""; if (!doc.parent) { // Root component path = ""; } else { const parentPath = computeIdToPath(idToDoc.get(doc.parent)!); if (parentPath.length === 0) { path = doc.name!; } else { path = `${parentPath}/${doc.name!}`; } } idToPath.set(doc._id, path); return path; } return componentDocs.map((doc) => ({ id: doc._id, name: doc.name, path: computeIdToPath(doc), args: Object.fromEntries(doc.args ?? []), state: doc.state ?? "active", })); }, });

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