The OceanBase MCP provides secure interaction capabilities with OceanBase databases, OceanBase Cloud Platform (OCP), and OBCloud services. It enables AI assistants to perform database operations, manage cloud resources, and execute administrative tasks through a standardized protocol interface. This MCP server collection offers specialized tools for different aspects of the OceanBase ecosystem, allowing for seamless integration with AI workflows while maintaining security and control over database operations.
The OceanBase MCP Server provides a secure interface for AI assistants to interact with OceanBase databases and related tools. This MCP includes three distinct servers:
To install and run the OceanBase MCP Server:
Clone the repository:
git clone https://github.com/oceanbase/mcp-oceanbase.git
cd mcp-oceanbase
Set up a Python environment (Python 3.8+ recommended):
# Using uv (recommended)
uv venv
source .venv/bin/activate
uv pip install -e .
# Or using pip
pip install -r requirements.txt
Configure environment variables:
.env.template
to .env
.env
file to include your database connection detailsRun the desired MCP server:
# For OceanBase MCP Server
python -m src.oceanbase_mcp_server.server
# For OCP MCP Server
python -m src.ocp_mcp_server.server
# For OBCloud MCP Server
python -m src.obcloud_mcp_server.server
Each MCP server requires specific configuration:
Configure database connection details in your .env
file:
OCEANBASE_HOST=your_host
OCEANBASE_PORT=your_port
OCEANBASE_USER=your_username
OCEANBASE_PASSWORD=your_password
OCEANBASE_DATABASE=your_database
Configure OCP connection details:
OCP_HOST=your_ocp_host
OCP_PORT=your_ocp_port
OCP_USER=your_ocp_username
OCP_PASSWORD=your_ocp_password
Configure OBCloud connection details:
OBCLOUD_API_KEY=your_api_key
OBCLOUD_ENDPOINT=your_endpoint
Once the MCP server is running, AI assistants can interact with OceanBase databases and tools through the Model Context Protocol. The server provides a secure interface for executing database queries, managing database resources, and performing administrative tasks.
For detailed documentation on each server's capabilities:
If you encounter issues:
.env
fileFor additional help, you can: