Skip to main content
Glama

Convex MCP server

Official
by get-convex
jwt-api.ts1.11 kB
import { createClient } from "@openauthjs/openauth/client"; import { subjects } from "./subjects"; const headers = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "*", "Access-Control-Allow-Methods": "*", }; const client = createClient({ clientID: "jwt-api", issuer: "http://localhost:3000", }); const server = Bun.serve({ port: 3001, async fetch(req) { const url = new URL(req.url); if (req.method === "OPTIONS") { return new Response(null, { headers }); } if (url.pathname === "/" && req.method === "GET") { const authHeader = req.headers.get("Authorization"); if (!authHeader) { return new Response("401", { headers, status: 401 }); } const token = authHeader.split(" ")[1]; const verified = await client.verify(subjects, token); if (verified.err) { return new Response("401", { headers, status: 401 }); } return new Response(verified.subject.properties.id, { headers }); } return new Response("404", { status: 404 }); }, }); console.log(`Listening on ${server.url}`);

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