Enables natural language querying of PostgreSQL databases by translating prompts into SQL via LLM integration, with features including data visualization, statistical summaries, CSV export, and seamless Model Context Protocol execution for flexible, interpretable data analysis.
Unlock the full potential of SQL Query MCP Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available β’ No credit card required
A modern data analysis tool that lets you:
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]
β
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)
git clone cd postgres-mcp-server docker-compose up --build
MCP_API_URL=http://mcp-server:3333/mcp OLLAMA_URL=http://ollama:11434/api/generate
β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.
MIT
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!