# Bytebase

> Bytebase is an open-source MCP server for databases. Lets AI assistants query and change databases through Bytebase's approvals and audit log. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, macOS, Linux, Self-hosted
- **Website:** https://docs.bytebase.com/integrations/mcp
- **Repository:** https://github.com/bytebase/bytebase-mcp
- **MCP Registry name:** io.github.bytebase/bytebase-mcp
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-27

## About

Bytebase MCP connects an AI assistant to a running Bytebase instance, so schema reads, queries and proposed database changes go through the same projects, approval rules, masking and audit trail that a team already uses in the console. The npm package itself holds no Bytebase logic; after OAuth sign-in it lists the tools the instance serves and forwards each call to it, so what the assistant can do is limited by the workspace access policy and the signed-in account's permissions.

The assistant can run read-only queries, export results, propose schema or data changes that become plans and issues, and request time-boxed access grants for a single read statement. Mode settings set the ceiling: Read-only blocks any statement Bytebase cannot confirm as a read, while Read-write also allows changes. Sensitive actions such as masking exemptions and new approval rules wait for confirmation in the client before they are made.

It suits database administrators and engineering teams who want AI help with queries and migrations without giving up review and traceability. It needs a Bytebase Cloud or self-hosted instance with an external URL configured; query results are capped at 1,000 rows and requests at 4 MiB.

## Features

- **Governed query access:** Run read-only queries and schema inspection, with masked columns returned masked for the signed-in user.
- **Proposed database changes:** Turn a requested change into a sheet, plan and issue that follow the project's approval flow.
- **Just-in-time access grants:** Request a time-boxed grant to run one read statement, which starts only once approved.
- **Access policy modes:** Admins choose Read-only or Read-write for the workspace, capping what the assistant may do.
- **Confirmation before sensitive actions:** Masking exemptions, instance additions and rule changes are confirmed in the client first where supported.
- **Audit logging:** MCP calls, including refused ones, are recorded in Bytebase's audit log and can be filtered.

## Good for

- Let an assistant explore a production schema and answer data questions with masked results
- Draft a migration in chat and route it through the project's review and rollout process
- Request a one-off read grant for a specific statement without widening standing access
- Approve or reject pending database change issues from an AI client after confirmation
- Give an AI coding assistant safe, audited database access for a team

## Install

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

```sh
claude mcp add bytebase-mcp --env BYTEBASE_URL='<BYTEBASE_URL>' -- npx -y @bytebase/bytebase-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": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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 bytebase-mcp --env BYTEBASE_URL='<BYTEBASE_URL>' -- npx -y @bytebase/bytebase-mcp
```

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

```toml
[mcp_servers.bytebase-mcp]
command = "npx"
args = ["-y", "@bytebase/bytebase-mcp"]
env = { BYTEBASE_URL = "<BYTEBASE_URL>" }
```

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e BYTEBASE_URL='<BYTEBASE_URL>' bytebase-mcp npx -- -y @bytebase/bytebase-mcp

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

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": {
    "bytebase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/bytebase-mcp"
      ],
      "env": {
        "BYTEBASE_URL": "<BYTEBASE_URL>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 13 tools deletes data and 1 changes data; 7 names don't say. From the server's own tool labels and tool names; not verified by us.

- `administer_workspace`: Make a workspace administration change that the user confirms in this client first.
- `call_api`: Execute a Bytebase API endpoint.
- `decide_issue`: Approve or reject a Bytebase issue at its current approval step.
- `get_gitops_workflow` (name suggests: reads): Return the workflow files that set up GitOps for a project.
- `get_schema` (name suggests: reads): Inspect a Bytebase database's schema.
- `grant_masking_exemption`: Exempt one member from data masking in a Bytebase project.
- `propose_database_change`: Run DDL/DML changes against a Bytebase database as a proposed issue.
- `query_database` (name suggests: reads): Execute a SQL query against a Bytebase database.
- `reauthorize`: Log out the current MCP OAuth connection so the client can run OAuth again.
- `request_access_grant`: Request a time-boxed grant to run one read-only statement on one database.
- `revoke_masking_exemption` (name suggests: deletes): Remove one member's masking exemption in a Bytebase project.
- `search_api` (name suggests: reads): Discover Bytebase API endpoints.
- `set_just_in_time_access` (name suggests: changes): Turn just-in-time access on or off for one Bytebase project.

## FAQ

### Does the npm package need a Bytebase instance?

Yes. It connects to a running Bytebase Cloud or self-hosted instance (version 3.22 or later) through its external URL and does nothing without one.

### Which database engines are supported for changes?

The query tool runs INSERT, UPDATE, DELETE, CREATE, ALTER and DROP on MySQL, PostgreSQL, Oracle, SQL Server, TiDB, Snowflake, Spanner, BigQuery, MongoDB and Elasticsearch, within the user's permissions.

### How is access to the instance authenticated?

The package signs in through Bytebase's own OAuth in the browser and never sees the user's password. The token is stored under ~/.bytebase-mcp with owner-only permissions.

### What limits apply to query results?

Queries return 100 rows by default and 1,000 at most, with a 30-second timeout. Requests over 4 MiB are refused.

### Which operating systems are supported by the package?

It is tested on macOS and Linux; Windows has not been tested yet.

### Is Bytebase free?

Yes. Bytebase is open source, so you can use and self-host it for free.

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

Run this command in your terminal: claude mcp add bytebase-mcp --env BYTEBASE_URL='<BYTEBASE_URL>' -- npx -y @bytebase/bytebase-mcp

### What are the best alternatives to Bytebase?

The closest alternatives to Bytebase are Airtable MCP, Metabase Ai Assistant, Baserow, mcpbus and Db Planner.

## 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

- [Airtable MCP](https://ai-powered.com/mcp/airtable-mcp-2): Airtable MCP is an open-source MCP server for databases.
- [Metabase Ai Assistant](https://ai-powered.com/mcp/metabase-ai-assistant): Metabase Ai Assistant is an open-source MCP server for analytics and data.
- [Baserow](https://ai-powered.com/mcp/baserow): Baserow is a freemium MCP server for databases.
- [mcpbus](https://ai-powered.com/mcp/mcpbus): mcpbus is an MCP server for databases.
- [Db Planner](https://ai-powered.com/mcp/db-planner): Db Planner is a free MCP server for databases.
- [Database MCP](https://ai-powered.com/mcp/database-mcp): Database MCP is an open-source MCP server for databases.
- [Baserow Schema MCP](https://ai-powered.com/mcp/baserow-schema-mcp): Baserow Schema MCP is an open-source MCP server for databases.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.

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