# DBCode — MCP server card for AI agents

Query and explore 100+ databases through your DBCode connections.

Registry name: `io.dbcode/dbcode` · category: Databases · version 1.0.1 · updated 2026-10-03

## Connect
- npm (stdio): `npx -y @dbcode/mcp`

## Facts
- Repository: https://github.com/dbcodeio/public (367 stars)
- Website: https://dbcode.io/docs/ai/mcp

Before you connect a server: read its repository, and give it only the permissions and keys it needs.

## Links
- AgentGid page: https://agentgid.com/mcp/servers/io-dbcode-dbcode/


## DBCode: your AI assistant queries your databases

DBCode is a database tool that lives inside VS Code, Cursor and similar editors. This server lets your AI assistant use the database connections you saved in DBCode, so it can list them, read the tables and run queries for you. It works with more than 100 kinds of databases.

### Where to use it
- Ask questions about your data: Ask in chat, for example how many orders came in last month, and the assistant writes and runs the query on your saved connection.
- Learn an unfamiliar database: Let the assistant find your connections, read every table and column, and explain how the main tables relate before it writes any query.
- Copy real rows into a test database: Pull a slice of production data into your development database to test against real shapes. Only row counts go back to the assistant, not the rows.
- Query MongoDB in its own language: On a MongoDB connection the assistant can send the same find or aggregate statements you would type yourself, or plain SQL.
- An assistant inside a Dev Container: Turn on DBCode's local web server on your computer and point an assistant that runs in a Dev Container or on another machine at it, with sign-in kept on.
- Check the data after a release: After a change ships, ask the assistant to run a few read-only checks on a staging copy, such as counting rows with empty required fields. (idea, not from the official pages)

### How to start
- Install the DBCode extension in your editor and save your database connections in it.
- Add the server to your assistant. In VS Code and Cursor the tools appear by themselves; in Claude Code or Codex add it with one command.

```
claude mcp add dbcode -- npx -y @dbcode/mcp
```

- Ask the assistant to read the schema first, then to answer your question.

### License
The server is free for everyone, including companies. The small launcher package is MIT, but DBCode itself is closed software you may use and not copy, change or pass on.

### Good to know
- Query results, with real values from your tables, go to your AI assistant and its model provider. Only connect databases whose data you are fine sharing.
- The assistant can change data and tables. Set the connection to read-only or to the Production role, which asks before changes and blocks drops.
- A separate, narrower role just for the assistant needs the paid Pro plan; the default role, the same as yours, is free.
- The package only starts the DBCode extension, where the tools live. Without the extension it stops with an error.
- Started outside the editor, copying data between connections is not available, and changes that would ask you first are refused unless your assistant can ask you.

Checked 2026-11-10 against: https://dbcode.io/docs/ai/mcp, https://dbcode.io/docs/cli/mcp, https://dbcode.io/docs/ai/copilot-tools, https://dbcode.io/docs/ai/privacy-and-security, https://dbcode.io/docs/connections/roles, https://dbcode.io/pricing, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/README.md, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/LICENSE, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/mcp/README.md, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/mcp/index.js, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/mcp/package.json, https://github.com/dbcodeio/public/blob/5d537882350d65f790959875068eff7751a51fe8/mcp/server.json, https://registry.npmjs.org/@dbcode/mcp, https://registry.npmjs.org/@dbcode/mcp/-/mcp-1.0.1.tgz

### Mistakes to avoid
- Don't: Asking "show me all records created last month" with no schema step → Do: First have the assistant read the tables and columns of the named database, then ask the question. (The assistant does not know your table names by itself and guesses.)
- Don't: Calling dbcode-copy-data into a table that does not exist yet → Do: Create the destination table first with dbcode-execute-ddl, and alias source columns to the destination column names. (The copy needs an existing table and maps columns by name.)
- Don't: npx -y @dbcode/mcp on a machine without the DBCode extension or with Node older than 22.14 → Do: Install DBCode in a supported editor and Node.js 22.14+, then restart the agent. (The launcher only finds and starts the installed extension and checks the Node version.)
- Don't: Turning on the local web server with authorization None and external connections allowed → Do: Keep OAuth on whenever allowExternalConnections is enabled for Dev Containers or other machines. (Without OAuth anyone on your network can run queries through it.)
- Don't: Looping copy calls over a huge table in one go → Do: Split the source query into key ranges and call it repeatedly with duplicates=skip. (Each call copies at most 1,000,000 source rows; skip makes re-runs safe to resume.)

### Questions
- Does it cost anything? No. The server is free for everyone. Only extras such as a separate, narrower role for the assistant need the paid Pro plan.
- Do I need to keep my editor open? No. With no editor open, the server reads your saved DBCode connections directly; a few features, such as copying data, then need the editor.
- Are my database passwords sent to the AI? No. DBCode says it never sends credentials, passwords, connection strings or server addresses; table names and query results are sent when the assistant asks.
- Can the assistant delete data? It can if the connection's role allows it. The Production role asks first for deletes and blocks dropping tables; read-only mode allows only reads.
- I use DBCode in two editors. Which connections does the assistant see? The newest installed DBCode is used; add --app with the editor name, such as Cursor, to choose.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
