The Model Context Protocol (MCP) is an open-source standard released by Anthropic in November 2024. MCP is designed to enable large language models to interact directly with external tools and data sources. With MCP, users no longer need to manually copy and execute model outputs. The language model can instruct tools to perform actions directly.
MCP Toolbox for Databases is an open-source MCP server for databases. It streamlines complex tasks such as connection pooling and authentication, allowing you to develop tools more easily, quickly, and securely.
This guide walks you through setting up an MCP server for OceanBase using MCP Toolbox for Databases, all without any programming.
Prerequisites
You have deployed OceanBase Database and created a MySQL-compatible tenant. For more information about how to create a user tenant, see Create a tenant.
Install Git according to your operating system.
Ensure your system (Linux, macOS, or Windows) can run binary files.
Step 1: Obtain database connection information
You can quickly deploy an independent OceanBase database instance for testing using the following commands:
# Deploy a mini instance.
docker run -p 2881:2881 --name oceanbase-ce -e MODE=mini -d oceanbase/oceanbase-ce
# Connect to the OceanBase database instance.
docker exec -it oceanbase-ce obclient -h127.0.0.1 -P2881 -uroot # Connect to the sys tenant as root.
Step 2: Download and use MCP Toolbox for Databases
Download the Toolbox binary file
Run the following command to download the latest release of the Toolbox binary file:
export OS="linux/amd64" # Choose from linux/amd64, darwin/arm64, darwin/amd64, or windows/amd64.
export VERSION="0.11.0"
curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/$OS/toolbox
Make the binary file executable:
chmod +x toolbox
Create a configuration file
Create a tools.yaml file with the following content. Replace the connection information with your OceanBase details. This sample configuration shows how to use Toolbox to obtain ASH reports and cluster information via MCP tools. You can customize your own tools as needed.
sources:
oceanbase:
kind: oceanbase
host: 127.0.0.1
port: 2881
database: oceanbase
user: root
password: *****
queryTimeout: 60s
tools:
get-ash-report:
kind: oceanbase-sql
source: oceanbase
description: Get ASH report.
parameters:
- name: start_time
type: string
description: Start time for the ASH report.
- name: end_time
type: string
description: End time for the ASH report.
- name: tenant_id
type: string
description: Tenant ID for the ASH report.
statement: CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(?,?, NULL, NULL, NULL, 'TEXT', NULL, NULL, ?);
get-all-server-nodes:
kind: oceanbase-sql
source: oceanbase
description: Get all server nodes.
statement: select * from DBA_OB_SERVERS;
toolsets:
my_first_toolset:
- get-ash-report
Start Toolbox
Run the following command to start Toolbox. The following output appears:
./toolbox --tools-file tools.yaml
2025-08-28T10:37:49.776637+08:00 INFO "Initialized 1 sources."
2025-08-28T10:37:49.777513+08:00 INFO "Initialized 0 authServices."
2025-08-28T10:37:49.777586+08:00 INFO "Initialized 1 tools."
2025-08-28T10:37:49.777627+08:00 INFO "Initialized 2 toolsets."
2025-08-28T10:37:49.778334+08:00 INFO "Server ready to serve!"
Step 3: (Optional) Test with MCP Inspector
MCP Inspector is an interactive development tool for testing and debugging MCP servers.
You can run MCP Inspector directly with npx without installation:
npx @modelcontextprotocol/inspector node build/index.js
Configure the connection
- Open the link shown above and fill in your connection details.
- Select SSE as the transport type.
- Enter
http://127.0.0.1:5000/mcp/sseas the URL. - Click the connect button.
- Check available tools in the tools tab and try the
get-all-server-nodestool. The following output appears:
{
"BLOCK_MIGRATE_IN_TIME": null,
"BUILD_VERSION": "4.3.5.3_103000102025071821-4b8c513fcc2194bad9eb2f93c789040f6dd01f11(Jul 18 2025 21:11:10)",
"CREATE_TIME": "2025-07-23T17:49:40.554851Z",
"ID": 1,
"LAST_OFFLINE_TIME": null,
"MODIFY_TIME": "2025-07-23T17:52:49.259607Z",
"SQL_PORT": 2881,
"START_SERVICE_TIME": "2025-07-23T17:52:47.354459Z",
"STATUS": "ACTIVE",
"STOP_TIME": null,
"SVR_IP": "x.x.x.x",
"SVR_PORT": 2881,
"WITH_ROOTSERVER": "YES",
"ZONE": "zone1"
}
Step 4: Integrate with your MCP client
After you've successfully tested it, your MCP server is ready to use. You can now integrate any MCP client with large language models to boost your productivity.
Supported MCP clients
- Continue: An IDE plugin for Visual Studio Code and IntelliJ IDEA
- Claude Desktop: Anthropic's desktop application
- Cline: A command-line AI assistant
- Other MCP protocol-compatible clients
What to do next
- Customize your tool configuration to add more OceanBase-related SQL queries.
- Integrate into your workflow to improve database management and analytics efficiency.
- Explore additional MCP tools and features.