powerbi-mcp
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.
README
powerbi-mcp
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.
What It Does
- Calls the Fabric Power BI MCP endpoint with a user bearer token.
- Lists and executes MCP tools through JSON-RPC.
- Discovers Power BI workspaces and semantic models for better model prompts.
- Runs an OpenAI-compatible agent loop that can call Power BI MCP tools.
- Exposes internal HTTP endpoints for a Next.js backend.
- Ships with a PM2 process config named
powerbi-mcp.
Endpoints
GET /healthPOST /internal/mcp/toolsPOST /internal/mcp/callPOST /internal/powerbi/catalogPOST /internal/chatPOST /internal/chat/json
Browser/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/json
All 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>- JSON body field
accessToken
If INTERNAL_API_KEY is configured, also send:
x-internal-api-key: <your-internal-key>
Install
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
Run Locally
npm run dev
The default service URL is http://127.0.0.1:3101.
Run With PM2
pm2 start ecosystem.config.js
pm2 status
Expected process name:
powerbi-mcp
Next.js Drop-In Route
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.ts
Then browse to:
/Power_BI_Analyst
The Next.js proxy calls this backend at:
http://127.0.0.1:3101/api/*
Next.js Server Example
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]
Notes
- This service supports both token-forwarding through
/internal/*and browser session flow through/api/auth/*. - Bind to
127.0.0.1in production unless you are intentionally putting this behind a private network boundary. - Set
INTERNAL_API_KEYbefore deploying so only trusted internal callers can use the service.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.