# DB Mastermind

> DB Mastermind is an open-source MCP server for databases. Free open-source database client and data modeler, with read-only AI access for coding. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Windows, macOS, Linux, CLI, API
- **Website:** https://dbmastermind.app
- **Repository:** https://github.com/elh0m3r0/db-mastermind/tree/HEAD/packages/mcp
- **MCP Registry name:** io.github.eLh0m3r0/dbmastermind-mcp
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Design a schema, browse and filter tables without writing SQL, and chart query results from one desktop app. It connects to PostgreSQL, SQL Server, Oracle, MySQL, SQLite, DuckDB, BigQuery and several more engines, and can open CSV, Parquet and Excel files as if they were tables.

The same connections can be exposed to Claude Code, Codex, Cursor and other agents through an MCP server, which handles schema exploration, join paths and read-only queries. Queries from AI and agents run in a transaction that is rolled back, so the database itself blocks writes. AI is off until a provider is configured, and it can be disabled per connection or company-wide.

The tool suits developers generating ORM models from a live schema, analysts exploring data, and teams that need a shared data dictionary and migration checks before schema changes run. It is MIT-licensed and free, with no account or telemetry.

## Features

- **Schema design and migrations:** Draw tables and relationships, then generate DDL or a migration script that is checked against existing data first.
- **Filters without SQL:** Build nested AND/OR filters and more than 25 operators, or write a raw WHERE clause.
- **Query editor with schema awareness:** Autocomplete writes JOINs from foreign keys and warns about missing tables or UPDATE statements without WHERE.
- **Files as tables:** Drop CSV, Parquet, JSON or Excel files onto the window and query them with SQL.
- **Read-only safety defaults:** Read-only connections, a production guard and confirmation before destructive statements.
- **Read-only AI access for agents:** An MCP server lets coding agents explore schemas and run read-only queries through your existing connections.
- **Code generation from models:** Export Prisma, Drizzle, SQLAlchemy or TypeScript types from a model or a live database.

## Good for

- Explore an unfamiliar production database before writing application code
- Let a coding agent answer questions from live data without write access
- Generate ORM schemas from an existing database
- Compare a schema model with a live database and produce a migration
- Share a documented data dictionary with a team
- Query CSV or Excel exports with SQL and chart the results

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add dbmastermind-mcp -- npx -y dbmastermind-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

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

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "dbmastermind-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "dbmastermind-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add dbmastermind-mcp -- npx -y dbmastermind-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.dbmastermind-mcp]
command = "npx"
args = ["-y", "dbmastermind-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

Or run: gemini mcp add -s user dbmastermind-mcp npx -- -y dbmastermind-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

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

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

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

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "dbmastermind-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "dbmastermind-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

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

Use .kiro/settings/mcp.json to add it to one workspace only.

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

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

## Tools

From the tool list in its README, going by the names, 2 of 13 tools change data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `list_connections` (name suggests: reads): List configured database connections.
- `list_tables` (name suggests: reads): List tables in a connection.
- `describe_table` (name suggests: reads): Show columns, keys, indexes, comments and incoming references for a table.
- `search_schema` (name suggests: reads): Search the schema for names or terms.
- `get_relationships` (name suggests: reads): Show relationships between tables.
- `find_join_path` (name suggests: reads): Find the shortest join chain between two tables, with ready SQL.
- `sample_rows`: Return sample rows from a table.
- `run_query` (name suggests: changes): Run a read-only query and return results as compact CSV.
- `explain_query` (name suggests: reads): Return the execution plan of a query as a tree.
- `get_definition` (name suggests: reads): Return the SQL of a view, function, procedure or table CREATE statement.
- `search_knowledge` (name suggests: reads): Search the knowledge base of Markdown notes.
- `read_knowledge` (name suggests: reads): Read a knowledge base note.
- `write_knowledge` (name suggests: changes): Create or update a knowledge base note when writes are allowed.

## FAQ

### Is DB Mastermind free?

Yes. It is free and MIT-licensed, with no paid tier, no feature limits and no account.

### Which databases are supported?

PostgreSQL, SQL Server, Oracle, MySQL, MariaDB, SQLite, DuckDB, ClickHouse, CockroachDB, BigQuery and Trino, plus hosted services that run these engines.

### Can an AI agent change my data?

Not by default. Agent queries run in a read-only transaction that is rolled back. Writes require allowing them explicitly with --allow-writes.

### Does DB Mastermind send data anywhere?

The app has no telemetry. Its only own network access is the update check with GitHub. Passwords are stored encrypted in the system keychain.

### How do I add DB Mastermind to Claude Code?

Run this command in your terminal: claude mcp add dbmastermind-mcp -- npx -y dbmastermind-mcp

### What are the best alternatives to DB Mastermind?

The closest alternatives to DB Mastermind are DB MCP, DataLink, DBCode, AdoMcp and Custom MCP Database.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [DB MCP](https://ai-powered.com/mcp/db-mcp): DB MCP is an open-source MCP server for databases.
- [DataLink](https://ai-powered.com/mcp/datalink): DataLink is an open-source MCP server for databases.
- [DBCode](https://ai-powered.com/mcp/dbcode): DBCode is a freemium MCP server for databases.
- [AdoMcp](https://ai-powered.com/mcp/adomcp): AdoMcp is an open-source MCP server for databases.
- [Custom MCP Database](https://ai-powered.com/mcp/custom-mcp-database): Custom MCP Database is an open-source MCP server for databases.
- [JDBC MCP Server](https://ai-powered.com/mcp/jdbc-mcp-server): JDBC MCP Server is an open-source MCP server for databases.
- [Data Studio](https://ai-powered.com/mcp/data-studio): Data Studio is an open-source MCP server for databases.
- [Schemity](https://ai-powered.com/mcp/schemity): Schemity is a freemium MCP server for databases.

---
Source: https://ai-powered.com/mcp/db-mastermind
