tai42-dynamic-postgres-mcp
OfficialProvides tools for safely interacting with PostgreSQL databases: select, insert, update, delete operations on tables, with injection-safe filtering and ordering, including vector KNN search.
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., "@tai42-dynamic-postgres-mcpshow me customers from California"
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.
tai42-dynamic-postgres-mcp
Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems.
Point it at a PostgreSQL database and it introspects the schema and generates one
typed MCP tool per DML operation per table — insert, select, update,
delete, plus optional select_joined. The agent gets exactly those tools and
nothing else: no raw SQL, no schema changes, no access to tables you didn't
expose.
Why
Giving an agent database access usually means choosing between read-only access or risking that the agent runs arbitrary SQL and changes data or settings you never intended. This project gives you a controlled middle ground: a fixed set of generated, validated, parameterized tools scoped to the tables and operations you choose.
Related MCP server: django-mcp-sql
What it does
Introspects your schema (tables, columns, types, foreign keys,
pgvector).Generates a FastMCP tool per DML operation per table, each with a dedicated Pydantic input model derived from the table.
Supports rich, injection-safe filtering (
WhereFilter) and ordering, including vector KNN search.Excludes chosen columns from generated tool inputs (e.g.
id,created_at).Exposes only the generated tools — never raw SQL or DDL.
Security model
The generated tool layer controlswhich operations exist; the PostgreSQL role you connect as controls what those operations can physically do. Connect as a dedicated least-privilege role, never a superuser. Read SECURITY.md before deploying.
Highlights, in full detail in SECURITY.md:
Filter/order field names are validated against real columns and emitted only as quoted identifiers; values are always bound parameters. There is no path for SQL injection through field names.
update/deleterequire aWHEREfilter unless the server is started with--allow-unfiltered.The tool layer does not provide row-level scoping. Use PostgreSQL Row-Level Security and
GRANT/REVOKEfor that.
Installation
Requires Python 3.13+. Install from PyPI into the environment that runs the server, or run it without installing:
uv add tai42-dynamic-postgres-mcp
uvx --from tai42-dynamic-postgres-mcp tai42-postgres-mcp # run it without installingOr from source — clone this repo and add it as an editable dependency, or run
the clone with uvx:
git clone https://github.com/tai42ai/tai-dynamic-postgres-mcp # next to your app checkout
cd /path/to/your/app
uv add --editable ../tai-dynamic-postgres-mcp
uvx --from ../tai-dynamic-postgres-mcp tai42-postgres-mcpDocumentation
Full reference — every connection and pooling variable, the CLI scoping flags,
stdio and HTTP transport wiring, the generated-tool surface, WhereFilter
filtering, and pgvector search — lives on the plugin's documentation page. See
also SECURITY.md before deploying.
Development
See CONTRIBUTING.md.
uv venv --python 3.13
uv pip install --no-sources --editable ".[dev,test-integration]"
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pyright
uv run --no-sync pytest --cov --cov-report=term-missing # unit tests
uv run --no-sync pytest -m integration # CRUD tests against real Postgres (needs Docker)License
Apache-2.0. See LICENSE and NOTICE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceProvides a secure, schema-aware PostgreSQL database agent for LLMs, enabling natural language queries and validated SQL execution with strong security guardrails.1735MIT
- Alicense-qualityAmaintenanceProvides a read-only PostgreSQL SQL surface for LLM agents via MCP, with defense-in-depth security layers for safe database queries.3MIT
- AlicenseBqualityAmaintenanceA production-grade Model Context Protocol server for PostgreSQL. Lets AI agents safely inspect, query, operate, and tune a Postgres database — over 100 tools spanning catalog introspection, query intelligence, natural-language SQL, structural diffs, hybrid search, graph queries, data movement, live ops, and more.1008MIT
- Flicense-qualityDmaintenanceGenerates FastMCP tools for PostgreSQL DML operations (insert, select, update, delete) per table based on schema introspection, with Pydantic models for input validation.
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tai42ai/tai-dynamic-postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server