MCP (Model Context Protocol) is an open-source protocol released by Anthropic in November 2024. It enables large language models to interact with external tools or data sources. With MCP, users do not need to manually copy and execute the output of large models. Instead, the large models can directly instruct tools to perform corresponding actions.
Google GenAI Toolbox is an open-source toolbox for building and deploying MCP servers. It handles complex issues such as connection pools and authentication, allowing you to develop tools more easily, quickly, and securely.
This topic will show you how to build an OceanBase MCP server using Google GenAI Toolbox without programming.
Prerequisites
An OceanBase Cloud transactional instance is available in your environment. For instructions on how to create the instance, see Create an transactional instance.
You have created a MySQL-compatible tenant in the instance. For instructions on how to create the tenant, see Create a MySQL-compatible tenant.
You have a MySQL database and account available under the tenant, and you have granted read and write permissions to the database account. For more information, see Create an account and Create a database (MySQL only).
You are a project admin or instance admin and have the permissions required to read and write data in the instance. If not, contact your organization admin to grant the required permissions.
You have installed Git based on the operating system.
Ensure that your system supports running binary files (Linux, macOS, or Windows).
Step 1: Obtain the database connection information
Log in to the OceanBase Cloud console.
In the instance list page, expand the the information of the target instance.
Select Connect > Get Connection String under the target tenant.
In the pop-up window, select Public Network as the connection method.
Follow the prompts in the pop-up window to obtain the public endpoint and the connection string.
Step 2: Download and start using the Toolbox
Download the Toolbox binary file
Download the latest version of the Toolbox binary file:
export OS="linux/amd64" # Choose one of the following: 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 executable:
chmod +x toolbox
Create a configuration file
Create a tools.yaml file and write the following content. Replace the connection information with your OceanBase endpoint. This example configuration shows how to use the Toolbox to obtain ASH reports and cluster information through the MCP tool. You can customize your own tools.
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: The start time of the ASH report.
- name: end_time
type: string
description: The end time of the ASH report.
- name: tenant_id
type: string
description: The tenant ID of 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 the Toolbox
Start the Toolbox. You should see the following output:
./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: Test with MCP Inspector (Optional)
Inspector is an interactive development tool for testing and debugging MCP servers.
You can run Inspector directly with npx without installation:
npx @modelcontextprotocol/inspector node build/index.js
Configure the connection
- Open the link displayed above and fill in the connection information.
- Select SSE for the transmission type.
- Enter
http://127.0.0.1:5000/mcp/ssefor the URL. - Click the Connect button.
- In the Tools tab, click List Tools and try the
get-all-server-nodestool. You should see the following output:
{
"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 your MCP client
After the test is passed, you now have your own MCP server without programming. You can integrate any MCP client with the large language model to work more efficiently.
Supported MCP clients
- Continue - an IDE plugin that supports Visual Studio Code and IntelliJ IDEA
- Claude Desktop - a desktop application from Anthropic
- Cline - a command-line AI assistant
- Other clients that support the MCP protocol
Next steps
- Customize your tool configuration and add more OceanBase-related SQL queries.
- Integrate it into your workflow to improve database management and analysis efficiency.
- Explore more MCP tools and features.