Gene Library Courses Download Pricing Contact Sign in
convex logo
databases Official Website

Convex MCP Server – Data and Function Tools

Convex's official MCP server gives AI coding agents structured access to a Convex deployment through the Convex CLI. Use it to inspect schemas and data, run deployed functions, review logs and health insights, execute read-only queries, and manage environment variables during development.

#realtime-database#serverless-functions#developer-tools

Overview

Convex's official MCP server is built into the Convex CLI and connects
compatible AI coding agents to one or more Convex projects. It exposes
structured tools for working with live deployment state, allowing an agent to
inspect data, functions, logs, and environment configuration without relying
only on copied dashboard output or static model knowledge.

What the MCP server enables

The available tools cover deployment discovery, database inspection, function
execution, health analysis, and environment variables. Depending on the
selected deployment and enabled tools, an AI agent can:

  • Discover available Convex deployments and select a deployment for later calls.
  • List tables with declared and inferred schemas.
  • Page through documents in a selected table.
  • Run sandboxed read-only JavaScript queries against deployment data.
  • Inspect deployed function metadata, visibility, types, and interfaces.
  • Execute deployed Convex functions with supplied arguments.
  • Retrieve recent structured function execution logs.
  • Review health insights from the previous 72 hours, including concurrency
    conflicts and resource-limit issues.
  • List, retrieve, set, and remove deployment environment variables.

When to use it

Use Convex MCP when an AI coding agent needs live Convex project context during
development or debugging. Typical workflows include understanding an unfamiliar
schema, inspecting sample documents, checking a function signature, running a
query, reproducing a failing function call, reviewing logs, diagnosing
performance issues, and updating development environment variables.

Connection and authentication

The official server runs locally over stdio with
npx -y convex@latest mcp start. By default, the server can work across
multiple projects and each tool call identifies the project directory. A single
project can be fixed with --project-dir.

Deployment selection follows Convex project configuration. The development
deployment is used by default. Preview and named deployments can be selected
with documented command-line options. Authentication is inherited from the
local Convex CLI and project environment configuration rather than a separate
MCP-specific API key.

Key considerations

Production deployment access is disabled by default. It can only be enabled
with --dangerously-enable-production-deployments, and --prod also requires
that safety flag. Once enabled, tools can read and modify production data, so
use extreme caution. Individual tools can be disabled with --disable-tools
to reduce risk. Environment-variable tools may expose sensitive values, and the
run tool can invoke functions with side effects. Prefer development or preview
deployments, use the narrowest tool set possible, and require human approval
before writes or production access.

Supported Transports

stdio

Command: npx

Args:

  • -y
  • convex@latest
  • mcp
  • start

Frequently Asked Questions

When should an AI agent use the Convex MCP server?
Use it when a coding workflow needs live Convex deployment context, such as inspecting schemas and documents, checking deployed functions, running read-only queries, reviewing logs and health insights, or managing development environment variables.
What does the Convex MCP server add to an AI agent's capabilities?
It gives the agent structured access to current Convex deployments, tables, data, function metadata, function execution, logs, insights, and environment variables instead of relying only on static model knowledge or manually copied dashboard information.
What can an AI agent access or manage through Convex MCP?
Depending on enabled tools, the agent can discover deployments, inspect tables and schemas, page through documents, run sandboxed read-only queries, inspect and execute deployed functions, retrieve logs and health insights, and list, read, set, or remove environment variables.
How is authentication configured for the Convex MCP server?
The server runs through the local Convex CLI and uses the project's existing Convex authentication and deployment configuration. No separate MCP-specific API key or header is required in the standard stdio configuration.
Which transport should be used for the Convex MCP server?
Use stdio with the official Convex CLI command `npx -y convex@latest mcp start`. Convex's official documentation does not require a hosted Streamable HTTP or SSE endpoint for this server.