Skip to main content
Glama

Convex MCP server

Official
by get-convex
convexImport.ts2.24 kB
import chalk from "chalk"; import { ensureHasConvexDependency } from "./lib/utils/utils.js"; import { oneoffContext } from "../bundler/context.js"; import { deploymentSelectionWithinProjectFromOptions, loadSelectedDeploymentCredentials, } from "./lib/api.js"; import { Command } from "@commander-js/extra-typings"; import { actionDescription } from "./lib/command.js"; import { deploymentDashboardUrlPage } from "./lib/dashboard.js"; import { importIntoDeployment } from "./lib/convexImport.js"; import { getDeploymentSelection } from "./lib/deploymentSelection.js"; export const convexImport = new Command("import") .summary("Import data from a file to your deployment") .description( "Import data from a file to your Convex deployment.\n\n" + " From a snapshot: `npx convex import snapshot.zip`\n" + " For a single table: `npx convex import --table tableName file.json`\n\n" + "By default, this imports into your dev deployment.", ) .allowExcessArguments(false) .addImportOptions() .addDeploymentSelectionOptions(actionDescription("Import data into")) .showHelpAfterError() .action(async (filePath, options) => { const ctx = await oneoffContext(options); await ensureHasConvexDependency(ctx, "import"); const selectionWithinProject = deploymentSelectionWithinProjectFromOptions(options); const deploymentSelection = await getDeploymentSelection(ctx, options); const deployment = await loadSelectedDeploymentCredentials( ctx, deploymentSelection, selectionWithinProject, ); const deploymentNotice = options.prod ? ` in your ${chalk.bold("prod")} deployment` : ""; await importIntoDeployment(ctx, filePath, { ...options, deploymentUrl: deployment.url, adminKey: deployment.adminKey, deploymentNotice, snapshotImportDashboardLink: snapshotImportDashboardLink( deployment.deploymentFields?.deploymentName ?? null, ), }); }); function snapshotImportDashboardLink(deploymentName: string | null) { return deploymentName === null ? "https://dashboard.convex.dev/deployment/settings/snapshots" : deploymentDashboardUrlPage(deploymentName, "/settings/snapshots"); }

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