bytebase-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bytebase-mcpwhat databases are available in production?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bytebase-mcp
MCP server for Bytebase — SQL Editor, schema catalog, query history, and the full change-plan workflow over the Connect-RPC API. Authentication is the standard MCP OAuth 2.1 flow (PKCE public client, dynamic registration) — the same flow MCP clients like Claude Code and opencode run against remote MCP servers.
No browser automation. No static tokens. No background daemon. No bundled certificates — everything resolves from environment variables.
Authentication model
Implements the MCP SDK's OAuthClientProvider + auth():
RFC 9728 protected-resource discovery → authorization-server metadata → RFC 7591 dynamic client registration → PKCE (S256) authorization-code flow
One token file per instance (
~/.config/bytebase-mcp/<host>.json, mode 600) is the only credential storeRefresh under an atomic
mkdirlock — the one filesystem operation that is atomic on both Windows and POSIX — and the file is re-read after taking the lock, so a process that loses the race picks up the winner's tokens. This matters: Bytebase's refresh token is single-use with no reuse grace, and MCP clients spawn one process per session, all sharing one grantSingle-flight within a process: concurrent 401s share one refresh
Access tokens re-mint on demand; the 1-hour expiry never surfaces
401 self-heal: the client passes the stale token to the refresh path, so cross-process rotation is detected, never double-burned
Related MCP server: My Credentials MCP Server
Setup
npm install
cp .env.example .env # set BYTEBASE_URL
npm run build
npm run auth # standard MCP OAuth 2.1 login (prints the approval URL)
npm run auth:status # grant health, no secrets
npm run probe # preflight: TLS, grant, identity, projectsThe login prints a URL; open it in any browser, approve, and the loopback listener captures the redirect. Re-login is needed roughly every 30 days.
MCP configuration
{
"mcpServers": {
"bytebase": {
"command": "node",
"args": ["C:/path/to/bytebase-mcp/dist/index.js"],
"env": { "BYTEBASE_URL": "https://bytebase.example.com" }
}
}
}Tools (14)
Tool | Description |
| Identity, server version, token life, visible projects — run first when debugging auth |
| Projects the identity can see |
| Databases with instance/engine/environment (the |
| Find tables by name/column (~1000-table prod DBs) |
| Columns, indexes, foreign keys |
| SQL through the SQL Editor — read-only by default (SELECT/WITH/SHOW/DESCRIBE/EXPLAIN), routed to the read-only replica when one exists; write SQL requires |
| Recent queries recorded by Bytebase |
| Schema/data change issues with approval status |
| Draft a SQL change plan (Sheet + Plan) — no SQL runs until a human approves |
| Plan details incl. decoded SQL |
| Edit title/description/SQL of a draft or in-review plan |
| Labels a project requires on review issues |
| Open the review Issue — starts the approval workflow |
| Cancel a draft or its open review issue (refuses after rollout starts) |
Write safety: bytebase_query blocks writes by default; the plan workflow is the write route — it creates a reviewable proposal that only executes after human approval in the Bytebase UI.
Environment variables
All configuration is environment-driven — nothing site-specific is bundled.
Variable | Default | Purpose |
| — | Instance base URL (required) |
|
| Token file location |
|
| Loopback OAuth redirect port |
| unset | Allow write SQL in |
| 200 / 5000 | Row caps |
| — | Outbound proxy |
| — | Extra CA for servers with an incomplete cert chain |
Development
npm run typecheck && npm run build && npm test
npm run probe # live preflight against .env
node test/mcp-e2e.mjs # full stdio protocol test (needs auth)Releasing
CI runs on every push and PR (typecheck → build → tests). Publishing is GitHub-Release-driven:
# 1. Bump "version" in package.json, commit and push to main
# 2. Create a GitHub Release (web UI, or):
gh release create v0.2.1 --generate-notes --repo ahmedbally/bytebase-mcpOn publish, the workflow verifies the release tag matches package.json, runs the full verification, publishes to npm (via the NPM_TOKEN secret), and appends the published version to the release notes.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
- mcpOAuthcom.vibgrate
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables IDE access to Supabase databases with SQL query execution, schema management, Auth admin operations, and built-in safety controls to prevent accidental destructive actions.-
- AlicenseNot gradedqualityDmaintenanceEnables secure chat-based interaction with PostgreSQL databases through Claude Desktop. Features GitHub OAuth authentication, role-based access control, and enterprise-grade security for database queries and operations.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables executing SQL queries (SELECT, INSERT, UPDATE, DELETE) and database introspection (list tables, describe table) on MySQL and PostgreSQL databases with OAuth authentication.-
- AlicenseNot gradedqualityCmaintenanceA universal database gateway implementing the Model Context Protocol, enabling MCP-compatible clients to connect, explore, and manage multiple databases with advanced features like OAuth2 authentication, health checks, and SQL optimization.80MIT