Skip to main content
Glama

Convex MCP server

Official
by get-convex
adminAuth.test.ts1.74 kB
import { ConvexHttpClient } from "convex/browser"; import { ConvexReactClient } from "convex/react"; import { opts } from "./test_helpers"; import { api } from "./convex/_generated/api"; import { adminKey, deploymentUrl } from "./common"; describe("auth acting as user", () => { test("http client", async () => { const httpClient = new ConvexHttpClient(deploymentUrl); httpClient.setAdminAuth(adminKey, { subject: "test subject", issuer: "test issuer", name: "Presley", }); const result = await httpClient.query(api.auth.q); expect(result?.name).toEqual("Presley"); }); test("react client", async () => { const reactClient = new ConvexReactClient(deploymentUrl, opts); reactClient.setAdminAuth(adminKey, { subject: "test subject", issuer: "test issuer", name: "Presley", }); const result = await reactClient.query(api.auth.q); expect(result?.name).toEqual("Presley"); await reactClient.close(); }); test("http client utf16", async () => { const httpClient = new ConvexHttpClient(deploymentUrl); httpClient.setAdminAuth(adminKey, { subject: "test subject", issuer: "test issuer", name: "Presley 🙃", }); const result = await httpClient.query(api.auth.q); expect(result?.name).toEqual("Presley 🙃"); }); test("react client utf16", async () => { const reactClient = new ConvexReactClient(deploymentUrl, opts); reactClient.setAdminAuth(adminKey, { subject: "test subject", issuer: "test issuer", name: "Presley 🙃", }); const result = await reactClient.query(api.auth.q); expect(result?.name).toEqual("Presley 🙃"); await reactClient.close(); }); });

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