- Add Bytebase to your AI tool.
- Sign in to Bytebase in your browser.
- Try a prompt.
Before you start
- External URL. The external URL must be configured. In this guide,
<external_url>is that URL with no slash at the end, such ashttps://bytebase.example.com. Your AI tool connects to<external_url>/mcp. - An address your AI tool can reach. The AI tool connects from the computer it runs on.
http://localhost:8080works only for a tool on the same computer as Bytebase. For any other address, usehttps://. Some tools, such as Claude Code and Gemini CLI, can refuse to sign in over plainhttp://. - Access policy. The workspace access policy must not be Disabled. A new workspace starts at Read-only.
- Your own Bytebase account. You sign in as yourself. Your AI tool can do only what your Bytebase permissions and the access policy allow.
Claude Code
Run in your terminal:--scope user:
/mcp, select bytebase, and choose Authenticate. In the browser window that opens, sign in to Bytebase and click Allow access.
The Code tab in Claude Desktop uses this setup too.
Other ways to add Bytebase to Claude Code
Other ways to add Bytebase to Claude Code
Share the setup with your team. Add The next time you start Claude Code in that folder, it asks you to approve the server.Add it from JSON.Sign in from your shell. Run
--scope project to the command. Claude Code writes a .mcp.json file in the project’s root folder, which you can commit. Each person still signs in as themselves.Add it without the command. Create .mcp.json in your project’s root folder:.mcp.json
claude mcp login bytebase. On a computer with no browser, such as over SSH, add --no-browser. Claude Code prints the sign-in URL. Open it on your own computer, then paste the address your browser ends on back into the terminal.If Claude Code does not connect
If Claude Code does not connect
- Run
claude mcp get bytebaseto see the server’s status. /mcpdoes not list bytebase: you added it in another project folder. Run the command again in this folder, or with--scope user.- The command fails with
MCP server bytebase already exists: runclaude mcp remove bytebase, then add it again. - The browser does not open: copy the URL Claude Code shows and open it yourself.
- For anything else, see Troubleshooting.
Claude Desktop
Claude Desktop has two ways to reach Bytebase. Pick one by where your Bytebase runs:Add Bytebase to the config file
Claude Desktop starts the@bytebase/bytebase-mcp npm package on your computer, and the package connects to your Bytebase. This requires Node.js 20 or later on the computer that runs Claude Desktop. The package has not been tested on Windows yet.
-
In Claude Desktop, click your name in the lower-left corner, then Settings > Desktop app > Extensions > Edit config. A folder opens.
If your version has no Edit config, go to the file yourself:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows, normally:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
From that folder, open
claude_desktop_config.jsonin a text editor. -
Add the
bytebaseentry and save the file.BYTEBASE_URLis your external URL without/mcp. Where the entry goes depends on what the file already holds:- Empty file
- Other settings
- Existing mcpServers
Make this the whole file:claude_desktop_config.json - Quit Claude Desktop and reopen it. Closing the window is not enough.
- In the browser window that opens, sign in to Bytebase and click Allow access.
- To check, click + in the chat box and select Connectors. bytebase is listed with its tools.
Use a connector instead
A connector needs no Node.js and no file to edit. Claude connects to Bytebase from Anthropic’s servers, not from your computer, so:- Bytebase must be reachable from the internet. An instance behind a firewall or a VPN does not connect.
- The external URL must use
https://on port 443. Claude refuses a URL with another port, such ashttps://bytebase.example.com:8443.
- In Claude Desktop or on claude.ai, go to Customize > Connectors.
- Click + Add, then Add custom connector.
- Enter a name, such as
Bytebase, and the URL<external_url>/mcp. - Follow the prompts. When Claude sends you to Bytebase, sign in and click Allow access.
If Claude Desktop does not connect
If Claude Desktop does not connect
Claude Desktop writes a log for each server it starts. Bytebase’s log is
mcp-server-bytebase.log, in ~/Library/Logs/Claude on macOS and %APPDATA%\Claude\logs on Windows.- Claude Desktop says it cannot read the config file: see A config file is not valid.
- The log says
npxwas not found: seenpxis not found. - No browser window opens: the first start can take a minute, because
npxdownloads the package. If it still does not open, find the sign-in URL in the log and open it yourself. - A chat that was open before you signed in has no Bytebase tools: start a new chat.
- A session in the Code tab has no Bytebase tools: add Bytebase to Claude Code, which the Code tab also uses.
- Do not put
<external_url>/mcpin the config file as aurlentry. The file is for servers that Claude Desktop starts with a command. - A connector does not connect: check that Bytebase is reachable from the internet on port 443.
Codex
Run in your terminal:Other ways to add Bytebase to Codex
Other ways to add Bytebase to Codex
In the ChatGPT desktop app:On a computer with no browser: run
- Open Settings, then select MCP servers.
- Select Add server.
- Enter the name
bytebase, choose Streamable HTTP, and enter the URL<external_url>/mcp. - Save the server, then select Restart.
- Select Authenticate on the server.
~/.codex/config.toml, then run codex mcp login bytebase.~/.codex/config.toml
codex mcp login bytebase --no-browser. Codex prints the sign-in URL. Open it on your own computer, then paste the address your browser ends on back into the terminal.If Codex does not connect
If Codex does not connect
- Run
codex mcp list. It shows each server, whether it is enabled, and its sign-in state. - In Codex, type
/mcpto see the servers that are connected. - For anything else, see Troubleshooting.
Copilot CLI
Run in your terminal:/mcp auth bytebase. In the browser window, sign in to Bytebase and click Allow access.
Other ways to add Bytebase to Copilot CLI
Other ways to add Bytebase to Copilot CLI
In Copilot CLI: enter
/mcp add. In the form, set Server Name to bytebase, Server Type to HTTP, and URL to <external_url>/mcp. Press Ctrl+S to save.In the config file: add Bytebase to ~/.copilot/mcp-config.json. If the file already has mcpServers, add bytebase inside it.~/.copilot/mcp-config.json
If Copilot CLI does not connect
If Copilot CLI does not connect
- Run
copilot mcp listin your terminal, or/mcp show bytebasein Copilot CLI, to see the server’s status. - For anything else, see Troubleshooting.
Gemini CLI
Run in your terminal:--scope user:
/mcp auth bytebase. In the browser window that opens, sign in to Bytebase and click Allow access.
Other ways to add Bytebase to Gemini CLI
Other ways to add Bytebase to Gemini CLI
In the settings file: add Bytebase to
~/.gemini/settings.json for every project, or to .gemini/settings.json in one project folder. If the file already has other settings, add mcpServers beside them.~/.gemini/settings.json
If Gemini CLI does not connect
If Gemini CLI does not connect
- Run
gemini mcp listto see the server’s status. - Sign-in fails for a Bytebase on a private network address: Gemini CLI blocks sign-in to private addresses unless you allow it. See
allowPrivateNetworkin the Gemini CLI documentation below. - For anything else, see Troubleshooting.
VS Code
In Bytebase, go to Integration > MCP, open the VS Code tab, and click Install in VS Code. VS Code opens and asks you to install the server. Sign in. The first time VS Code uses Bytebase, it asks you to sign in. In the browser window that opens, sign in to Bytebase and click Allow access.Other ways to add Bytebase to VS Code
Other ways to add Bytebase to VS Code
From your terminal:From the Command Palette:VS Code’s documentation recommends the Copilot file for new setups and marks the VS Code file format as deprecated. See its MCP configuration reference.
- Run MCP: Add Server.
- Choose HTTP and enter
<external_url>/mcp. - Enter the name
bytebase. - Choose where to save it. Global makes Bytebase available in every workspace.
- Copilot file
- VS Code file
GitHub Copilot in VS Code and Copilot CLI share this file.
~/.copilot/mcp-config.json
If VS Code does not connect
If VS Code does not connect
- Nothing happens when you click Install in VS Code: VS Code is not installed on this computer, or your browser blocked the link. Use the
code --add-mcpcommand instead. - Run MCP: List Servers from the Command Palette and select bytebase. Choose Show Output to read the server’s log. Choose Authenticate, when it is offered, to sign in.
- For anything else, see Troubleshooting.
Other tools
Any AI tool that connects to a remote MCP server over HTTP and signs in with OAuth can use Bytebase. Add this to the tool’s MCP config. The format can differ by tool, so check the tool’s own documentation.@bytebase/bytebase-mcp npm package. It requires Node.js 20 or later. BYTEBASE_URL is your external URL without /mcp.
Sign in
Bytebase signs your AI tool in with OAuth. Every tool ends on the same Bytebase page, Authorization Request. The page names your AI tool and the workspace, shows the workspace access policy as it is now, and lists what the session may and may not do. Click Allow access to connect. Older versions label the button Allow.- Read-only
- Read-write

/mcp. It is not an API credential: the rest of the Bytebase API refuses it. Use a service account for API access.
Try a prompt
Ask your AI tool something that only reads, which works under Read-only:- “List all projects in my Bytebase instance”
- “Show me the schema of the
<database>database”
Troubleshooting
The MCP page says the External URL is not set
On Integration > MCP, the commands show a placeholder in place of your URL, and copy and install are off. Ask a workspace admin to configure the external URL, then reload the page.The browser does not open for sign-in
Start the sign-in yourself:
Sign-in ends by sending your browser to an address on the computer that runs your AI tool. If the tool runs on another computer, such as over SSH, use
claude mcp login bytebase --no-browser or codex mcp login bytebase --no-browser.
Your AI tool cannot reach Bytebase
On the computer that runs your AI tool, run:- No answer, or an error. That computer cannot reach Bytebase. Check the URL, your VPN, and your firewall.
resourceis not the URL you gave your AI tool. Add Bytebase again with the URL inresource. Bytebase binds each sign-in to the external URL, so another address for the same instance does not work.- The URL starts with
http://and is notlocalhost. Some tools refuse to sign in. Serve Bytebase overhttps://and update the external URL. - You use a Claude connector. Claude connects from Anthropic’s servers, not from your computer. See Use a connector instead.
The sign-in page says MCP access is turned off

Bytebase refuses a request after sign-in
Your AI tool can do only what both the access policy and your own permissions allow. Under Read-only, it cannot change anything. See What each mode allows.A config file is not valid
A JSON config file with one mistake is not read at all. Check these first:- A comma between entries, and none after the last one.
- A closing
}for every{. - Only one
mcpServersin the file.
Valid JSON, or the line of the first mistake:
npx is not found
This applies to tools that start the @bytebase/bytebase-mcp package, such as Claude Desktop.
-
Run
node --versionin your terminal. If the command is not found, or the version is below 20, install Node.js 20 or later. -
Check that the package runs and reaches Bytebase:
The output includes
"bytebase": truewhen the package reaches your Bytebase. -
If the command works in your terminal but your AI tool still cannot find
npx, the tool does not see the same Node.js as your terminal. This can happen when Node.js was installed with a version manager such as nvm. Runwhich npx, then give the tool the full path and the folder it is in:<npx_folder>is the output ofwhich npxwithout the final/npx.
Sign-in stopped working after a change
If you change the external URL, existing tokens stop working at/mcp. Refreshing does not help, because the refreshed token is still bound to the old URL. Remove Bytebase from each AI tool, add it again with the new URL, then sign in again.
To remove Bytebase, run claude mcp remove bytebase, codex mcp remove bytebase, copilot mcp remove bytebase, or gemini mcp remove bytebase. In Claude Desktop, delete the bytebase entry from the config file, or remove the connector.

