Bytebase

v0.1.1
io.github.bytebase/bytebase-mcp Checked 1 day ago Published 2 days ago

Query, inspect, and change databases through Bytebase's governed workflow with audit logging.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

administer_workspace

Make a workspace administration change that the user confirms in this client first. It takes a Bytebase API operation and its request body, as search_api describes them. | Parameter | Required | Description | |-------------|----------|-------------| | operationId | Yes | The operation, e.g. "SettingService/UpdateSetting" | | body | Yes | The operation's request body | It serves four changes. The approval rules for database changes: send SettingService/UpdateSetting with setting.name "settings/WORKSPACE_APPROVAL" and the whole rule list in setting.value.workspaceApproval.r…

ParameterTypeDescription
body *object
operationId *string

call_api

Execute a Bytebase API endpoint. **Use search_api first to get operationId and schema.** | Parameter | Required | Description | |-----------|----------|-------------| | operationId | Yes | e.g., "SQLService/Query" | | body | No | JSON request body | **Resource names:** Preserve the exact canonical name returned by SearchDatabases or ListDatabases: instances/prod/databases/main for a workspace instance, or projects/my-project/instances/prod/databases/main for a project instance. **Example:** call_api(operationId="SQLService/Query", body={"name": "projects/my-project/instances/i/databases/db"…

ParameterTypeDescription
operationId *string
bodyobject

decide_issue

Approve or reject a Bytebase issue at its current approval step. The user confirms the decision in this client first. | Parameter | Required | Description | |-----------|----------|-------------| | issue | Yes | Issue name, e.g. "projects/hr/issues/42" | | decision | Yes | "approve" or "reject" | | comment | No | Note recorded with the decision | The tool shows the user what the issue changes and asks them to confirm in a form. It decides only when they accept; declining or cancelling changes nothing. A client that cannot show the form gets the issue's link, to decide…

ParameterTypeDescription
decision *string
issue *string
commentstring

get_gitops_workflow

Return the workflow files that set up GitOps for a project. With them in the repository, every pull request that changes the migration folder gets a Bytebase SQL review, and merging it deploys. The tool reads only; it changes nothing in Bytebase. | Parameter | Required | Description | |------------------|----------|-------------| | project | Yes | The project ID, e.g. "hr" | | targets | Yes | One database group ("projects/hr/databaseGroups/all"), or one or more databases by the name ListDatabases gives ("instances/prod/databases/hr") | | workloadIdentity | Y…

ParameterTypeDescription
project *string
targets *null | array
workloadIdentity *string
folderstring

get_schema

Inspect a Bytebase database's schema. | Parameter | Required | Description | |-----------|----------|-------------| | database | Yes | Database name or substring (e.g., "employee_db" or "employee") | | instance | No | Workspace instance ID/name, or the full canonical name for a project instance | | project | No | Project name or ID to narrow resolution | | schema | No | Schema name for multi-schema engines (PG/MSSQL/Oracle/Snowflake/Redshift/CockroachDB/Databricks/Trino/Spanner/Hive); ignored with a note on MySQL/TiDB/etc. | | table | No | Drill into a…

ParameterTypeDescription
database *string
includestring
instancestring
projectstring
schemastring
tablestring

grant_masking_exemption

Exempt one member from data masking in a Bytebase project, for one database (optionally one schema, table, or columns of one table) or for every database in the project. The user confirms the exemption in this client first. | Parameter | Required | Description | |--------------|----------|-------------| | project | Yes | Project name, e.g. "projects/hr" | | member | Yes | "user:{email}", "group:{email}", "serviceAccount:{email}" or "workloadIdentity:{email}" | | database | One of | Database name, e.g. "instances/prod/databases/hr"; it must belong to the project |…

ParameterTypeDescription
member *string
project *string
allDatabasesboolean
columnsnull | array
databasestring
expireTimestring
reasonstring
schemastring
tablestring

propose_database_change

Run DDL/DML changes (ALTER TABLE, CREATE TABLE, INSERT, UPDATE, migrations) against a Bytebase database. This is the primary tool for making database changes. Use this instead of manually calling CreateSheet/CreatePlan/CreateIssue via call_api. Provide plain SQL — the tool handles database resolution, sheet creation, plan creation with automatic plan checks, and issue creation in one call. Optionally creates a rollout. | Parameter | Required | Description | |---------------|----------|-------------| | database | Yes | Database name or substring | | sql | Yes |…

ParameterTypeDescription
database *string
sql *string
title *string
changeTypestring
createRolloutboolean
instancestring
projectstring
reasonstring

query_database

Execute a SQL query against a Bytebase database. Resolves the database by name automatically. | Parameter | Required | Description | |-----------|----------|-------------| | database | Yes | Database name or substring (e.g., "employee_db" or "employee") | | statement | Yes | SQL query to execute | | instance | No | Workspace instance ID/name, or the full canonical name for a project instance | | project | No | Project name or ID to narrow resolution | | schema | No | Default schema for unqualified names (Postgres search path). An access grant applies only wh…

ParameterTypeDescription
database *string
statement *string
containerstring
instancestring
issueTitlestring
limitinteger
projectstring
schemastring

reauthorize

Log out the current MCP OAuth connection so the client can run OAuth again. Use this when you need to change the connected Bytebase account or SaaS workspace. After this tool succeeds, retry the MCP request or reconnect; the server will return the normal OAuth challenge.

request_access_grant

Request an access grant: time-boxed permission to run one read-only statement on one Bytebase database, optionally with results unmasked or exported. A person approves the request in Bytebase before it takes effect. | Parameter | Required | Description | |---------------|----------|-------------| | database | Yes | Full database name, as query_database prints it after "Database:", e.g. "projects/hr/instances/prod/databases/hr" | | statement | Yes | One read-only statement; the grant applies to this exact statement | | schema | No | Default schema for unqual…

ParameterTypeDescription
database *string
durationHours *integer
reason *string
statement *string
containerstring
exportboolean
schemastring
unmaskboolean

revoke_masking_exemption

Remove one member's masking exemption in a Bytebase project. The user confirms in this client first. | Parameter | Required | Description | |-----------|----------|-------------| | project | Yes | Project name, e.g. "projects/hr" | | member | Yes | The member as the policy lists it, e.g. "user:bob@example.com" | | condition | Yes | The exemption's condition expression, exactly as OrgPolicyService/GetPolicy returns it for "{project}/policies/masking_exemption"; "" for an exemption with no condition | The member is removed from every exemption whose condition matches exactl…

ParameterTypeDescription
condition *string
member *string
project *string

search_api

Discover Bytebase API endpoints. **Always call before call_api - never guess schemas.** | Mode | Parameters | Result | |------|------------|--------| | List | (none) | All services | | Browse | service="SQLService" | All endpoints in service | | Details | operationId="SQLService/Query" | Request/response schema | | Schema | schema="Instance" | Message type definition | **Workflow:** search_api() → search_api(service="...") → search_api(operationId="...") → call_api(...) The results also name what no MCP session can do, whatever the workspace's MCP mode and the user's permissions, and…

ParameterTypeDescription
operationIdstring
schemastring
servicestring

set_just_in_time_access

Turn just-in-time access on or off for one Bytebase project. The user confirms the change in this client first. | Parameter | Required | Description | |-----------|----------|-------------| | project | Yes | Project name, e.g. "projects/hr" | | enabled | Yes | true to turn it on, false to turn it off | Just-in-time access lets members request access grants in the project: time-boxed permission to run one statement, for a one-off query. With it off, new requests are refused, and active grants stop applying until it is turned on again; they are not revoked. The tool shows the us…

ParameterTypeDescription
enabled *boolean
project *string