Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

🚀 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
graph TD
A[🧑 User types a data question] --> B[Streamlit sends prompt to Ollama API]
B --> C[Ollama generates SQL query as text]
C --> D[Streamlit extracts the SQL]
D --> E[Streamlit sends SQL to MCP server]
E --> F[MCP executes query on PostgreSQL]
F --> G[Results returned to Streamlit]
G --> H[📊 Results shown + Chart + CSV Export]
📦 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
git clone <this-repo>
cd postgres-mcp-server
docker-compose up --build
- Access UI: http://localhost:8501
- MCP API: http://localhost:3333/mcp
⚙️ Env Configuration
MCP_API_URL=http://mcp-server:3333/mcp
OLLAMA_URL=http://ollama:11434/api/generate
📤 Prompt Example
“List departments with average salary > 50000”
👉 Translated to SQL:
SELECT department, AVG(salary) FROM employees GROUP BY department HAVING AVG(salary) > 50000;
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
相关推荐
You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!
Text your favorite pet, after answering 10 questions about their everyday lives!
Carbon footprint calculations breakdown and advices on how to reduce it
Best-in-class AI domain names scoring engine and availability checker. Brandability, domain worth, root keywords and more.
Evaluates language quality of texts, responds with a numerical score between 50-150.
Discover A More Robust Business: Craft tailored value proposition statements, develop a comprehensive business model canvas, conduct detailed PESTLE analysis, and gain strategic insights on enhancing business model elements like scalability, cost structure, and market competition strategies. (v1.18)
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
🧑🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.
Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.
This project was created to demonstrate how we can connect with different Model Context Protocols (MCPs).
🤖 Collect practical AI repos, tools, websites, papers and tutorials on AI. 实用的AI百宝箱 💎
⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Flock is a workflow-based low-code platform for rapidly building chatbots, RAG, and coordinating multi-agent teams, powered by LangGraph, Langchain, FastAPI, and NextJS.(Flock 是一个基于workflow工作流的低代码平台,用于快速构建聊天机器人、RAG、Agent和Muti-Agent应用,采用 LangGraph、Langchain、FastAPI 和 NextJS 构建。)
Reviews

user_AN1bW5aK
As a dedicated user of mcp-ollama-postgres, I can confidently say that this tool has been a game-changer for my database management tasks. Created by rajeevchandra, its seamless integration with PostgreSQL and user-friendly interface have significantly boosted my productivity. The initial setup was straightforward, and the welcome information provided clear guidance. Highly recommend this for efficient database handling!

user_htYF6BE7
I've been using the mcp-ollama-postgres app by rajeevchandra and I am thoroughly impressed. The seamless integration with PostgreSQL and the intuitive design have significantly boosted my productivity. The welcome information is clear and helpful, making the initial setup a breeze. Overall, a fantastic tool for any developer working with PostgreSQL databases. Highly recommend!

user_hY4FVtD0
As a dedicated user of mcp-ollama-postgres, I am thoroughly impressed with this tool. It seamlessly integrates PostgreSQL with Ollama, significantly enhancing my database management workflows. Rajeevchandra has crafted an intuitive and user-friendly experience, making complex operations straightforward. Highly recommended for anyone looking to streamline their database tasks.

user_JCkvnTQd
As a loyal user of the mcp-ollama-postgres application, I am genuinely impressed by its robust integration and efficiency. Developed by rajeevchandra, this tool seamlessly connects Postgres databases for optimal performance and management. It simplifies complex processes and provides intuitive navigation through its well-designed interface. It's truly an indispensable asset for database administrators and developers alike.

user_7hh85nC3
As a dedicated user of the mcp-ollama-postgres application, I am thoroughly impressed by its seamless integration and robust functionality. Developed by rajeevchandra, this tool has significantly optimized my database management tasks. The user-friendly interface and reliable performance make it an essential asset for anyone working with PostgreSQL. Highly recommended!