loading…
Search for a command to run...
loading…
Enables interaction with Power BI and Fabric through MCP tools, including workspace discovery and semantic model queries, with an agent loop and HTTP endpoints
Enables interaction with Power BI and Fabric through MCP tools, including workspace discovery and semantic model queries, with an agent loop and HTTP endpoints for Next.js backends.
Internal Node.js service for Power BI MCP access. It is designed to run beside a Next.js app, usually under PM2, and be called only from the Next.js server layer.
This project does not replicate the Google Ads MCP repo. It follows the same idea of a focused MCP backend, but it is tailored to Power BI/Fabric, direct JSON-RPC calls, and the agent/tool iteration already proven in the PBI bot POC.
powerbi-mcp.GET /healthPOST /internal/mcp/toolsPOST /internal/mcp/callPOST /internal/powerbi/catalogPOST /internal/chatPOST /internal/chat/jsonBrowser/proxy compatibility routes are also available under /api/*:
GET /api/auth/statusGET /api/auth/loginGET /api/auth/callbackGET /api/auth/logoutPOST /api/mcp/toolsPOST /api/mcp/callPOST /api/powerbi/catalogPOST /api/chatPOST /api/chat/jsonAll internal routes accept the user Power BI access token in one of these forms:
Authorization: Bearer <power-bi-access-token>x-powerbi-access-token: <power-bi-access-token>accessTokenIf INTERNAL_API_KEY is configured, also send:
x-internal-api-key: <your-internal-key>
cd powerbi-mcp
npm install
cp .env.example .env
npm run check
Fill .env with your LiteLLM/OpenAI-compatible gateway settings.
For the browser route, set your Azure redirect URI to the Next.js proxy callback, for example:
http://localhost:3000/auth/callback
npm run dev
The default service URL is http://127.0.0.1:3101.
pm2 start ecosystem.config.js
pm2 status
Expected process name:
powerbi-mcp
Keep the Next.js route files outside this backend repo. In this workspace they live in the sibling folder:
../powerbi-analyst-next-dropin/app
Copy those files into the real ads-next/app directory:
app/Power_BI_Analyst/page.tsxapp/api/powerbi-mcp/[...path]/route.tsThen browse to:
/Power_BI_Analyst
The Next.js proxy calls this backend at:
http://127.0.0.1:3101/api/*
Call this only from a server route, server action, or API handler. Do not expose the Power BI access token to browser-side code beyond your normal auth flow.
const response = await fetch("http://127.0.0.1:3101/internal/chat/json", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-internal-api-key": process.env.POWERBI_MCP_INTERNAL_API_KEY,
"Authorization": `Bearer ${powerBiAccessToken}`
},
body: JSON.stringify({
message: "Show total sales this month vs last month",
history: []
})
});
const data = await response.json();
For streaming UI responses, call /internal/chat or /api/chat; it returns server-sent events:
data: {"token":"..."}
data: [DONE]
/internal/* and browser session flow through /api/auth/*.127.0.0.1 in production unless you are intentionally putting this behind a private network boundary.INTERNAL_API_KEY before deploying so only trusted internal callers can use the service.Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"powerbi-mcp": {
"command": "npx",
"args": []
}
}
}