OceanBase
Created 6 months ago
A Model Context Protocol (MCP) server for secure interaction with OceanBase databases.
development
documentation
public
database
security
What is OceanBase?
(by yuanoOo) A Model Context Protocol (MCP) server that enables secure interaction with OceanBase databases.
Documentation
OceanBase MCP Server
A Model Context Protocol (MCP) server that enables secure interaction with OceanBase databases.
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
pip install -r requirements.txt\n\n# Run the server
python -m oceanbase_mcp_server
Development
git clone https://github.com/yourusername/oceanbase_mcp_server.git
cd oceanbase_mcp_server\n\n# Create virtual environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows\n\n# Install development dependencies
pip install -r requirements-dev.txt\n\n# 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:
- Create a dedicated OceanBase user with minimal permissions
- Never use root credentials or administrative accounts
- Restrict database access to only necessary operations
- Enable logging for audit purposes
- 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.
Server Config
{
"mcpServers": {
"oceanbase-server": {
"command": "npx",
"args": [
"oceanbase"
]
}
}
}
Links & Status
Project Info
Hosted
Featured
Created At:
May 23, 2025
Updated At:
Aug 07, 2025
Author:
yuanoOo
Category:
community
License:
Apache License
Tags:
development
documentation
public