OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Database

  • Overview of the ecosystem
  • ORM frameworks
    • Java
      • Spring Boot
      • Spring Batch
      • Use Spring JDBC to connect to OceanBase Database
      • Spring Data JPA
      • Hibernate
      • MyBatis
      • jOOQ
    • Python
      • Use SQLAlchemy to connect to OceanBase Database
      • Connect to OceanBase Database by using peewee
      • Use Tortoise ORM to connect to OceanBase Database
    • Go
      • Connect to OceanBase Database by using GORM
      • beego ORM
    • Rust
      • SeaORM Connection to OceanBase Database
      • Diesel Connection to OceanBase Database
    • Ruby
      • Active Record
      • Sequel Connection to OceanBase Database
      • Connect to OceanBase Database by using Ruby on Rails
    • Node.js
      • Sequelize
      • TypeORM
      • Prisma
      • Drizzle
    • C#
      • Dapper
      • SqlSugar
      • FreeSQL
    • PHP
      • Connect to OceanBase Database by using the Yii 2.0 ORM
      • Connect to OceanBase Database by using Laravel Eloquent ORM
      • CakePHP
  • Database version management
    • Liquibase
    • Flyway
  • Data integration
    • Flink
      • Apache Flink
      • Flink DirectLoad
      • Flink Connector OceanBase
    • dbt
    • SeaTunnel
    • Maxwell
    • Debezium
    • Spark Catalog
    • NiFi
    • Qlik Replicate
    • RisingWave CDC
    • Flume
    • Migrate data from SQL Server to OceanBase Database by using MySQL Workbench
  • SQL development
    • WebLogic
    • DBeaver
    • Navicat
    • DataGrip
    • TablePlus
    • DMS
  • Orchestration and scheduling
    • Airflow
    • PowerJob
    • DolphinScheduler
    • Linkis
  • Visualization tools
    • Superset
    • Excel
    • Power BI
    • Quick BI
    • Tableau
    • GuanData
    • vividime
    • DataV
    • Metabase
    • Redash
    • FineReport
  • Database management
    • NineData
    • Bytebase
    • DataHub
    • Zabbix
  • AI
    • OpenAI
    • Qwen
    • LangChain
    • LlamaIndex
    • Dify
    • n8n
    • Trae
    • SpringAI
    • Cline
    • Cursor
    • Continue
    • MCP Toolbox
    • CamelAI
    • Firecrawl
    • Hugging Face
    • Ollama
    • Google Gemini
    • Cloudflare Workers AI
    • DB GPT
    • Jina AI
    • Augment Code
    • Claude Code
    • Kiro
    • GPT4All
  • Application
    • Ghost
    • Jira
    • Seata
    • SAP Crystal Reports
  • Middleware
    • Apache Pulsar

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. master

Build an MCP server for OceanBase using MCP Toolbox for Databases

Last Updated:2026-09-04 07:40:45

Prerequisites
Step 1: Obtain database connection information
Step 2: Download and use MCP Toolbox for Databases
Download the Toolbox binary file
Create a configuration file
Start Toolbox
Step 3: (Optional) Test with MCP Inspector
Configure the connection
Step 4: Integrate with your MCP client
Supported MCP clients
What to do next

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.

  • 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

  1. Open the link shown above and fill in your connection details.
  2. Select SSE as the transport type.
  3. Enter http://127.0.0.1:5000/mcp/sse as the URL.
  4. Click the connect button.
  5. Check available tools in the tools tab and try the get-all-server-nodes tool. 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.

Previous topic

Continue
Last

Next topic

CamelAI
Next
on this page
Prerequisites
Step 1: Obtain database connection information
Step 2: Download and use MCP Toolbox for Databases
Download the Toolbox binary file
Create a configuration file
Start Toolbox
Step 3: (Optional) Test with MCP Inspector
Configure the connection
Step 4: Integrate with your MCP client
Supported MCP clients
What to do next