Connects to Power BI datasets via ADOMD.NET client libraries to execute DAX queries and retrieve data
Uses GPT-4o-mini for AI-powered DAX query generation to translate natural language questions into DAX queries for Power BI
Power BI MCP Server 🚀
🎥 Live Demo
Transform your Power BI experience - ask questions in natural language and get instant insights from your data.
A Model Context Protocol (MCP) server that enables AI assistants to interact with Power BI datasets through natural language. Query your data, generate DAX, and get insights without leaving your AI assistant.
✨ Features
- 🔗 Direct Power BI Connection - Connect to any Power BI dataset via XMLA endpoints
- 💬 Natural Language Queries - Ask questions in plain English, get DAX queries and results
- 📊 Automatic DAX Generation - AI-powered DAX query generation using GPT-4o-mini
- 🔍 Table Discovery - Automatically explore tables, columns, and measures
- ⚡ Optimized Performance - Async operations and intelligent caching
- 🛡️ Secure Authentication - Service Principal authentication with Azure AD
- 📈 Smart Suggestions - Get relevant question suggestions based on your data
🎥 Demo
Ask questions like "What are total sales by region?" and get instant insights from your Power BI data.
🚀 Quick Start
Prerequisites
- Python 3.8 or higher
- Windows OS (required for ADOMD.NET)
- SQL Server Management Studio (SSMS) or ADOMD.NET client libraries
- Power BI Pro/Premium with XMLA endpoint enabled
- Azure AD Service Principal with access to your Power BI dataset
- OpenAI API key
Installation
- Clone the repository
- Install dependencies
- Configure environment variables
- Test the connection
Configure with Claude Desktop
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
📖 Usage
Once configured, you can interact with your Power BI data through Claude:
Connect to Your Dataset
Explore Your Data
Ask Questions
Execute Custom DAX
🔧 Configuration
Required Credentials
- Power BI XMLA Endpoint
- Format:
powerbi://api.powerbi.com/v1.0/myorg/WorkspaceName
- Enable in Power BI Admin Portal → Workspace Settings
- Format:
- Azure AD Service Principal
- Create in Azure Portal → App Registrations
- Grant access in Power BI Workspace → Access settings
- OpenAI API Key
- Get from OpenAI Platform
- Model used:
gpt-4o-mini
(200x cheaper than GPT-4)
Environment Variables
Create a .env
file:
🏗️ Architecture
Key Components
- PowerBIConnector - Handles XMLA connections and DAX execution
- DataAnalyzer - AI-powered query generation and interpretation
- PowerBIMCPServer - MCP protocol implementation
🔐 Security Best Practices
- Never commit credentials - Use
.env
files and keep them in.gitignore
- Use Service Principals - Avoid personal credentials
- Minimal permissions - Grant only necessary access to datasets
- Rotate secrets regularly - Update Service Principal secrets periodically
- Use secure connections - Always use HTTPS/TLS
🧪 Testing
Run the test suite:
Test specific functionality:
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📊 Performance
- Connection time: 2-3 seconds
- Query execution: 1-5 seconds depending on complexity
- Token usage: ~500-2000 tokens per query with GPT-4o-mini
- Cost: ~$0.02-0.06 per day for typical usage
🐛 Troubleshooting
Common Issues
- ADOMD.NET not found
- Install SQL Server Management Studio (SSMS)
- Or download ADOMD.NET
- Connection fails
- Verify XMLA endpoint is enabled in Power BI
- Check Service Principal has workspace access
- Ensure dataset name matches exactly
- Timeout errors
- Increase timeout in Claude Desktop config
- Check network connectivity to Power BI
See TROUBLESHOOTING.md for detailed solutions.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Anthropic for the MCP specification
- Microsoft for Power BI and ADOMD.NET
- OpenAI for GPT models
- The MCP community for inspiration and support
📬 Support
- 📧 Email: sulaimanahmed013@gmail.com
- 💬 Issues: GitHub Issues
- 📚 Docs: Full Documentation
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI assistants to interact with Power BI datasets through natural language, allowing users to query data, generate DAX, and get insights without leaving their AI assistant.
Related MCP Servers
- AsecurityAlicenseAqualityAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.Last updated -1580PythonMIT License
- -securityFlicense-qualityEnables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.Last updated -25JavaScript
- AsecurityAlicenseAqualityAI assistants to query and analyze Azure Data Explorer databases through standardized interfaces.Last updated -432PythonMIT License
- -securityFlicense-qualityEnables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.Last updated -JavaScript