pbixray-mcp-server

Integrations

  • Used as a dependency for data processing operations in the PBIXRay server, supporting statistical analysis and data manipulation of Power BI models.

PBIXRay MCP サーバー

PBIXRay 用のモデル コンテキスト プロトコル(MCP) サーバー。

この MCP サーバーは、LLM クライアントが Power BI (.pbix) ファイルと対話するためのツールおよびリソースとしてPBIXRayの機能を公開します。

特徴

  • [x] PBIXファイルの読み込みと分析
  • [x] データモデルの探索
    • [x] モデル内のテーブルの一覧表示
    • [x] モデルメタデータの取得
    • [x] モデルサイズの確認
    • [x] モデル統計の取得
    • [x] 包括的なモデル概要を取得する
  • [x] クエリ言語アクセス
    • [x] Power Query (M) コードの表示
    • [x] Mパラメータへのアクセス
    • [x] DAX計算テーブルの探索
    • [x] DAXメジャーの表示
    • [x] DAX計算列の調査
  • [x] データ構造解析
    • [x] スキーマ情報の取得
    • [x] テーブルの関係を分析する
    • [x] ページネーションを使用して表の内容にアクセスする

ツールリストは設定可能なので、MCPクライアントで利用できるようにするツールを選択できます。これは、特定の機能を使用しない場合や、機密情報を公開したくない場合に便利です。

ツール

道具カテゴリ説明
load_pbix_fileコア分析用に Power BI (.pbix) ファイルを読み込む
get_tablesモデルモデル内のすべてのテーブルを一覧表示する
get_metadataモデルPower BI 構成に関するメタデータを取得する
get_power_queryクエリデータ変換に使用されるすべての M/Power Query コードを表示します
get_m_parametersクエリすべてのMパラメータ値を表示
get_model_sizeモデルモデルのサイズをバイト単位で取得する
get_dax_tablesクエリDAX 計算テーブルを表示する
get_dax_measuresクエリテーブルまたはメジャー名でフィルタリングして DAX メジャーにアクセスする
get_dax_columnsクエリフィルター オプションを使用して計算列の DAX 式にアクセスする
get_schema構造データモデルのスキーマと列タイプの詳細を取得します
get_relationships構造データモデルの関係の詳細を取得する
get_table_contentsデータ指定されたテーブルの内容を取得し、ページ区切りで表示する
get_statisticsモデルオプションのフィルタリングを使用してモデルに関する統計情報を取得します
get_model_summaryモデル現在の Power BI モデルの包括的な概要を取得します

使用法

WSL(推奨)

サーバー設定をクライアント設定ファイルに追加します。例えば、Claude Desktopの場合は以下のようになります。

{ "mcpServers": { "pbixray": { "command": "wsl.exe", "args": [ "bash", "-c", "source ~/dev/pbixray-mcp/venv/bin/activate && python ~/dev/pbixray-mcp/src/pbixray_server.py" ] } } }

WSL パス変換 (例: Claude Project の手順)

Windows 上の Claude Desktop で WSL の PBIXRay MCP サーバーを使用する場合、PBIX ファイルの読み込み時にパスの違いに注意する必要があります。Windows パス ( C:\Users\name\file.pbixなど) は WSL から直接アクセスできません。プロジェクトの指示などに「MCP サーバーは WSL で実行されています。Windows パス (C:\Users\name\file.pbix など) は WSL から直接アクセスできません。ファイルを参照する際は、代わりに WSL パスを使用してください。Windows: C:\Users\name\Downloads\file.pbix WSL: /mnt/c/Users/name/Downloads/file.pbix」という記述を追加することで、AI アシスタントにパス間の変換方法を知らせることができます。

コマンドラインオプション

サーバーはいくつかのコマンドライン オプションをサポートしています。

  • --disallow [tool_names] : セキュリティ上の理由から特定のツールを無効にする
  • --max-rows N : 返される行の最大数を設定します(デフォルト: 100)
  • --page-size N : ページ分割された結果のデフォルトのページサイズを設定します(デフォルト: 20)

必要に応じて、config json にコマンドライン オプションを追加できます。

{ "mcpServers": { "pbixray": { "command": "wsl.exe", "args": [ "bash", "-c", "source ~/dev/pbixray-mcp/venv/bin/activate && python ~/dev/pbixray-mcp/src/pbixray_server.py --max-rows 100 --page-size 50 --disallow get_power_query" ], "env": {} } } }

クエリオプション

ツールはフィルタリングとページ区切りの追加パラメータをサポートします。

名前によるフィルタリング

get_dax_measuresget_dax_columnsget_schemaなどのツールは、特定の名前によるフィルタリングをサポートしています。

# Get measures from a specific table get_dax_measures(table_name="Sales") # Get a specific measure get_dax_measures(table_name="Sales", measure_name="Total Sales")
大きな表のページネーション

get_table_contentsツールは、大きなテーブルを効率的に処理するためのページ区切りをサポートしています。

# Get first page of Customer table (default 20 rows per page) get_table_contents(table_name="Customer") # Get second page with 50 rows per page get_table_contents(table_name="Customer", page=2, page_size=50)

開発とテスト

PBIXRay MCP サーバーをインストールできます:

pip install pbixray-mcp-server

開発インストール

プロジェクトに取り組んでいる開発者向け:

  1. リポジトリをクローンします。
    git clone https://github.com/username/pbixray-mcp.git cd pbixray-mcp
  2. 開発モードでインストールします:
    pip install -e .
  3. ソースからインストールする場合は、仮想環境を作成し、依存関係をインストールします。
    python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install mcp pbixray numpy

サンプルファイルを使ったテスト

リポジトリには、作業を開始するのに役立つサンプル ファイルとテスト スクリプトが含まれています。

# Test with sample AdventureWorks Sales.pbix file in demo/ folder python tests/test_with_sample.py # Try the interactive demo python examples/demo.py # For isolated tests of specific features python test_pagination.py python test_metadata_fix.py

テスト スクリプトはdemo/ディレクトリに提供されているサンプル PBIX ファイルを使用してサーバーと対話する方法を理解するのに役立ちます。

開発モード

開発中にサーバーをテストするには、MCP Inspector を使用します。

# Activate your environment first source venv/bin/activate # Run the MCP Inspector mcp dev src/pbixray_server.py

これにより、ツールを呼び出して応答をテストできる対話型セッションが開始されます。

プロジェクト構造

pbixray-mcp/ ├── README.md - This file ├── INSTALLATION.md - Detailed installation instructions ├── src/ - Source code │ ├── __init__.py │ └── pbixray_server.py ├── tests/ - Test scripts │ ├── __init__.py │ ├── conftest.py │ ├── test_server.py │ └── test_with_sample.py ├── examples/ - Example scripts and configs │ ├── demo.py │ └── config/ ├── demo/ - Sample PBIX files │ ├── README.md │ └── AdventureWorks Sales.pbix └── docs/ - Additional documentation └── ROADMAP.md

貢献

貢献は大歓迎です!

クレジット

  • Hugoberry - オリジナルPBIXRayライブラリ
  • rusiaaman - WCGW (この MCP は Claude によって wcgw を使用して完全に記述されました)

ライセンス(クロードはこれを追加することを主張しています)

MITライセンス

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

PBIXRay Python パッケージを通じてメタデータをクエリすることで、AI クライアントが PowerBI モデルと対話できるようにするモデル コンテキスト プロトコル。

  1. 特徴
    1. ツール
      1. 使用法
        1. WSL(推奨)
          1. WSL パス変換 (例: Claude Project の手順)
          2. コマンドラインオプション
          3. クエリオプション
        2. 開発とテスト
          1. 開発インストール
          2. サンプルファイルを使ったテスト
          3. 開発モード
          4. プロジェクト構造
        3. 貢献
          1. クレジット
            1. ライセンス(クロードはこれを追加することを主張しています)

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that provides seamless interaction with Workato's API through custom AI tools, enabling management of recipes, connections, connectors, folders, and activity logs.
                Last updated -
                TypeScript
                MIT License
                • Apple
                • Linux
              • A
                security
                F
                license
                A
                quality
                Implements the Model Context Protocol to allow AI models to access and interact with blockchain data, including reading contract states, retrieving events, and accessing transaction information across various networks.
                Last updated -
                10
                45
                30
                TypeScript
              • -
                security
                A
                license
                -
                quality
                A streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.
                Last updated -
                12
                Python
                MIT License
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI models to create and manipulate PowerPoint presentations with advanced features like financial charts, formatting, and template management.
                Last updated -
                1
                Python

              View all related MCP servers

              ID: vibjpsvwgs