Skip to main content
Glama

Convex MCP server

Official
by get-convex
imagesJS.js964 B
import { action, internalMutation, query } from "./_generated/server"; import { internal } from "./_generated/api"; import { v } from "convex/values"; export const generateAndStore = action({ args: { prompt: v.string() }, handler: async (ctx, args) => { // Not shown: generate imageUrl from `prompt` const imageUrl = "https://...."; // Download the image const response = await fetch(imageUrl); const image = await response.blob(); // Store the image in Convex const storageId = await ctx.storage.store(image); // Write `storageId` to a document await ctx.runMutation(internal.images.storeResult, { storageId, prompt: args.prompt, }); }, }); export const storeResult = internalMutation({ args: { storageId: v.id("_storage"), prompt: v.string(), }, handler: async (ctx, args) => { const { storageId, prompt } = args; await ctx.db.insert("images", { storageId, prompt }); }, });

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