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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
tai42-mcp-dynamic-postgres
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: tai-dynamic-postgres-mcp
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-mcp-dynamic-postgres
uvx tai42-mcp-dynamic-postgres # 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/tai42-mcp-dynamic-postgres # next to your app checkout
cd /path/to/your/app
uv add --editable ../tai42-mcp-dynamic-postgres
uvx --from ../tai42-mcp-dynamic-postgres tai42-mcp-dynamic-postgresDocumentation
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Postgres backend your coding agent builds over MCP; destructive actions wait for a person.
Security layer for AI agents: Retrieve for controlled SQL reads, Guard for allow/deny writes.
Related MCP Servers
- FlicenseBqualityCmaintenanceProvides a secure, schema-aware PostgreSQL database agent for LLMs, enabling natural language queries and validated SQL execution with strong security guardrails.85-
- FlicenseNot gradedqualityDmaintenanceGenerates FastMCP tools for PostgreSQL DML operations (insert, select, update, delete) per table based on schema introspection, with Pydantic models for input validation.-

@weave-kit/engineofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely operate on PostgreSQL data through typed MCP tools with per-identity RBAC, guardrails, and immutable audit logging.74 npmMIT- AlicenseAqualityBmaintenanceEnables coding agents to safely investigate PostgreSQL runtime state through bounded, read-oriented MCP tools for row-and-foreign-key neighborhood inspection, schema and statistics lookup, and table listing, with truncation, redaction, timeouts, and audit logging.49 npmMIT