Lists available OceanBase tables as resources
Reads contents from a specified table
Executes SQL queries with proper error handling
The OceanBase Database MCP server enables AI assistants to safely interact with OceanBase databases through a structured interface. It provides capabilities to list tables, read data, and execute SQL queries with proper error handling and security controls. This server makes database exploration and analysis safer by implementing access controls and comprehensive logging. It's designed to follow security best practices, allowing AI assistants to work with database content while maintaining appropriate safeguards.
The OceanBase Database MCP server provides a secure interface for AI assistants to interact with OceanBase databases. It enables listing tables, reading data, and executing SQL queries through a controlled environment.
You can install the OceanBase Database MCP server using pip:
pip install oceanbase-mcp-server
The server requires database connection details through environment variables:
OB_HOST=localhost # Database host
OB_PORT=2881 # Database port (defaults to 2881)
OB_USER=your_username # Database username
OB_PASSWORD=your_password # Database password
OB_DATABASE=your_database # Database name
For optimal security:
To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"oceanbase": {
"command": "uv",
"args": [
"--directory",
"path/to/oceanbase_mcp_server",
"run",
"oceanbase_mcp_server"
],
"env": {
"OB_HOST": "localhost",
"OB_PORT": "2881",
"OB_USER": "your_username",
"OB_PASSWORD": "your_password",
"OB_DATABASE": "your_database"
}
}
}
}
You can also run the server directly:
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m oceanbase_mcp_server
For contributing to the project:
# Clone the repository
git clone https://github.com/yuanoOo/oceanbase_mcp_server.git
cd oceanbase_mcp_server
# Create virtual environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest