Local BI Assistant 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., "@Local BI Assistant MCP Servershow me monthly sales trends"
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.
Local BI Assistant
A fine-tuned local LLM for business intelligence that generates SQL queries from natural language, served via an MCP server.
No API costs. No data leaves your network. Runs entirely on your laptop.
Features
Fine-tuned Mistral 7B trained on your dbt schema and query history
MCP Server with 5 tools: query_data, suggest_visualization, get_insights, explore_schema, execute_sql
Local inference via Ollama - no external API calls
CI/CD integration - automatically retrain when your schema changes
Docker support - one-command setup for training and runtime
Related MCP server: MSSQL MCP Server
Architecture
Quick Start
Option 1: Docker (Recommended)
# Clone the repository
git clone https://github.com/janovincze/local_bi_assistant.git
cd local_bi_assistant
# Start the BI assistant (uses base Mistral model for testing)
docker compose up bi-assistant
# Or with development mode (hot reload)
docker compose --profile dev upOption 2: Local Setup with uv (Recommended for Mac)
uv is a fast Python package installer (10-100x faster than pip).
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and enter directory
git clone https://github.com/janovincze/local_bi_assistant.git
cd local_bi_assistant
# Create venv and install dependencies (with training support)
uv venv
uv sync --extra train-local
# Activate virtual environment
source .venv/bin/activate
# Build dbt models (creates sample database)
cd dbt_project && dbt build && cd ..
# Prepare training data
python -m training.scripts.prepare_data
# Train the model (QLoRA on Mac M4, ~2 hours)
python -m training.scripts.train_local
# Create Ollama model
ollama create bi-assistant -f output/mlx_lora/Modelfile
# Start MCP server
python -m mcp_server.serverOption 3: Local Setup with pip
# Clone and enter directory
git clone https://github.com/janovincze/local_bi_assistant.git
cd local_bi_assistant
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -e ".[train-local]"
# Build dbt models
cd dbt_project && dbt build && cd ..
# Prepare training data
python -m training.scripts.prepare_data
# Train the model (QLoRA on Mac M4)
python -m training.scripts.train_local
# Create Ollama model
ollama create bi-assistant -f output/mlx_lora/Modelfile
# Start MCP server
python -m mcp_server.serverUsing with Claude Desktop
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"bi-assistant": {
"command": "python",
"args": ["-m", "mcp_server.server"],
"cwd": "/path/to/local_bi_assistant",
"env": {
"DUCKDB_PATH": "./dbt_project/jaffle_shop.duckdb",
"BI_MODEL": "bi-assistant:latest"
}
}
}
}Available Tools
Tool | Description |
| Convert natural language to SQL and execute |
| Recommend chart types for data |
| Generate automated data insights |
| Discover tables and columns |
| Run SQL queries directly |
Training Your Own Model
Model Options
Model | Accuracy | Latency | Best For |
Fine-tuned Mistral | 100% | ~5s | General BI queries, complex reasoning |
Fine-tuned SQLCoder | 94% | ~7s | SQL-heavy workloads |
Base SQLCoder | 88% | ~2.5s | Quick queries, speed priority |
"Senior" Data Engineer* | ~80% | ~29 min | Coffee breaks |
*Based on 20+ interviews. Your fine-tuned 7B model might be their new colleague.
Note: 100% on sample schema; expect 93-95% on complex production schemas.
Train Mistral (Default)
python -m training.scripts.train_local
ollama create bi-assistant -f output/mlx_lora/ModelfileTrain SQLCoder (Alternative)
python -m training.scripts.train_sqlcoder
# Uses MLX with adapters - no Ollama model needed
# Automatically detected by MCP serverFrom Query History
Place your query logs in data/query_history/ in one of these formats:
JSON:
[{"question": "...", "sql": "..."}, ...]JSONL: One JSON object per line
SQL comments:
-- Q: question\n-- A:\nSELECT ...
python -m training.scripts.prepare_data \
--dbt-project ./dbt_project \
--query-logs ./data/query_history \
--output ./data/trainingCI/CD Integration
The included GitHub Actions workflow automatically retrains when:
dbt models change (
dbt_project/models/**)Training code changes (
training/**)
Configure secrets:
HF_TOKEN: Hugging Face API tokenWANDB_API_KEY: Weights & Biases key (optional)
Benchmarking
Compare model performance on your queries:
python scripts/benchmark_models.pyThis tests all available models (Ollama and MLX) against sample queries and reports accuracy and latency.
Memory Requirements
Operation | Memory |
Inference (4-bit) | ~5 GB |
QLoRA Training | ~7 GB |
Full Fine-tuning | ~16 GB (GPU) |
Works on Mac M4 with 24GB RAM.
License
MIT
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 Servers
- Flicense-quality-maintenanceEnables natural language querying of Microsoft Fabric Data Warehouses with intelligent SQL generation, metadata exploration, and business-friendly result summarization. Features two-layer architecture with MCP-compliant server and agentic AI reasoning for production-ready enterprise data access.
- AlicenseAquality-maintenanceEnables AI assistants to interact with both local SQL Server and Azure SQL Database through natural language, supporting queries, data manipulation, and schema operations with built-in security features.83,2821
- Alicense-qualityDmaintenanceAn AI-driven data visualization and SQL chat platform that enables natural language to SQL conversion, interactive chart generation, and database querying through a comprehensive MCP interface. Supports multiple databases, intelligent chart recommendations, and secure data management with temporary link sharing.0ISC
- Alicense-qualityDmaintenanceEnables AI assistants to query and analyze databases using natural language through MCP and HTTP API, supporting 17+ databases and integration with 50+ platforms.219MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
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/janovincze/local_bi_assistant'
If you have feedback or need assistance with the MCP directory API, please join our Discord server