Skip to main content
Glama
TiDB Insight MCP

TiDB Insight MCP

by RyutoYoda

TiDB Insight MCP

TiDBデータベースの分析とパフォーマンス監視のためのカスタムModel Context Protocol (MCP) サーバーです。

機能

  • SQLクエリ実行: 実行時間測定オプション付きで任意のSQLクエリを実行

  • テーブル分析: サイズ、行数、インデックス統計を含む詳細なテーブル情報を取得

  • データベース統計: 包括的なデータベース全体のメトリクスと情報

  • クエリベンチマーク: クエリを複数回実行して平均実行時間とパフォーマンスを測定

Related MCP server: MySQL MCP Server

利用可能なツール

1. execute_sql

TiDBデータベースでSQLクエリを実行し、オプションでタイミング測定を行います。

パラメータ:

  • query (必須): 実行するSQLクエリ

  • measure_time (オプション): 実行時間を測定するかどうか

2. get_table_info

サイズと構造を含むテーブルの詳細情報を取得します。

パラメータ:

  • table_name (オプション): 特定のテーブル名、または空白ですべてのテーブル

3. get_database_stats

包括的なデータベース統計と接続情報を取得します。

4. benchmark_query

SQLクエリのパフォーマンスベンチマークを実行します。

パラメータ:

  • query (必須): ベンチマークするSQLクエリ

  • iterations (オプション): 反復回数(デフォルト: 5、最大: 50)

インストール

  1. このリポジトリをクローン:

git clone https://github.com/yourusername/tidb-insight-mcp.git
cd tidb-insight-mcp
  1. 環境変数を設定:

cp .env.example .env
# .envファイルを編集してTiDBの接続情報を入力
  1. セットアップスクリプトを実行:

./setup.sh

設定

Claude Desktop設定ファイルに以下を追加してください:

{
  "mcpServers": {
    "tidb-insight": {
      "command": "/path/to/tidb-insight-mcp/venv/bin/python",
      "args": ["/path/to/tidb-insight-mcp/server.py"],
      "env": {
        "TIDB_HOST": "your-tidb-host",
        "TIDB_PORT": "4000",
        "TIDB_USERNAME": "your-username",
        "TIDB_PASSWORD": "your-password",
        "TIDB_DATABASE": "your-database"
      }
    }
  }
}

環境変数

  • TIDB_HOST: TiDBサーバーのホスト名

  • TIDB_PORT: TiDBサーバーのポート番号(デフォルト: 4000)

  • TIDB_USERNAME: データベースユーザー名

  • TIDB_PASSWORD: データベースパスワード

  • TIDB_DATABASE: データベース名

必要条件

  • Python 3.10+

  • TiDB CloudまたはセルフホストTiDBインスタンス

  • Claude Desktop

ライセンス

MIT License

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with MySQL databases through tools for listing tables, querying table schemas, executing queries, viewing indexes, and analyzing query execution plans.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with MySQL databases through connection management, SQL execution, and schema exploration. It features multi-connection support and a safety-focused 'dangerous mode' for write operations.
      20 npm
      4
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to manage TiDB Cloud Serverless clusters, branches, and execute SQL queries through natural language.
      -