About DBCode
The DBCode MCP server lets AI agents query and explore databases using connections already configured in DBCode. It supports over 100 databases, including PostgreSQL, MySQL, SQL Server, SQLite, MongoDB and Snowflake, and is aimed at developers working in VS Code-based editors.
Key features
- 01Reuses saved DBCode database connections
- 02Supports over 100 database types
- 03Selects which editor's connections to expose
- 04Reads saved connections when no editor is open
Use cases
- 01Letting an agent query PostgreSQL or MySQL databases
- 02Exploring database schemas from Claude Code or Codex
- 03Choosing an editor's connections with the --app option
MCP support
This is an MCP server started with npx @dbcode/mcp. It exposes database access to MCP clients such as Claude Code, Codex and Gemini CLI.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDBCode MCP server
Let your AI agent query your databases through DBCode, using the connections you already have in DBCode.
DBCode works with 100+ databases, including PostgreSQL, MySQL, SQL Server, Oracle, SQLite, MongoDB, ClickHouse and Snowflake.
Requirements
- The DBCode extension, installed in VS Code, Cursor, Windsurf, Antigravity or Kiro. Install DBCode.
- Node.js 22.14 or newer.
Setup
Claude Code
claude mcp add dbcode -- npx -y @dbcode/mcp
Codex
codex mcp add dbcode -- npx -y @dbcode/mcp
GitHub Copilot CLI
Add this to ~/.copilot/mcp-config.json:
{
"mcpServers": {
"dbcode": {
"type": "local",
"command": "npx",
"args": ["-y", "@dbcode/mcp"],
"tools": ["*"]
}
}
}
Gemini CLI, Claude Desktop, Cursor, Windsurf and other clients
Add this to the client's MCP configuration (for Gemini CLI, ~/.gemini/settings.json; for Claude Desktop, claude_desktop_config.json):
{
"mcpServers": {
"dbcode": {
"command": "npx",
"args": ["-y", "@dbcode/mcp"]
}
}
}
Cursor, VS Code, Windsurf, Antigravity and Kiro can also connect DBCode to their built-in agent without this package. See DBCode's MCP docs.
How it works
The package finds the newest DBCode installed on your machine and starts its MCP server. When an editor with DBCode is open, the agent works through it. With no editor open, the server reads your saved DBCode connections directly.
If you use DBCode in more than one editor, choose which editor's connections the agent sees with --app:
"args": ["-y", "@dbcode/mcp", "--app", "Cursor"]
Values (not case-sensitive): Code, Code - Insiders, Cursor, Windsurf, VSCodium, Antigravity IDE, Antigravity, Kiro.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.