Skip to main content
Glama

Convex MCP server

Official
by get-convex
useSourceCode.ts800 B
import useSWR, { BareFetcher } from "swr"; import { useNents } from "@common/lib/useNents"; import { deploymentAuthMiddleware, useDeploymentIsDisconnected, } from "@common/lib/deploymentApi"; import { deploymentFetch } from "@common/lib/fetching"; export function useSourceCode(path: string) { const { selectedNent } = useNents(); const componentQuery = selectedNent ? `&component=${selectedNent.id}` : ""; const isDisconnected = useDeploymentIsDisconnected(); const fetcher: BareFetcher = deploymentFetch; const { data, error } = useSWR( isDisconnected ? null : `/api/get_source_code?path=${path}${componentQuery}`, fetcher, { use: [deploymentAuthMiddleware], }, ); if (error) { throw error; } return data as string | null | undefined; }

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