✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

OceanBase MCP Server

A Model Context Protocol (MCP) server that enables secure interaction with OceanBase databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.

Features

  • List available OceanBase tables as resources
  • Read table contents
  • Execute SQL queries with proper error handling
  • Secure database access through environment variables
  • Comprehensive logging

Installation

pip install oceanbase-mcp-server

Configuration

Set the following environment variables:

OB_HOST=localhost     # Database host
OB_PORT=2881         # Optional: Database port (defaults to 2881 if not specified)
OB_USER=your_username
OB_PASSWORD=your_password
OB_DATABASE=your_database

Usage

With Claude Desktop

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

As a standalone server

# Install dependencies
pip install -r requirements.txt

# Run the server
python -m oceanbase_mcp_server

Development

# Clone the repository
git clone https://github.com/yourusername/oceanbase_mcp_server.git
cd oceanbase_mcp_server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or `venvScriptsactivate` on Windows

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

Security Considerations

  • Never commit environment variables or credentials
  • Use a database user with minimal required permissions
  • Consider implementing query whitelisting for production use
  • Monitor and log all database operations

Security Best Practices

This MCP server requires database access to function. For 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. Regular security reviews of database access

See OceanBase Security Configuration Guide for detailed instructions on:

  • Creating a restricted OceanBase user
  • Setting appropriate permissions
  • Monitoring database access
  • Security best practices

⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.

License

Apache License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

OceanBase MCP Server

304 GitHub stars

Project Details

Recomended MCP Servers

Micromanage Development Task Manager
Micromanage Development Task Manager

A Micromanagement Tool for Development Workflows: Helps coding agent plan, track, and visualize sequential development tasks with detailed...

🧩
DBT Docs MCP Server

MCP (model context protocol) server for interacting with dbt Docs

🧩
Database Server

mcp server for all types of database that connects with LLMs

🧩
openapi-client-generator

A Model Context Protocol server for generating API clients with TypeScript.

ClickUp MCP Server
ClickUp MCP Server

Fork of ClickUp MCP Server - Integrate ClickUp task management with AI through Model Context Protocol

🧩
Terminal

MCP Terminal 是一个基于 MCP(Model Context Protocol)的终端控制服务器,专为与大型语言模型(LLM)和 AI 助手集成而设计。它提供了一个标准化的接口,使 AI 可以执行终端命令并获取输出结果。

MCP Finder and Installer
MCP Finder and Installer

MCP server that installs MCP Servers

🧩
MarkItDown Server

A Model Context Protocol (MCP) server that converts various file formats to Markdown using the MarkItDown utility.

Local File Reader
Local File Reader

使用mcp协议帮助llm进行文件的本地读取

Trivy Security Scanner
Trivy Security Scanner

A Model Context Protocol (MCP) server that provides Trivy security scanning capabilities through a standardized interface.

Security Copilot and Sentinel Integration Server
Security Copilot and Sentinel Integration Server

MCP Server that integrates with Security Copilot, Sentinel and other tools (in the future). It enhance the process...

EdgeOne Pages
EdgeOne Pages

An MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.

Featured Templates

View More
Data Analysis
Pharmacy Admin Panel
254 2272
Customer service
Service ERP
127 1487
Verified Icon
AI Agents
AI Chatbot Starter Kit
1342 9274
AI Assistants
Talk with Claude 3
160 2068

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.