DBCode — Claude Code MCP server: setup
DBCode lets an AI agent query and inspect databases through your existing DBCode connections. It fits database work across PostgreSQL, MySQL, MongoDB, and more.
claude mcp add dbcode -- npx -y @dbcode/mcpWhat DBCode does
This MCP server gives an AI agent access to the connections saved in DBCode. It can query and inspect databases such as PostgreSQL, MySQL, SQL Server, Oracle, SQLite, MongoDB, ClickHouse, and Snowflake. DBCode supports more than 100 databases.
The package finds the newest DBCode installation and starts its MCP server. With a DBCode editor open, the agent works through that editor; with no editor open, the server reads saved DBCode connections directly. If DBCode is open in more than one editor, pass --app to choose which editor’s connections the agent can use, such as Cursor.
Install the DBCode extension in VS Code, Cursor, Windsurf, Antigravity, or Kiro before configuring the server. Node.js 22.14 or newer is also required. The server will not start without Node.js 22.14.
What it helps with
- run queries against a connected database
- inspect a database schema through an AI agent
- work with PostgreSQL and other database systems through DBCode
- select connections from a specific editor
Example prompts for the agent
- Show the tables and relationships in the connected database.
- Run this query against PostgreSQL through DBCode and explain the result.
- Use the
Cursorconnections and find records matching this condition.
How to install DBCode
Platform CLI
claude mcp add dbcode -- npx -y @dbcode/mcpPlatform CLI
codex mcp add mcp -- npx -y @dbcode/mcpConfig file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@dbcode/mcp"
]
}
}
}Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dbcode/mcp"
]
}
}
}Platform CLI
gemini mcp add mcp npx -y @dbcode/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about DBCode
How do I install DBCode in Claude Code?
Run claude mcp add dbcode -- npx -y @dbcode/mcp.
What does DBCode do?
It connects an AI agent to saved DBCode connections so the agent can query and inspect databases through an MCP server.
How can I choose which editor connections the agent uses?
Pass the --app argument to the server, for example "args": ["-y", "@dbcode/mcp", "--app", "Cursor"]. Accepted values include Code, Code - Insiders, Cursor, Windsurf, VSCodium, Antigravity IDE, Antigravity, and Kiro.