Power Bi Analyst Mcp
@mbrummerstedt
Power Bi Analyst Mcp について
Connect Claude to your Power BI semantic models. Browse workspaces, tables, and measures, run DAX queries, and get results — with large datasets automatically saved to local CSV files to protect the LLM context window. Includes a query history log for cross-session reuse and audi
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"powerbi": {
"command": "uvx",
"args": [
"powerbi-analyst-mcp"
],
"env": {
"POWERBI_CLIENT_ID": "<YOUR_CLIENT_ID>",
"POWERBI_TENANT_ID": "<YOUR_TENANT_ID>"
}
}
}
}ツール
12Authenticate with Power BI using the OAuth 2.0 device code flow. Call this tool first if you have never logged in, or if a previous call returned "Not authenticated". The tool uses a two-step flow: - First call: returns a URL and a one-time code for you to open in a browser. - Second call: completes the authentication after you have signed in. Your credentials are cached locally so you will not need to repeat this step until the refresh token expires (~90 days).
Sign out of Power BI by clearing the cached credentials. After logging out, call `authenticate` to sign in again.
List all Power BI workspaces (groups) the authenticated user is a member of. Returns workspace id, name, type, and capacity information. Use the `id` field as `workspace_id` in subsequent tools.
List all datasets (semantic models) in a Power BI workspace. Returns dataset id, name, configured-by, web URL, is-refreshable flag, and the target storage mode (Import / DirectQuery / etc.). Use the `id` field as `dataset_id` in subsequent tools.
Return detailed metadata for a single Power BI dataset. Includes name, owner, refresh schedule, storage mode, web URL, and more. Also returns the last 5 refresh history entries so you can see data freshness.
List all visible tables in a Power BI dataset. Hidden tables and internal Power BI system tables (names starting with '$') are excluded. Use the returned table names in `list_measures`, `list_columns`, and DAX queries.
List measures defined in a Power BI dataset. Returns each measure's name, parent table, description, and format string. Optionally filter by table name.
List columns (dimensions) in a Power BI dataset. Returns each column's name, parent table, description, data type, and whether it is a key column. Optionally filter by table name.
Execute a DAX query against a Power BI dataset and return the result rows. The query must start with EVALUATE (standard DAX query syntax). Results are returned as a JSON array of objects, with column names as keys. Small results (<= 50 rows) are returned inline as JSON. Large results (> 50 rows) are automatically saved to a CSV file and a compact summary is returned with the file path, column names, row count, and a preview of the first 5 rows. Use `read_query_result` to page through a saved CSV, or read the file directly. Every successful execution is logged to a local history file for auditability and cross-session reuse. Use `search_query_history` to find prior queries. The `query_summary` parameter makes history search much more effective — always provide it when you can. Limitations imposed by the Power BI API: - Maximum 1,000,000 values or 100,000 rows per query. - Rate limit: 120 requests per minute per user. - Only DAX is supported; MDX and DMV queries are not. - The tenant setting "Dataset Execute Queries REST API" must be enabled. Tips: - Use TOPN or FILTER to limit large result sets. - Use SUMMARIZECOLUMNS for aggregated queries. - Use CALCULATETABLE for filtered table expressions. - Use max_rows to sample a large table without rewriting the DAX. - Use result_name to give the saved CSV a meaningful filename.
Read a page of rows from a CSV file saved by `execute_dax`. Use this tool when `execute_dax` returns a `savedTo` path instead of inline rows. Combine `offset` and `limit` to page through large results without loading the entire file into context. Returns rows for the requested slice together with pagination metadata: - totalRows: total number of rows in the file - offset: the offset used - limit: the limit used - hasMore: whether more rows exist after this page Example workflow: 1. Call `execute_dax` — if rows > 50 you get a savedTo path. 2. Call `read_query_result(file_path=savedTo, offset=0, limit=100)`. 3. If hasMore is true, call again with offset=100, then 200, etc.
Search the local query history log for prior DAX executions. Every successful `execute_dax` call is logged with the DAX query, a short summary of what the user asked for, the result shape, and the path to any saved CSV file. Use this tool to: - Find previous queries for a dataset so you can reuse or adapt the DAX - Locate saved CSV files from earlier sessions - Audit what data has been pulled and when - Avoid re-running expensive queries when the data already exists locally Results are returned newest-first. Use `keyword` to search by intent (e.g. "revenue by market") — it matches against the query summary, the DAX text, and the result name.
Remove a single entry from the query history log. Use this when a query produced incorrect or misleading results and should not appear in future history searches. The associated CSV file (if any) is NOT deleted — only the log entry is removed.
概要
What is Power Bi Analyst Mcp?
Power Bi Analyst Mcp enables LLMs to analyze Power BI data by connecting to the Power BI REST API via OAuth device code flow. It runs locally on your machine, allowing an agent to explore semantic models and execute DAX queries. The server provides 12 tools for authentication, browsing workspaces/datasets/tables/measures/columns, executing DAX, paginating results, searching query history, and deleting log entries.
How to use Power Bi Analyst Mcp?
You need an Azure AD app registration with Dataset.Read.All and Workspace.Read.All permissions. A 5-minute setup guide is available in the README. After configuration, run the server locally; the LLM can then invoke the provided tools to interact with your Power BI environment.
Use cases of Power Bi Analyst Mcp
- Ask an LLM to analyze Power BI semantic models and datasets.
- Execute and iterate DAX queries with automatic pagination of large results.
- Browse workspaces, datasets, tables, measures, and columns through natural language.
- Search and review query history across sessions for auditing or reproducibility.
- Delete specific log entries from the query history.
FAQ from Power Bi Analyst Mcp
How does Power Bi Analyst Mcp handle large query results?
Queries returning more than 50 rows are automatically saved to a local CSV file. The agent receives a compact summary and can page through the results on demand.
Where is my data stored and is it secure?
All tokens are stored in OS-native secure storage (Keychain on macOS, DPAPI on Windows, LibSecret on Linux). Queries and logs are written to a local JSONL file; no data is relayed through a cloud service.
What dependencies or runtime are required?
The server depends on an Azure AD app registration with the appropriate Power BI permissions. The README provides a 5-minute setup for this registration.
What authentication transport is used?
Authentication uses the OAuth device code flow, which allows the user to sign in via a browser without exposing credentials directly to the tool.
Does the server support query history?
Yes, every DAX execution is logged to a JSONL file containing the user’s intent, the DAX query, output columns, and the CSV file path. The history is searchable across sessions.
「データと分析」の他のコンテンツ
MCP Simple PubMed
andybrandtMCP server for searching and querying PubMed medical papers/research database
Deep Research
u14appUse any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
🎓 Semantic Scholar MCP Server
JackKuo666🔍 This project implements a Model Context Protocol (MCP) server for interacting with the Semantic Scholar API. It provides tools for searching papers, retrieving paper and author details, and fetching citations and references.
dbt MCP Server
dbt-labsA MCP (Model Context Protocol) server for interacting with dbt.
MCP.science: Open Source MCP Servers for Scientific Research 🔍📚
pathintegral-instituteOpen Source MCP Servers for Scientific Research
コメント