QueryForge
Allows querying and exploring any SQLite database, including listing tables, describing schemas, and running read-only SELECT queries.
Enables creating and managing live Streamlit dashboards directly from conversation, including writing dashboard code, installing dependencies, and launching the dashboard.
Click on "Deploy 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., "@QueryForge list all tables in the database"
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.
streamlit-dashboard-mcpserver
QueryForge — Talk to your database. Watch it become a dashboard.
A unified Model Context Protocol server that lets Claude query any SQLite database, retrieve enterprise-specific business logic from a knowledge base, and build live Streamlit dashboards — all from a single conversation.
Project Structure
streamlit-dashboard-mcpserver/
├── .venv/ # Python virtual environment (managed by uv)
├── data/
│ ├── seed.py # Generates the sample CRM database
│ └── database.db # SQLite database (generated by seed.py)
├── knowledge_base/
│ ├── docs/ # Source documents (formulas, business rules, definitions)
│ ├── ingest.py # Chunks + embeds docs into the vector store
│ └── index/ # Persisted vector store (generated by ingest.py)
├── .python-version # Pinned Python version for uv
├── dashboard.py # Auto-generated by Claude at runtime
├── server.py # The MCP server
├── uv.lock # Dependency lock file
└── README.mdRelated MCP server: TheMCP-server
What it does
Tool | Description |
| List all tables in the database |
| Show columns, types, and constraints for a table |
| Return the first N rows of any table |
| Run read-only SELECT queries |
| Retrieve relevant chunks from enterprise docs (custom calculation formulas, business rules, metric definitions) to help Claude write correct queries and dashboard logic |
| Write a Streamlit app, auto-install deps, and launch it |
| Stop the running Streamlit process |
| Check if the dashboard is running and on which port |
| Read the current dashboard.py source |
Read-only enforced. INSERT, UPDATE, DELETE, DROP and all other write operations are blocked at the server level. The knowledge base is retrieval-only — Claude cannot write back to it through this server.
query_knowledge_base is what makes dashboards correct, not just plausible. Instead of guessing at how your organization defines something like "net revenue" or "active customer," Claude retrieves the actual documented formula from your chunked enterprise docs before writing SQL or dashboard code.

Prerequisites
Python 3.11+ (pinned via
.python-version)uv — already used in this project (see
uv.lock)Claude Desktop
A folder of source documents for the knowledge base (PDF, Markdown, or plain text — e.g. your internal formula sheets, metric glossaries, or SOPs)
Installation
1. Install Claude Desktop
Download and install Claude Desktop for your OS: Windows / macOS: https://claude.ai/download Sign in with your Anthropic account after installing.
2. Clone the repository
HTTPS:
git clone https://github.com/your-username/streamlit-dashboard-mcpserver.git
cd streamlit-dashboard-mcpserverSSH:
git clone git@github.com:your-username/streamlit-dashboard-mcpserver.git
cd streamlit-dashboard-mcpserverGitHub CLI:
gh repo clone your-username/streamlit-dashboard-mcpserver
cd streamlit-dashboard-mcpserver3. Set up the environment with uv
This project uses uv for environment management. The .python-version and uv.lock files are already committed, so setup is a single command.
Install uv if you don't have it:
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Create the virtual environment and install all dependencies from the lock file:
uv syncActivate the environment:
# Windows PowerShell
.venv\Scripts\Activate.ps1
# Windows CMD
.venv\Scripts\activate.batYou will see the project name in your prompt when active:
(streamlit-dashboard-mcpserver) PS C:\Users\benij\ds_project\streamlit-dashboard-mcpserver>Verify key packages are installed:
pip list | findstr "mcp streamlit"If anything is missing:
uv pip install mcp streamlit pandas plotly4. Generate the database
The seed.py script inside data/ generates a realistic CRM database with 10,000+ records across a full snowflake schema.
cd data
python seed.py
cd ..This creates data/database.db which is what the MCP server reads from.
5. Build the knowledge base index
Drop your enterprise documents (formula sheets, metric definitions, business rules — PDF, Markdown, or .txt) into knowledge_base/docs/, then run:
python knowledge_base/ingest.pyThis chunks and embeds the documents, and writes the resulting vector store to knowledge_base/index/. This is what query_knowledge_base reads from at runtime — rerun this script any time the source documents change.
6. Configure Claude Desktop
Claude Desktop reads MCP server definitions from a JSON config file.
Open the config file:
notepad $env:APPDATA\Claude\claude_desktop_config.jsonIf the file does not exist yet, Notepad will ask to create it — click Yes.
Paste the following config, replacing benij with your Windows username if different:
{
"mcpServers": {
"sqlite-dashboard": {
"command": "C:\\Users\\benij\\ds_project\\streamlit-dashboard-mcpserver\\.venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\benij\\ds_project\\streamlit-dashboard-mcpserver\\server.py"
],
"env": {
"DB_PATH": "C:\\Users\\benij\\ds_project\\streamlit-dashboard-mcpserver\\data\\database.db",
"DASHBOARD_PORT": "8501",
"KB_INDEX_PATH": "C:\\Users\\benij\\ds_project\\streamlit-dashboard-mcpserver\\knowledge_base\\index"
}
}
}
}To confirm your exact Python path, with the venv active run:
where.exe pythonExpected output:
C:\Users\benij\ds_project\streamlit-dashboard-mcpserver\.venv\Scripts\python.exeUse that exact string as the command value in the config.
Always use absolute paths. Claude Desktop launches the MCP server as a subprocess from an unpredictable working directory — relative paths will not resolve correctly.
7. Restart Claude Desktop
After saving the config, fully quit Claude Desktop — right-click the system tray icon → Quit. Then reopen it.
When it restarts, click the 🔨 hammer icon in the bottom-left of the chat input. You should see all 9 tools listed, confirming the server is connected.
Usage
Once connected, talk to Claude naturally:
"What tables are in my database?"
"How do we define 'net revenue' internally?"
"Show me the top 10 customers by total revenue, using our
company's official revenue formula"
"Build a dashboard with monthly sales trends, a bar chart
by product category, and a salesperson leaderboard"Claude will explore the schema, pull relevant business logic from the knowledge base when needed, run queries, write the Streamlit code, install any missing dependencies, and return a URL to open in your browser — http://localhost:8501 by default.
Environment Variables
Set these in the env block of your claude_desktop_config.json:
Variable | Default | Description |
|
| Absolute path to your SQLite database |
|
| Port Streamlit will listen on |
|
| Absolute path to the vector store built by |
Troubleshooting
🔨 Hammer icon not showing in Claude Desktop Config JSON is likely invalid — trailing commas and mismatched brackets are common mistakes. Paste it into jsonlint.com to validate. Always fully quit and reopen Claude Desktop after any config change.
"Database not found" error
Confirm DB_PATH is an absolute path and database.db exists inside the data/ folder. Run seed.py if it hasn't been generated yet.
query_knowledge_base returns no results / empty index
Confirm knowledge_base/docs/ actually has documents in it, then rerun python knowledge_base/ingest.py. Confirm KB_INDEX_PATH in your config points to knowledge_base/index/.
Streamlit page not loading
Ask Claude "is the dashboard running?" to call get_dashboard_status. If it's not running, ask Claude to create_dashboard again. Also check that port 8501 isn't already in use by another process.
uv sync fails
Make sure your installed Python version matches .python-version. Run python --version to check, and install the correct version from python.org if needed.
PowerShell ExecutionPolicy error when activating .venv
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThen activate again.
About
An MCP server that turns natural language into SQL queries and live, business-logic-aware Streamlit dashboards, powered by Claude and a retrieval-augmented knowledge base of enterprise-specific rules and formulas.
Available Tools
10 toolscreate_dashboardB
Creates or updates the Streamlit dashboard with the given Python code.
Automatically installs missing dependencies and starts/reloads the app.
IMPORTANT: The variable DB_PATH is automatically injected at the top of
your code — always connect to the database using:
conn = sqlite3.connect(DB_PATH)
Never hardcode a database path string yourself.
Args:
code: Full Python source code for the Streamlit dashboard
Inputs: code (required). Returns: result
describe_tableC
Show column names, types, and constraints for a table.
Args:
table: Name of the table to describe
Inputs: table (required). Returns: result
get_dashboard_statusA
Returns whether the Streamlit dashboard is running and on which port.
Inputs: no named parameters. Returns: result
knowledge_base_infoA
Returns metadata about the current knowledge base:
total chunks, unique sources, collection name, embedding model.
Useful to verify that PDF ingestion completed successfully.
Inputs: no named parameters. Returns: result
knowledge_searchA
Semantic search over the ingested PDF knowledge base.
Pipeline:
1. Bi-encoder retrieval from ChromaDB (fast ANN search, top_k_retrieve candidates)
2. Cross-encoder reranking (precise pointwise scoring)
3. Custom composite metric computation (cosine + rerank + keyword + density)
4. Returns top_k_return chunks ranked by composite score with full metrics
The composite_score field is the primary relevance signal you should use when
deciding how much to trust each chunk. Scores > 0.7 are highly relevant.
Args:
query: Natural-language question or search phrase
top_k_retrieve: Number of candidates to fetch from the vector DB (default 20)
top_k_return: Number of final results to return after reranking (default 5)
filter_source: Optional — filter by PDF filename (e.g. "report.pdf")
Inputs: query (required), top_k_return, filter_source, top_k_retrieve. Returns: result
list_tablesA
List all tables in the SQLite database.
Inputs: no named parameters. Returns: result
query_databaseB
Run a SELECT query against the SQLite database.
Only read-only SELECT statements are allowed.
Args:
sql: A valid SQLite SELECT statement
Inputs: sql (required). Returns: result
read_dashboardB
Returns the current contents of dashboard.py.
Inputs: no named parameters. Returns: result
sample_tableB
Return the first N rows of a table (default 5, max 50).
Args:
table: Name of the table to sample
limit: Number of rows to return (default 5, max 50)
Inputs: table (required), limit. Returns: result
stop_dashboardB
Stops the running Streamlit dashboard process.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource and action: table introspection (list/describe/sample), read-only querying, dashboard lifecycle management, and knowledge-base retrieval. Boundaries are clear, and the read-only query tool is explicitly separated from the preview/schema helpers.
Most tools use a predictable verb_noun pattern (list_tables, describe_table, sample_table, query_database, create_dashboard, stop_dashboard, read_dashboard). However knowledge_search and knowledge_base_info flip to a noun_verb/compound form, a minor deviation from the dominant convention.
Ten tools is well-scoped, and each earns its place within its functional group. It does span three distinct concerns (SQLite querying, Streamlit dashboard, knowledge base), which is slightly broad but still justified.
Dashboard lifecycle (create/stop/status/read) and table exploration plus read-only querying are well covered. Gaps exist: there is no knowledge-base ingestion tool despite referring to an ingested KB, and no way to modify or delete data.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseAqualityBmaintenanceOne config, one CLI that turns your databases (Postgres, MySQL, SQLite, MongoDB) into MCP servers for Claude, GPT, Cursor, and any MCP-compatible agent.31MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with SQLite databases, filesystem, AWS IAM, and Gmail through a master MCP server with a Streamlit UI optimized for Claude.1-
- AlicenseAqualityDmaintenanceMCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.3MIT
- AlicenseAqualityDmaintenanceA database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.85 npmMIT