# Convex (MCP Server)

> Let agents inspect Convex tables, run functions, read logs and manage env vars

- Type: MCP server
- Publisher: Convex (official)
- Categories: Development
- Website: https://docs.convex.dev/ai/convex-mcp-server
- Source: https://github.com/get-convex/convex-backend
- Transport: stdio
- Launch command: npx -y convex@latest mcp start
- Sign-in: api-key
- Environment variables: CONVEX_DEPLOY_KEY
- Listed: 2025-03-01

## About

The Convex MCP server ships with the Convex CLI and lets coding agents inspect deployment status, table schemas and data, run read-only queries, call functions, read logs and manage environment variables. It runs locally with npx and uses your Convex login, or a deploy key to restrict it to a single deployment. Production access is limited unless explicitly enabled with flags.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add convex --env CONVEX_DEPLOY_KEY=YOUR_CONVEX_DEPLOY_KEY -- npx -y convex@latest mcp start
   ```

   config.toml:

   ```toml
   [mcp_servers.convex]
   command = "npx"
   args = ["-y", "convex@latest", "mcp", "start"]
   
   [mcp_servers.convex.env]
   CONVEX_DEPLOY_KEY = "YOUR_CONVEX_DEPLOY_KEY"
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Convex",
       params={"command": "npx", "args": ["-y", "convex@latest", "mcp", "start"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "What tables does my dev deployment have and what's in messages?")
       print(result.final_output)
   ```

## Tools

- `status`
- `tables`
- `data`
- `runOneoffQuery`
- `functionSpec`
- `run`
- `logs`
- `insights`
- `envList`
- `envGet`
- `envSet`
- `envRemove`

## Example prompts

- "What tables does my dev deployment have and what's in messages?"
- "Run the listTasks query and show the results"
- "Show the latest function logs with errors"
- "Set the OPENAI_API_KEY environment variable on my dev deployment"

## Also available as

- app: [Convex](https://chatgptplugins.directory/apps/convex.md)

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent

---
Source: https://chatgptplugins.directory/mcp/convex · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
