Enables AI agents to query a PostgreSQL database through a secure layer of predefined tools, allowing for the retrieval of employee information, project statuses, and issue priorities without exposing database credentials or allowing direct SQL execution.
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., "@MCP Dummy DB Integrationlist all employees in the AI department"
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.
MCP Agent POC
This project demonstrates a secure, production-ready implementation of the Model Context Protocol (MCP) as a connector layer between AI agents and PostgreSQL databases. The solution enables natural language queries without exposing database credentials to the LLM.
Key Achievement: LLM cannot access database directly - only through predefined MCP tools.
ποΈ Architecture Overview
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER QUERY β
β "Fetch employees in AI department" β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PLANNER AGENT (LLM) β
β β Natural Language Understanding β
β β NO database credentials β
β Output: {"tool": "get_employees_by_department", β
β "parameters": {"department": "AI"}} β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EXECUTOR AGENT β
β β Validates tool request β
β β Maps to allowed operations only β
β β Cannot execute arbitrary SQL β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP TOOLS LAYER (Sandbox) β
β β get_employees_by_department("AI") β
β β get_projects_by_status("Completed") β
β β get_issues_by_priority("High") β
β β Cannot run arbitrary SQL β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATABASE CONNECTION (Secure) β
β β Credentials in environment variables β
β β Only parameterized queries (SQL injection safe) β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RESULT TO USER β
β [Secure data retrieval via MCP] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπ Security Features
Feature | With MCP |
DB Credentials | Secure in .env β |
SQL Access | Predefined tools only β |
Attack Surface | Limited operations only β |
Audit Trail | Full logging β |
Connection Pool | Yes β |
Project Structure
app/agents/: The brain (Planner, Executor, Orchestrator)app/mcp/: The tool layer (Connector to DB)app/database/: Low-level DB connection poolapp/api/: FastAPI routes
Getting Started
1. Setup Env
Copy the example config:
cp .env.example .env2. Run with Docker
The easiest way to stand it up (Postgres + API):
docker-compose up --buildThe API listens on http://localhost:8000.
3. Test It
You can use the swagger UI at /docs or curl:
curl -X POST "http://localhost:8000/api/v1/query" \
-H "Content-Type: application/json" \
-d '{"query": "Find all projects that are in progress"}'Local Dev (No Docker)
If you have Python 3.11+ and a local Postgres running:
pip install -r requirements.txtUpdate
.envwith your DB credentialspython -m app.main
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.