Back to MCP Catalog

OceanBase Database MCP Server

DatabasesPython
Securely interact with OceanBase databases through a controlled interface
Available Tools

list_tables

Lists available OceanBase tables as resources

read_table

Reads contents from a specified table

execute_sql

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.

Overview

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.

Installation

You can install the OceanBase Database MCP server using pip:

pip install oceanbase-mcp-server

Configuration

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

Security Considerations

For optimal security:

  1. Create a dedicated OceanBase user with minimal permissions
  2. Never use root credentials or administrative accounts
  3. Restrict database access to only necessary operations
  4. Enable logging for audit purposes
  5. Conduct regular security reviews of database access

Usage with Claude Desktop

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"
      }
    }
  }
}

Running as a Standalone Server

You can also run the server directly:

# Install dependencies
pip install -r requirements.txt

# Run the server
python -m oceanbase_mcp_server

Development

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

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.