EP

enelyse/powerbi-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

27 stars 7 forks Качество 72 Тренд 11MIT

MCP-сервер для управления Power BI Desktop через Claude

Обзор

API и поведение могут меняться без предварительного уведомления. Power BI Desktop MCP Server позволяет Клоду (или любому клиенту MCP) общаться с запущенным экземпляром Power BI Desktop, используя естественный язык. Он соединяет протокол Model Context с моделью Tabular Object Model, чтобы вы могли проверять, оптимизировать и создавать DAX, не выходя из чата. Пошаговая настройка (предпосылки Power BI, библиотеки .NET, переменные среды) живет в INSTALLATION.md. Перечислите таблицы в вашей текущей модели Power BI: Скопируйте .env.example в .env и установите TOM DLL PATH, если DLL служб анализа Microsoft не обнаружены автоматически. Дополнительные переменные включают LOG LEVEL, MCP KNOWLEDGE BASE и POWERBI WORKSPACE NAME. - Добавить точку входа CLI в Claude Desktop (или любой хост MCP): CLI - это тонкая обертка вокруг Python -m powerbi mcp. Сервер, поэтому любой вызов работает для развертывания и отладки.

Обзор (машинный перевод)

Альфа-версия ** - API и поведение могут изменяться без уведомления.

Power BI Desktop MCP Server позволяет Клоду (или любому клиенту MCP) общаться с запущенным экземпляром Power BI Desktop, используя естественный язык. Он соединяет протокол Model Context с моделью Tabular Object Model, чтобы вы могли проверять, оптимизировать и создавать DAX, не выходя из чата.

##Установка

Пошаговая настройка (предпосылки Power BI, библиотеки .NET, переменные среды) живет в INSTALLATION.md.

Для местного развития:

Быстрый пример

Перечислите таблицы в вашей текущей модели Power BI:

Меры по экспорту в базу знаний:

Запустите оптимизатор по выражению:

Конфигурация

Копировать .env.example в .env и устанавливать TOM_DLL_PATH, если DLL служб анализа Microsoft не обнаружены автоматически. Необязательные переменные включают LOG_LEVEL, MCP_KNOWLEDGE_BASE и POWERBI_WORKSPACE_NAME. Добавьте точку входа CLI в Claude Desktop (или любой MCP-хост):

CLI - это тонкая обертка вокруг python -m powerbi_mcp.server, поэтому любой вызов работает для развертывания и отладки.

Особенности

  • генерация кода DAX и создание измерений
  • Проверка метаданных по мерам и таблицам Оптимизатор DAX с предложениями на основе правил

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Power BI Desktop MCP Server

⚠️ Alpha version – APIs and behaviours may change without notice.

Power BI Desktop MCP Server lets Claude (or any MCP client) talk to a running Power BI Desktop instance using natural language. It bridges the Model Context Protocol to the Tabular Object Model so you can inspect, optimize, and author DAX without leaving chat.

Installation

Step-by-step setup (Power BI prerequisites, .NET libraries, environment variables) lives in INSTALLATION.md.

For local development:

pip install -e .
# or install from the current directory:
pip install .

Quick Example

List the tables in your current Power BI model:

python examples/list_model_info.py --include-columns

Export measures to the knowledge base:

python examples/export_measures_to_knowledge_base.py --project "Executive Dashboard"

Run the optimizer on an expression:

python examples/optimize_dax.py --expr "CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Date), Date[Year] = 2024))"

Configuration

  • Copy .env.example to .env and set TOM_DLL_PATH if the Microsoft Analysis Services DLLs are not auto-detected. Optional variables include LOG_LEVEL, MCP_KNOWLEDGE_BASE, and POWERBI_WORKSPACE_NAME.

  • Add the CLI entry point to Claude Desktop (or any MCP host):

    {
      "mcpServers": {
        "powerbi": {
          "command": "powerbi-mcp-server",
          "args": []
        }
      }
    }
    
  • The CLI is a thin wrapper around python -m powerbi_mcp.server, so either invocation works for deployments and debugging.

Features

  • DAX code generation and measure creation
  • Measure and table metadata inspection
  • DAX optimizer with rule-based suggestions
  • TMDL import/export helpers
  • Knowledge base bridge for storing curated measures
  • Example scripts for quick automation (examples/ directory)

Known Issues

  • Power BI visuals live outside the XMLA endpoint, so visual creation/editing is not supported.
  • The server connects to the most recently opened Power BI Desktop workspace; multiple instances are not yet multiplexed.
  • Write operations require the Power BI model to allow external tools and, in some scenarios, elevated permissions.
  • pythonnet relies on local Microsoft Analysis Services DLLs; misconfigured TOM_DLL_PATH is the most common setup failure.

Contributing

Pull requests are welcome. Please:

  1. Open an issue describing the change if it alters behaviour or APIs.
  2. Keep additions formatted with ruff/black style conventions (if configured) and include type hints.
  3. Add or update example scripts/tests where it helps illustrate new functionality.
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "powerbi": { "command": "powerbi-mcp-server", "args": [] } } }