OceanBase数据库
STDIO安全操作OceanBase数据库的MCP服务器
安全操作OceanBase数据库的MCP服务器
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.
pip install oceanbase-mcp-server
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
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" } } } }
# Install dependencies pip install -r requirements.txt # Run the server python -m oceanbase_mcp_server
# 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 `venv\Scripts\activate` on Windows # Install development dependencies pip install -r requirements-dev.txt # Run tests pytest
This MCP server requires database access to function. For security:
See OceanBase Security Configuration Guide for detailed instructions on:
⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.
Apache License - see LICENSE file for details.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)