Skip to main content
Glama
OceanBase MCP Server

OceanBase MCP Server

by yuanoOo

OceanBase MCP サーバー

OceanBaseデータベースとの安全なやり取りを可能にするモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、AIアシスタントは制御されたインターフェースを介してテーブルの一覧表示、データの読み取り、SQLクエリの実行が可能になり、データベースの探索と分析をより安全かつ構造化できます。

特徴

  • 利用可能な OceanBase テーブルをリソースとして一覧表示する

  • 表の内容を読む

  • 適切なエラー処理でSQLクエリを実行する

  • 環境変数による安全なデータベースアクセス

  • 包括的なログ記録

Related MCP server: Microsoft SQL Server MCP Server

インストール

pip install oceanbase-mcp-server

構成

次の環境変数を設定します。

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

使用法

クロード・デスクトップ

これを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

セキュリティに関する考慮事項

  • 環境変数や資格情報をコミットしないでください

  • 必要最小限の権限を持つデータベースユーザーを使用する

  • 本番環境での使用にクエリホワイトリストを実装することを検討する

  • すべてのデータベース操作を監視して記録する

セキュリティのベストプラクティス

このMCPサーバーは機能するためにデータベースへのアクセスが必要です。セキュリティのため:

  1. 最小限の権限を持つ専用のOceanBaseユーザーを作成する

  2. ルート認証情報や管理者アカウントは使用しないでください

  3. 必要な操作のみにデータベースアクセスを制限する

  4. 監査目的でログを有効にする

  5. データベースアクセスの定期的なセキュリティレビュー

詳細な手順については、 OceanBase セキュリティ構成ガイドを参照してください。

  • 制限付きOceanBaseユーザーの作成

  • 適切な権限の設定

  • データベースアクセスの監視

  • セキュリティのベストプラクティス

⚠️ 重要: データベース アクセスを構成するときは、常に最小権限の原則に従ってください。

ライセンス

Apache ライセンス - 詳細については LICENSE ファイルを参照してください。

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature )

  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )

  4. ブランチにプッシュする ( git push origin feature/amazing-feature )

  5. プルリクエストを開く

Available Tools

1 tool
execute_sqlC

Execute an SQL query on the OceanBase server

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'execute_sql' has a clear and distinct purpose that cannot be confused with any other tool in this set.

    Naming Consistency5/5

    The single tool name 'execute_sql' follows a clear verb_noun pattern, and with only one tool, consistency is inherently perfect. There are no other tools to compare against, so no inconsistencies can exist.

    Tool Count2/5

    A single tool is too few for a database server's apparent scope, which typically requires operations like querying, updating, schema management, and transaction handling. This minimal set severely limits functionality and will likely cause agent failures in complex tasks.

    Completeness1/5

    The tool surface is severely incomplete for a database server domain. It only provides SQL execution, missing essential operations such as listing tables, describing schemas, creating/dropping tables, managing transactions, or handling connections, leaving significant gaps that will hinder agent workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.
      63
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      A Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
      1
      406
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol server implementation that enables AI assistants to securely interact with GreptimeDB, allowing them to explore database schema, read data, and execute SQL queries through a controlled interface.
      15
      29
      MIT