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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。