Convex MCP Server

Inspect and operate a Convex deployment: tables, documents, functions, logs and environment variables

Official · Convex TypeScript Local · stdio DatabasesDeveloper tools

109 popularity score ★ 13k ↓ 2.6M/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add convex -- npx -y convex@latest mcp start
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "convex": {
      "command": "npx",
      "args": [
        "-y",
        "convex@latest",
        "mcp",
        "start"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "convex": {
      "command": "npx",
      "args": [
        "-y",
        "convex@latest",
        "mcp",
        "start"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "convex": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "convex@latest",
        "mcp",
        "start"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.convex]
command = "npx"
args = ["-y", "convex@latest", "mcp", "start"]
Gemini CLITerminal
gemini mcp add --scope user convex npx -- -y convex@latest mcp start

Settings 1

CONVEX_DEPLOY_KEY Optional: Deploy key that limits the server to one deployment; without it the server uses the account from `npx convex login`.

What it does

The Convex MCP server is part of the Convex command-line tool and starts with `convex mcp start`. Its code lives in the npm-packages/convex folder of the open-source Convex backend repository, which also holds the database engine itself. It talks to a Convex deployment, cloud or self-hosted, and gives an assistant twelve tools for working with it while building an app.

The `status` tool comes first: it finds the deployments for a project folder and returns a selector the other tools take. With that, an assistant can list tables with their declared and inferred schemas, page through a table's documents, run a read-only JavaScript query in a sandbox, read the specs of deployed functions and call them, pull recent function logs, look at 72 hours of health insights (write conflicts, read limits), and list, read, set or remove deployment environment variables.

By default it works on the project's development deployment. Flags pick another one (`--prod`, `--preview-name`, `--deployment-name`, `--env-file`), change the project folder (`--project-dir`), or switch off tools (`--disable-tools`). In the source, `data` returns 100 documents per page by default, up to 1000 with `limit`, and `logs` trims its answer to about 20000 tokens by default (`tokensLimit`) (npm-packages/convex/src/cli/lib/mcp/tools/data.ts and logs.ts).

What it needs

RuntimeNode.js

Node.js with npx, a Convex project and either a signed-in Convex CLI (`npx convex login`) or a deploy key in CONVEX_DEPLOY_KEY. For a self-hosted backend, an env file holding CONVEX_SELF_HOSTED_URL passed with `--env-file`. The client should start it from the project folder or be given `--project-dir`.

Limits

Production deployments are limited by default: only insights, tables and functionSpec work there; data, logs and runOneoffQuery need `--cautiously-allow-production-pii`, and env reads plus run, envSet and envRemove need `--dangerously-enable-production-deployments`. `--project-dir` does not stop an assistant from naming another project folder or deployment. The insights tool does not work when started with CONVEX_DEPLOY_KEY. runOneoffQuery cannot change data. There are no tools to deploy code, edit the schema or write documents directly; writes go through deployed functions via run.

Who it suits

Suits developers building on Convex who want an assistant to see their real schema, data, function signatures and logs while it writes code, mostly against a dev deployment. Teams that need a hard boundary should start it with a scoped deploy key and `--disable-tools`, since with a plain CLI login it can reach every project the account can. It is of no use without a Convex deployment. To expose your own app's data to your users' assistants, Convex's separate MCP component (get-convex/mcp) is the tool for that, not this server.

Tools 12

status
Finds the project's deployments and returns a selector for the other tools
tables
Lists tables with declared and inferred schemas
data
Pages through documents in one table, 100 per page by default
runOneoffQuery
Runs a read-only JavaScript query against the deployment in a sandbox
functionSpec
Shows the type, visibility and arguments of deployed functions
run
Calls a deployed function with given arguments
logs
Fetches recent function execution logs, filterable by outcome
insights
Reports write conflicts and read-limit problems from the last 72 hours
envList
Lists the deployment's environment variables
envGet
Reads one environment variable's value
envSet
Creates or updates an environment variable
envRemove
Deletes an environment variable

Similar servers