Utilized for visualizing and documenting the prompt-to-SQL workflow in the application
Integrates with Ollama to translate natural language queries into SQL, enabling non-technical users to query databases without SQL knowledge
Enables querying PostgreSQL databases with both raw SQL and natural language queries, with results available for analysis, charting, and export
Powers the user interface with interactive dashboards for visualizing query results, generating charts, and exporting data to CSV
π MCP-Powered Streamlit Dashboard with Ollama + PostgreSQL
A modern data analysis tool that lets you:
Query your PostgreSQL database with natural language
Run SQL manually or generate it using LLMs (Ollama)
Analyze data with charts, statistics, and export to CSV
π§ Prompt-to-SQL Flow
Related MCP server: MCP SQL Server
π¦ Architecture
Streamlit β UI + charting
MCP (FastMCP) β Tools/resources for SQL query and table listing
PostgreSQL β Stores your company data
Ollama β LLM that translates natural language prompts to SQL
π Features
β
Natural language β SQL
β
Charting (bar/line/time series)
β
CSV download
β
Statistical summary
β
Prompt explainability with raw output
β
Auto-detect date/time fields
β
LLM integration with llama3 (configurable)
π οΈ Getting Started
Access UI: http://localhost:8501
MCP API: http://localhost:3333/mcp
βοΈ Env Configuration
π€ Prompt Example
βList departments with average salary > 50000β
π Translated to SQL:
Why is this a good use case for MCP?
π MCP makes it dead simple to expose structured tools like SQL queries to LLMs. π― Agents can discover and call your tools without hardcoding logic. π¬ You get the best of both worlds β interpretability, flexibility, and control.
Whether you're building internal tools, research dashboards, or intelligent agents β this pattern is reusable, secure, and 100% local.
π License
MIT