# DBCode

> DBCode is a freemium MCP server for databases. Let AI agents list connections, read schemas and query 100+ databases through DBCode. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** vscode, CLI
- **Website:** https://dbcode.io/docs/ai/mcp
- **Repository:** https://github.com/dbcodeio/public/tree/HEAD/mcp
- **MCP Registry name:** io.dbcode/dbcode
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-16

## About

This server reuses the database connections already saved in the DBCode editor extension instead of asking for credentials again. An agent can list connections, read schemas and run queries; the site names PostgreSQL, MySQL, SQL Server, Oracle, SQLite, MongoDB, ClickHouse and Snowflake among 100+ supported databases.

In VS Code and Cursor the extension registers itself with the editor's MCP host, with one-click setup in Antigravity, Windsurf and Kiro. Outside editors, Claude Code, Codex, Copilot CLI, Gemini CLI and Claude Desktop use the npx package @dbcode/mcp, which needs Node 22.14 or newer. A --app option picks which editor's connections to use.

Access is bounded by each connection's role and read-only mode, and missing-WHERE detection catches destructive queries. The default AI access setting asks before changing data or schema, while AI access roles need DBCode Pro. The MCP server itself is free.

## Features

- **Reuses connections:** Works from the connections you already saved in DBCode.
- **Schema and queries:** Agents list connections, read schemas and run queries.
- **Editor auto-registration:** VS Code and Cursor register it with no config.
- **CLI for external agents:** npx @dbcode/mcp serves Claude, Codex, Copilot CLI and Gemini CLI.
- **Guardrails:** Roles, read-only mode, missing WHERE detection and ask-before-changes.
- **Multi-editor choice:** Pick whose connections to use with --app.

## Good for

- Ask an agent about a table's schema in your Postgres database
- Run exploratory queries from chat
- Give Claude Code read-only access to a staging database
- Reuse editor connections across several agents

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "dbcode": {
      "command": "npx",
      "args": [
        "-y",
        "@dbcode/mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "dbcode": {
      "command": "npx",
      "args": [
        "-y",
        "@dbcode/mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "dbcode": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@dbcode/mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "dbcode": {
      "command": "npx",
      "args": [
        "-y",
        "@dbcode/mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "dbcode": {
      "command": "npx",
      "args": [
        "-y",
        "@dbcode/mcp"
      ]
    }
  }
}
```

## FAQ

### Is the MCP server free?

Yes, the site says it is free for everyone.

### What do I need installed?

The DBCode extension in a supported editor and Node.js 22.14 or newer for the npm package.

### Can an agent change my data?

By default it asks before changes; read-only connections and roles can restrict it further.

### Is DBCode free?

DBCode has a free plan, with paid plans for more usage or features.

### How do I add DBCode to Claude Code?

Run this command in your terminal: claude mcp add dbcode -- npx -y @dbcode/mcp

### What are the best alternatives to DBCode?

The closest alternatives to DBCode are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/dbcode
