PowerBI MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PowerBI MCP Servershow me my Power BI workspaces"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PowerBI MCP Server
A full-featured Model Context Protocol (MCP) server for integration with Microsoft Power BI via the Azure AD API.
๐ฏ Features
๐ READ Operations (7 tools):
get_workspaces- Retrieve a list of all available workspacesget_datasets- Retrieve a list of datasets (with optional filtering by workspace)get_reports- Retrieve a list of reports (with optional filtering by workspace)get_dataset_tables- Retrieve the table structure of a datasetquery_dataset- Execute DAX queries against a datasetrefresh_dataset- Trigger a dataset refreshget_refresh_history- Retrieve dataset refresh history
๐๏ธ WORKSPACE Management (3 tools):
create_workspace- Create new workspacesdelete_workspace- Delete workspacesadd_workspace_user- Add users with access permissions
๐ DATASET Management (3 tools):
create_dataset- Create datasets with tables and schemadelete_dataset- Delete datasetsupdate_dataset- Update dataset configuration
๐๏ธ TABLE Management (3 tools):
create_table- Create tables in datasetsdelete_table- Delete tablesupdate_table- Modify table structure
๐ COLUMN Management (3 tools):
add_column- Add columns with data typesdelete_column- Delete columnsupdate_column- Change column properties
๐งฎ MEASURE Management (3 tools):
create_measure- Create calculated measures (DAX)delete_measure- Delete measuresupdate_measure- Update DAX expressions
๐ REPORT Management (3 tools):
create_report- Create new reportsdelete_report- Delete reportsclone_report- Clone reports
๐ฅ DATA Import (2 tools):
add_table_rows- Add data to tablesclear_table_rows- Clear table data
๐ GATEWAY Management (2 tools):
get_gateways- Retrieve a list of gatewaysget_gateway_datasources- Retrieve gateway data sources
TOTAL: 28 full-featured MCP tools for complete PowerBI management!
Supported features:
โ Full PowerBI management: from workspace creation to adding visualizations
โ Authentication via Azure AD (Service Principal)
โ Automatic token refresh
โ Comprehensive error handling and logging
โ CRUD operations for all core entities
โ DAX query execution and calculated measures
โ Data import and table management
โ Gateway integration for external data sources
โ Workspace and permissions management
๐ Requirements
Node.js 18+
TypeScript
A registered application in Azure AD
Permissions for the Power BI API
๐ Installation
1. Clone and install dependencies
git clone <repository-url>
cd powerbi_mcp_server
npm install2. Configure the Azure AD Application
Go to Azure Portal โ App registrations
Create a new application or use an existing one
In the "API permissions" section, add:
Power BI Service permissions:
Dataset.Read.AllDataset.ReadWrite.AllReport.Read.AllWorkspace.Read.All
Microsoft Graph (optional):
User.Read
In the "Certificates & secrets" section, create a new client secret
Copy the Application (client) ID, Directory (tenant) ID, and client secret
3. Configure environment variables
Copy .env.example to .env and fill it in:
cp .env.example .envEdit .env:
# Azure AD Configuration
AZURE_CLIENT_ID=your_application_client_id
AZURE_CLIENT_SECRET=your_client_secret
AZURE_TENANT_ID=your_tenant_id
# PowerBI API Configuration
POWERBI_API_URL=https://api.powerbi.com/v1.0/myorg
# Logging
LOG_LEVEL=info4. Build the project
npm run build๐ฎ Usage
Starting the server
npm start
# ะธะปะธ ะดะปั development:
npm run devIntegration with Claude Desktop
Add the following to the Claude Desktop configuration file:
{
"mcpServers": {
"powerbi": {
"command": "node",
"args": ["/path/to/powerbi_mcp_server/build/index.js"],
"env": {
"AZURE_CLIENT_ID": "your_client_id",
"AZURE_CLIENT_SECRET": "your_client_secret",
"AZURE_TENANT_ID": "your_tenant_id"
}
}
}
}Use in MCP-compatible clients
After connecting, the following tools are available:
Retrieve workspaces
get_workspaces()Retrieve datasets
get_datasets(workspace_id?: string)Execute a DAX query
query_dataset(
dataset_id: "your-dataset-id",
dax_query: "EVALUATE VALUES('Table'[Column])",
workspace_id?: "workspace-id"
)Create a new dataset with a table
create_dataset(
name: "Sales Dataset",
tables: [{
name: "Sales",
columns: [
{ name: "Date", dataType: "Datetime" },
{ name: "Amount", dataType: "Double" },
{ name: "Product", dataType: "String" }
],
measures: [{
name: "Total Sales",
expression: "SUM(Sales[Amount])",
formatString: "Currency"
}]
}],
workspace_id?: "workspace-id"
)Add data to a table
add_table_rows(
dataset_id: "dataset-id",
table_name: "Sales",
rows: [
["2024-01-01", 1000, "Product A"],
["2024-01-02", 1500, "Product B"]
],
workspace_id?: "workspace-id"
)๐ Usage examples
Example 1: Retrieve all workspaces
// Tool call: get_workspaces
// Response:
{
"success": true,
"data": [
{
"id": "workspace-guid",
"name": "My Workspace",
"isReadOnly": false,
"isOnDedicatedCapacity": true
}
],
"count": 1
}Example 2: DAX query
// Tool call: query_dataset
{
"dataset_id": "dataset-guid",
"dax_query": "EVALUATE TOPN(10, 'Sales', 'Sales'[Amount], DESC)",
"workspace_id": "workspace-guid"
}
// Response:
{
"success": true,
"data": {
"tables": [
{
"rows": [
["Product A", 1000],
["Product B", 800]
]
}
]
}
}๐ง Development
Project structure
src/
โโโ auth.ts # Azure AD authentication
โโโ powerbi-client.ts # PowerBI REST API client
โโโ server.ts # MCP server implementation
โโโ types.ts # TypeScript interfaces
โโโ logger.ts # Logging configuration
โโโ index.ts # Entry pointDevelopment commands
npm run build # ะกะฑะพัะบะฐ TypeScript
npm run dev # Development ัะตะถะธะผ
npm start # Production ะทะฐะฟััะบ๐ก๏ธ Security
โ Secure token storage and automatic refresh
โ Credentials or tokens are never logged
โ Validation of all incoming parameters
โ HTTPS for all API calls
โ Error handling for all scenarios
๐ Logging
The server uses Winston for logging. The logging level is configured via the LOG_LEVEL environment variable:
error- errors onlywarn- warnings and errorsinfo- informational messages (default)debug- detailed debug information
โ Troubleshooting
Issue: "Authentication failed"
Solution: Check the correctness of the Azure AD credentials and permissions
Issue: "Dataset not found"
Solution: Make sure the service principal has access to the workspace/dataset
Issue: "DAX query failed"
Solution: Check the DAX query syntax and access permissions for the dataset
Issue: "MCP connection failed"
Solution: Make sure the server is running correctly and is accessible via stdio
๐ Additional resources
๐ License
ISC License
๐ค Contributing
Pull requests and issue reports are welcome. Before making changes:
Make sure all tests pass
Follow the project's code style
Update the documentation if necessary
Created for the Model Context Protocol ecosystem ๐
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Project portfolio management for PMOs. Alternative to Microsoft Project Online. OAuth + PAT.
*Updated June 17th 2025** Manage your Microsoft 365 services effortlessly. Create and manage distrโฆ
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mavline/powerbi_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server