MCP server — Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systemsPoint the server at a PostgreSQL database and it introspects the schema and
generates one typed MCP tool per DML operation per table. What the agent can reach
is set two ways that must agree: the CLI flags below decide which tools exist, and
the PostgreSQL role you connect as decides what those tools can physically do.
Connect as a dedicated least-privilege role, never a superuser.
Connection and pooling come from environment variables. PG_DB, PG_USER, and
PG_PASSWORD have no default — a missing one fails at startup rather than
connecting with a phantom value.
Variable
Default
Effect
PG_HOST
localhost
PostgreSQL host.
PG_PORT
5432
PostgreSQL port.
PG_DB
required
Database name.
PG_USER
required
Database user; use a least-privilege role.
PG_PASSWORD
required
Database password. Held as a secret.
PG_STATEMENT_TIMEOUT
30000
Per-connection statement_timeout in ms (0 disables), capping a runaway query.
The default transport is stdio: an MCP client launches the server as a
subprocess and speaks over stdin/stdout. Wire it into a client’s server list,
passing the connection settings through env:
Column types map to native Python: temporal columns to datetime/date/time,
uuid to uuid.UUID, numeric/decimal to Decimal, json/jsonb to Any,
and array columns to list[...]. insert returns the table’s real primary key (a
scalar list for a single-column key, a list of lists for a composite key, or the
affected row count when the table has none); columns with a database default are
omittable. order_by items take an optional nulls (FIRST/LAST).
select, update, and delete accept a where argument. Field names must be
real columns of the table; unknown fields are rejected, and values are always
bound parameters, so there is no path for SQL injection through field names.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TAI42","description":"tai is an open-source runtime for MCP tools, agents, and workflows — the server that hosts tools, agents, extensions, connectors, hooks, and storage for the TAI42 ecosystem.","colors":{"primary":"#DC143C","light":"#F4718A","dark":"#A01030"},"logo":{"light":"https://mintcdn.com/tai42/8zNeABFQpXRG0k_n/logo/light.png?fit=max\u0026auto=format\u0026n=8zNeABFQpXRG0k_n\u0026q=85\u0026s=2140f77615492c689d62fcb3a5df2d31","dark":"https://mintcdn.com/tai42/8zNeABFQpXRG0k_n/logo/dark.png?fit=max\u0026auto=format\u0026n=8zNeABFQpXRG0k_n\u0026q=85\u0026s=22db5fbcb0ff42b44dd8057f0edbb842"},"favicon":{"light":"https://mintcdn.com/tai42/8zNeABFQpXRG0k_n/logo/icon.png?fit=max\u0026auto=format\u0026n=8zNeABFQpXRG0k_n\u0026q=85\u0026s=93b0ca22f7b4a2c0a6a18f49aedbfd73","dark":"https://mintcdn.com/tai42/6-OGKPd0gfVyDs4N/logo/icon-dark.png?fit=max\u0026auto=format\u0026n=6-OGKPd0gfVyDs4N\u0026q=85\u0026s=e1630da05506747fe41cf300761cf3cf"},"appearance":{"default":"light"},"navbar":{"links":[{"icon":"github","href":"https://github.com/tai42ai/tai42","label":"GitHub"}],"primary":{"type":"button","label":"Get started","href":"/getting-started/installation"}},"footer":{"socials":{"github":"https://github.com/tai42ai","website":"https://tai42.ai"},"links":[{"header":"Project","items":[{"label":"Contributing","href":"/contributing"}]}]},"search":{"prompt":"Search the TAI42 docs"},"seo":{"metatags":{"og:title":"TAI42 — the OS for AI tools","og:description":"An open-source runtime for MCP tools, agents, and workflows.","og:image":"/images/og-image.svg","og:type":"website","twitter:card":"summary_large_image","twitter:title":"TAI42 — the OS for AI tools","twitter:image":"/images/og-image.svg"},"indexing":"navigable"},"fonts":{"heading":{"family":"Geist"},"body":{"family":"Inter"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tai42","hasAudioNarration":false,"actualSubdomain":"tai42","customDomains":["docs.tai42.ai"],"gitSource":{"type":"github","owner":"tai42ai","repo":"tai-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"collectionId":"70c7974a-74c7-4ee5-8636-97a098b8bbe6","liveDeploymentHistoryId":"6aeca718754501e0c6b68d06","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aeca718754501e0c6b68d06"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aecafc07e5e99a1eb7058ad","clientVersion":"0.0.4071","searchFilterCounts":[{"language":"default","tag":"Reference","count":356},{"language":"default","tag":"HTTP API","count":260},{"language":"default","tag":"Docs","count":124},{"language":"default","tag":"CLI","count":46},{"language":"default","tag":"Python SDK","count":38},{"language":"default","tag":"Concepts","count":35},{"language":"default","tag":"access-control","count":35},{"language":"default","tag":"states","count":33},{"language":"default","tag":"Plugins","count":30},{"language":"default","tag":"conversations","count":22}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"plugins/tai42/mcp-dynamic-postgres","slug":"/plugins/tai42/mcp-dynamic-postgres","pageMetadata":{"title":"mcp-dynamic-postgres","description":"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems","href":"/plugins/tai42/mcp-dynamic-postgres"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(Info,{children:[_jsx(_components.code,{children:`MCP server`}),` plugin · listing `,_jsx(_components.code,{children:`tai42/mcp-dynamic-postgres`})]}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`tai`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` plugins`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tai42-mcp-dynamic-postgres`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`permissions`,children:`Permissions`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Capability`}),_jsx(_components.th,{children:`Declared`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Network`}),_jsx(_components.td,{children:`yes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Subprocess`}),_jsx(_components.td,{children:`no`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Filesystem`}),_jsx(_components.td,{children:`yes`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`provides`,children:`Provides`}),`\n`,_jsx(Heading,{level:`3`,id:`mcp-dynamic-postgres`,children:`mcp-dynamic-postgres`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`MCP server`}),` — Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems`]}),`\n`,_jsx(_components.p,{children:`Point the server at a PostgreSQL database and it introspects the schema and\ngenerates one typed MCP tool per DML operation per table. What the agent can reach\nis set two ways that must agree: the CLI flags below decide which tools exist, and\nthe PostgreSQL role you connect as decides what those tools can physically do.\nConnect as a dedicated least-privilege role, never a superuser.`}),`\n`,_jsx(Heading,{level:`2`,id:`connection-settings`,children:`Connection settings`}),`\n`,_jsxs(_components.p,{children:[`Connection and pooling come from environment variables. `,_jsx(_components.code,{children:`PG_DB`}),`, `,_jsx(_components.code,{children:`PG_USER`}),`, and\n`,_jsx(_components.code,{children:`PG_PASSWORD`}),` have no default — a missing one fails at startup rather than\nconnecting with a phantom value.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Variable`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Effect`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_HOST`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`localhost`})}),_jsx(_components.td,{children:`PostgreSQL host.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_PORT`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5432`})}),_jsx(_components.td,{children:`PostgreSQL port.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_DB`})}),_jsx(_components.td,{children:`required`}),_jsx(_components.td,{children:`Database name.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_USER`})}),_jsx(_components.td,{children:`required`}),_jsx(_components.td,{children:`Database user; use a least-privilege role.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_PASSWORD`})}),_jsx(_components.td,{children:`required`}),_jsx(_components.td,{children:`Database password. Held as a secret.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_STATEMENT_TIMEOUT`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`30000`})}),_jsxs(_components.td,{children:[`Per-connection `,_jsx(_components.code,{children:`statement_timeout`}),` in ms (`,_jsx(_components.code,{children:`0`}),` disables), capping a runaway query.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_POOL_MIN_SIZE`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1`})}),_jsx(_components.td,{children:`Minimum pooled connections.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_POOL_MAX_SIZE`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`10`})}),_jsx(_components.td,{children:`Maximum pooled connections.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_POOL_TIMEOUT`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`10`})}),_jsx(_components.td,{children:`Pool acquire timeout (seconds).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PG_POOL_MAX_LIFETIME`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`300`})}),_jsx(_components.td,{children:`Maximum connection lifetime (seconds).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`TOOLS_DIR`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`~/.cache/tai42-mcp-dynamic-postgres/tools`})}),_jsx(_components.td,{children:`Where generated tool files are written.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`scoping-flags`,children:`Scoping flags`}),`\n`,_jsx(_components.p,{children:`The flags decide which tools are generated and how permissive they are.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Effect`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--overwrite / --no-overwrite`})}),_jsx(_components.td,{children:`on`}),_jsxs(_components.td,{children:[`Regenerate tool files on startup so they track the schema; `,_jsx(_components.code,{children:`--no-overwrite`}),` reuses existing files.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--readonly`})}),_jsx(_components.td,{children:`off`}),_jsxs(_components.td,{children:[`Generate only `,_jsx(_components.code,{children:`select`}),`/`,_jsx(_components.code,{children:`select_joined`}),` tools — no insert, update, or delete.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--allow-unfiltered`})}),_jsx(_components.td,{children:`off`}),_jsxs(_components.td,{children:[`Allow `,_jsx(_components.code,{children:`update`}),`/`,_jsx(_components.code,{children:`delete`}),` to run without a `,_jsx(_components.code,{children:`WHERE`}),` filter (affects every row). Off means unfiltered writes raise.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--select-joined a,b,c`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Generate a joined select over the given tables (repeatable).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ignore-insert-column`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`id`})}),_jsx(_components.td,{children:`Column to exclude from insert inputs (repeatable).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ignore-update-column`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`id`})}),_jsx(_components.td,{children:`Column to exclude from update inputs (repeatable).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ignore-select-column`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Column to exclude from select output models (repeatable).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ignore-select-joined-column`})}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Column to exclude from joined select models (repeatable).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`-t, --transport`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`stdio`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`stdio`}),`, `,_jsx(_components.code,{children:`http`}),`, `,_jsx(_components.code,{children:`sse`}),`, or `,_jsx(_components.code,{children:`streamable-http`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--host`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`127.0.0.1`})}),_jsx(_components.td,{children:`Bind host (HTTP/SSE transports only).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--port`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`8000`})}),_jsx(_components.td,{children:`Bind port (HTTP/SSE transports only).`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`transport`,children:`Transport`}),`\n`,_jsxs(_components.p,{children:[`The default transport is `,_jsx(_components.code,{children:`stdio`}),`: an MCP client launches the server as a\nsubprocess and speaks over stdin/stdout. Wire it into a client’s server list,\npassing the connection settings through `,_jsx(_components.code,{children:`env`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mcpServers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"postgres\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"command\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"uvx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"args\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tai42-mcp-dynamic-postgres\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"--readonly\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"env\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"PG_DB\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dbname\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"PG_USER\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"PG_PASSWORD\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"secret\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For a network-mounted server, choose an HTTP transport and bind a host and port\n(`,_jsx(_components.code,{children:`--host`}),` / `,_jsx(_components.code,{children:`--port`}),` apply only here):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`uvx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tai42-mcp-dynamic-postgres`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -t`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --host`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.0.0.0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8000`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`generated-tools`,children:`Generated tools`}),`\n`,_jsxs(_components.p,{children:[`For a table `,_jsx(_components.code,{children:`public.events`}),` you get (unless `,_jsx(_components.code,{children:`--readonly`}),`):`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`select_public_events(where, order_by, limit, offset)`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`insert_public_events(params, raise_on_conflict)`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`update_public_events(data, where)`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`delete_public_events(where)`})}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Column types map to native Python: temporal columns to `,_jsx(_components.code,{children:`datetime`}),`/`,_jsx(_components.code,{children:`date`}),`/`,_jsx(_components.code,{children:`time`}),`,\n`,_jsx(_components.code,{children:`uuid`}),` to `,_jsx(_components.code,{children:`uuid.UUID`}),`, `,_jsx(_components.code,{children:`numeric`}),`/`,_jsx(_components.code,{children:`decimal`}),` to `,_jsx(_components.code,{children:`Decimal`}),`, `,_jsx(_components.code,{children:`json`}),`/`,_jsx(_components.code,{children:`jsonb`}),` to `,_jsx(_components.code,{children:`Any`}),`,\nand array columns to `,_jsx(_components.code,{children:`list[...]`}),`. `,_jsx(_components.code,{children:`insert`}),` returns the table’s real primary key (a\nscalar list for a single-column key, a list of lists for a composite key, or the\naffected row count when the table has none); columns with a database default are\nomittable. `,_jsx(_components.code,{children:`order_by`}),` items take an optional `,_jsx(_components.code,{children:`nulls`}),` (`,_jsx(_components.code,{children:`FIRST`}),`/`,_jsx(_components.code,{children:`LAST`}),`).`]}),`\n`,_jsxs(Heading,{level:`3`,id:`filtering-—-wherefilter`,children:[`Filtering — `,_jsx(_components.code,{children:`WhereFilter`})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`select`}),`, `,_jsx(_components.code,{children:`update`}),`, and `,_jsx(_components.code,{children:`delete`}),` accept a `,_jsx(_components.code,{children:`where`}),` argument. Field names must be\nreal columns of the table; unknown fields are rejected, and values are always\nbound parameters, so there is no path for SQL injection through field names.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`jsonc`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`jsonc`,children:_jsxs(_components.code,{language:`jsonc`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Simple field filters (implicitly ANDed)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"eq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"total\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"gte\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Logical composition`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"AND\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"eq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"OR\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"total\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"gt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }, { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"starred\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"eq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } } ] } ] }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Operators: `,_jsx(_components.code,{children:`eq`}),`, `,_jsx(_components.code,{children:`ne`}),`, `,_jsx(_components.code,{children:`gt`}),`, `,_jsx(_components.code,{children:`gte`}),`, `,_jsx(_components.code,{children:`lt`}),`, `,_jsx(_components.code,{children:`lte`}),`, `,_jsx(_components.code,{children:`like`}),`, `,_jsx(_components.code,{children:`not_like`}),`, `,_jsx(_components.code,{children:`ilike`}),`,\n`,_jsx(_components.code,{children:`not_ilike`}),`, `,_jsx(_components.code,{children:`in`}),`, `,_jsx(_components.code,{children:`not_in`}),`, `,_jsx(_components.code,{children:`between`}),`, `,_jsx(_components.code,{children:`is_null`}),`, and `,_jsx(_components.code,{children:`knn`}),` (pgvector). Logical\nkeys: `,_jsx(_components.code,{children:`AND`}),`, `,_jsx(_components.code,{children:`OR`}),`, `,_jsx(_components.code,{children:`NOT`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`vector-search-pgvector`,children:`Vector search (pgvector)`}),`\n`,_jsxs(_components.p,{children:[`When a column is a `,_jsx(_components.code,{children:`vector`}),`, filter or order by similarity. Requires the\n`,_jsx(_components.code,{children:`pgvector`}),` extension enabled in the database.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`jsonc`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`jsonc`,children:_jsxs(_components.code,{language:`jsonc`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"embedding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"knn\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"distance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cosine\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// l2 | inner_product | cosine`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"threshold\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } } }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`docker`,children:`Docker`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -t`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tai42-mcp-dynamic-postgres`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rm`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -e`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PG_HOST=...`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -e`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PG_DB=...`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -e`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PG_USER=...`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -e`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PG_PASSWORD=...`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tai42-mcp-dynamic-postgres`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tai42-mcp-dynamic-postgres`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --readonly`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"mcp-dynamic-postgres","description":"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems","href":"/plugins/tai42/mcp-dynamic-postgres"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Permissions","slug":"permissions","depth":2,"children":[]},{"title":"Provides","slug":"provides","depth":2,"children":[{"title":"mcp-dynamic-postgres","slug":"mcp-dynamic-postgres","depth":3,"children":[]}]},{"title":"Connection settings","slug":"connection-settings","depth":2,"children":[]},{"title":"Scoping flags","slug":"scoping-flags","depth":2,"children":[]},{"title":"Transport","slug":"transport","depth":2,"children":[]},{"title":"Generated tools","slug":"generated-tools","depth":2,"children":[{"title":"Filtering — WhereFilter","slug":"filtering-—-wherefilter","depth":3,"children":[]},{"title":"Vector search (pgvector)","slug":"vector-search-pgvector","depth":3,"children":[]}]},{"title":"Docker","slug":"docker","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"tai42","siteName":"TAI42","title":"TAI42 — the OS for AI tools","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-21T05:20:50.619Z","originalFileLocation":"plugins/tai42/mcp-dynamic-postgres.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems\">\u003cmeta data-mint-head name=\"application-name\" content=\"TAI42\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"TAI42 — the OS for AI tools\">\u003cmeta data-mint-head property=\"og:description\" content=\"An open-source runtime for MCP tools, agents, and workflows.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TAI42\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tai42.mintlify.app/images/og-image.svg\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"TAI42 — the OS for AI tools\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"An open-source runtime for MCP tools, agents, and workflows.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tai42.mintlify.app/images/og-image.svg\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tai42/Czx60dmBXmcmJLcB/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TAI42\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#DC143C\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/plugins/tai42/mcp-dynamic-postgres.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tai42.ai/#organization\",\"name\":\"TAI42\",\"url\":\"https://docs.tai42.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tai42/8zNeABFQpXRG0k_n/logo/light.png?fit=max\u0026auto=format\u0026n=8zNeABFQpXRG0k_n\u0026q=85\u0026s=2140f77615492c689d62fcb3a5df2d31\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tai42.ai#website\",\"name\":\"TAI42\",\"url\":\"https://docs.tai42.ai\",\"publisher\":{\"@id\":\"https://docs.tai42.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres#webpage\",\"url\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres\",\"name\":\"mcp-dynamic-postgres\",\"description\":\"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems\",\"dateModified\":\"2026-08-21T05:20:50.619Z\",\"isPartOf\":{\"@id\":\"https://docs.tai42.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Plugins\",\"item\":\"https://docs.tai42.ai/plugins/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connect outside systems\",\"item\":\"https://docs.tai42.ai/plugins/tai42/connector-atlassian\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"mcp-dynamic-postgres\",\"item\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres#article\",\"headline\":\"mcp-dynamic-postgres\",\"name\":\"mcp-dynamic-postgres\",\"description\":\"Schema-driven generator for safe, scoped PostgreSQL DML tools in FastMCP agent systems\",\"url\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tai42.ai/plugins/tai42/mcp-dynamic-postgres#webpage\"},\"image\":\"https://docs.tai42.ai/images/og-image.svg\",\"dateModified\":\"2026-08-21T05:20:50.619Z\",\"publisher\":{\"@id\":\"https://docs.tai42.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tai42.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TAI42\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"TAI42","nav":{"global":null,"tabs":[{"tab":"Docs","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"TAI42 — the OS for AI tools","sidebarTitle":"Welcome","icon":"house","mode":"wide","href":""},{"title":"Installation","icon":"download","href":"/getting-started/installation"},{"title":"Quickstart","icon":"rocket","href":"/getting-started/quickstart"},{"title":"Mental model","icon":"brain","href":"/getting-started/mental-model"}]},{"group":"Concepts","icon":"lightbulb","pages":[{"title":"Concepts","icon":"compass","href":"/concepts/index"},{"group":"Foundations","icon":"sitemap","pages":[{"title":"The layering","icon":"sitemap","href":"/concepts/layering"},{"title":"The manifest","icon":"scroll","href":"/concepts/manifest"},{"title":"Tools and extensions","icon":"wrench","href":"/concepts/tools-and-extensions"},{"title":"Presets","icon":"layer-group","href":"/concepts/presets"},{"title":"Tool organization","icon":"folder-tree","href":"/concepts/tool-organization"}]},{"group":"Agents","icon":"robot","pages":[{"title":"Agents","icon":"robot","href":"/concepts/agents"},{"title":"Deep agents","icon":"diagram-project","href":"/concepts/deep-agents"},{"title":"Classifiers","icon":"scale-balanced","href":"/concepts/classifiers"},{"title":"Client conversations","icon":"comments","href":"/concepts/client-conversations"}]},{"group":"Around the tool","icon":"wrench","pages":[{"title":"Interactions","icon":"comments","href":"/concepts/interactions"},{"title":"Asking the caller","icon":"reply","href":"/concepts/asking-the-caller"},{"title":"Notifications","icon":"bell","href":"/concepts/notifications"},{"title":"Connectors","icon":"plug","href":"/concepts/connectors"},{"title":"Hooks","icon":"anchor","href":"/concepts/hooks"},{"title":"Triggers and webhook verifiers","icon":"bolt","href":"/concepts/triggers-and-webhooks"},{"title":"Storage and resources","icon":"database","href":"/concepts/storage-and-resources"},{"title":"Backends","icon":"server","href":"/concepts/backends"},{"title":"Sandbox","icon":"box","href":"/concepts/sandbox"}]},{"group":"Platform surfaces","icon":"shield-halved","pages":[{"title":"Access control","icon":"shield-halved","href":"/concepts/access-control"},{"title":"Accounts","icon":"user-lock","href":"/concepts/accounts"},{"title":"Member actions","icon":"user-gear","href":"/concepts/member-actions"},{"title":"User types and permissions","icon":"user-shield","href":"/concepts/permissions"},{"title":"Owned keys","icon":"share-nodes","href":"/concepts/owned-keys"},{"title":"Config and secrets","icon":"key","href":"/concepts/config-and-secrets"},{"title":"Secret values","icon":"user-secret","href":"/concepts/secret-values"},{"title":"Transports","icon":"network-wired","href":"/concepts/transports"},{"title":"Private tool sets","icon":"box","href":"/concepts/private-tool-sets"},{"title":"The MCP-citizen surface","icon":"diagram-project","href":"/concepts/mcp-citizen-surface"},{"title":"The versioning spine","icon":"code-branch","href":"/concepts/versioning-spine"},{"title":"Live operations","icon":"gauge-high","href":"/concepts/live-operations"},{"title":"The worker bus","icon":"tower-broadcast","href":"/concepts/worker-bus"},{"title":"States","icon":"database","href":"/concepts/states"},{"title":"jq variables","icon":"dollar-sign","href":"/concepts/jq-variables"},{"title":"The marketplace","icon":"store","href":"/concepts/marketplace"}]}]},{"group":"Guides","icon":"map","pages":[{"title":"Guides","icon":"map","href":"/guides/index"},{"group":"Using the OS","icon":"wrench","pages":[{"title":"Build a tool","icon":"wrench","href":"/guides/build-a-tool"},{"title":"Bring an MCP server","icon":"plug","href":"/guides/bring-an-mcp-server"},{"title":"Connect an OAuth provider","icon":"key","href":"/guides/connect-an-oauth-provider"},{"title":"Apply an extension","icon":"puzzle-piece","href":"/guides/apply-an-extension"},{"title":"Create and version a preset","icon":"layer-group","href":"/guides/create-and-version-a-preset"},{"title":"Author an agent","icon":"robot","href":"/guides/author-an-agent"},{"title":"Use the ready-made agents","icon":"wand-magic-sparkles","href":"/guides/use-the-ready-made-agents"},{"title":"Use interactions","icon":"comments","href":"/guides/use-interactions"},{"title":"The standard toolbox","icon":"toolbox","href":"/guides/standard-toolbox"},{"title":"Set up access control","icon":"shield-halved","href":"/guides/access-control"},{"title":"Use owned keys","icon":"share-nodes","href":"/guides/owned-keys"},{"title":"Schedule a tool","icon":"clock","href":"/guides/schedule-a-tool"},{"title":"Fire a tool from a webhook","icon":"bolt","href":"/guides/fire-a-tool-from-a-webhook"},{"title":"WhatsApp to an agent","icon":"whatsapp","href":"/guides/whatsapp-to-agent"},{"title":"Telegram / Slack to an agent","icon":"hashtag","href":"/guides/telegram-slack-to-agent"},{"title":"Link a person across channels","icon":"link","href":"/guides/link-a-person-across-channels"},{"title":"Connect your own system","icon":"webhook","href":"/guides/connect-your-own-system"},{"title":"One bot, many skills","icon":"sitemap","href":"/guides/one-bot-many-skills"},{"title":"Manage stored content and templates","icon":"database","href":"/guides/manage-stored-content"},{"title":"Expose a private tool set","icon":"box","href":"/guides/private-tool-set"}]}]},{"group":"Operate","icon":"server","pages":[{"title":"Operate","icon":"server","href":"/operate/index"},{"group":"Run and operate","icon":"cloud-arrow-up","pages":[{"title":"Deploy","icon":"cloud-arrow-up","href":"/operate/deploy"},{"title":"Infrastructure by feature","icon":"layer-group","href":"/operate/infrastructure"},{"title":"Deploying the Studio","icon":"cloud-arrow-up","href":"/operate/studio"},{"title":"Embed in your own ASGI process","icon":"server","href":"/operate/embed"},{"title":"Manage a fleet","icon":"server","href":"/operate/manage-a-fleet"},{"title":"Observe","icon":"chart-line","href":"/operate/observe"},{"title":"Back up and restore","icon":"floppy-disk","href":"/operate/backup-and-restore"},{"title":"Checkpoints and retention","icon":"clock-rotate-left","href":"/operate/checkpoints"}]},{"group":"Plugin setup","icon":"puzzle-piece","pages":[{"title":"Task backends","icon":"server","href":"/operate/backends"},{"title":"Sandbox","icon":"box","href":"/operate/sandbox"},{"title":"Storage providers","icon":"database","href":"/operate/storage"},{"title":"Accounts and sign-in","icon":"user-lock","href":"/operate/accounts"}]}]},{"group":"Self-hosted","icon":"box","pages":[{"title":"Self-hosted","icon":"box","href":"/self-hosted/index"},{"title":"Quickstart","icon":"docker","href":"/self-hosted/quickstart"},{"title":"Web stacks","icon":"window","href":"/self-hosted/web-stacks"},{"title":"Upgrades","icon":"arrow-up-right-dots","href":"/self-hosted/upgrades"},{"title":"Verify artifacts","icon":"shield-check","href":"/self-hosted/verify"},{"title":"Ops notes","icon":"screwdriver-wrench","href":"/self-hosted/ops"}]},{"group":"Marketplace","icon":"store","pages":[{"title":"Marketplace","icon":"store","href":"/marketplace/index"},{"title":"Browse and search","icon":"magnifying-glass","href":"/marketplace/browse"},{"title":"Install a plugin","icon":"download","href":"/marketplace/install"},{"title":"Advisories","icon":"triangle-exclamation","href":"/marketplace/advisories"},{"title":"Author plugin docs","icon":"file-lines","href":"/marketplace/authoring-docs"},{"title":"Publish a connector without code","icon":"file-code","href":"/plugins/authoring-descriptor-plugins"}]},{"group":"Integrations","icon":"plug","pages":[{"title":"Integrations","icon":"plug","href":"/integrations/index"},{"title":"Claude Desktop","icon":"comment","href":"/integrations/claude-desktop"},{"title":"Cursor","icon":"arrow-pointer","href":"/integrations/cursor"},{"title":"MCP clients","icon":"plug","href":"/integrations/mcp-clients"}]},{"group":"Babelfish","icon":"fish","pages":[{"title":"Babelfish","icon":"fish","href":"/babelfish/index"},{"title":"Flows editor","icon":"pen-ruler","href":"/babelfish/studio"},{"title":"The agenda state template","icon":"list-checks","href":"/babelfish/agenda"},{"title":"Visual jq in flows","icon":"diagram-project","href":"/babelfish/jq-editor"},{"title":"Wiring an outcome by hand","icon":"diagram-next","href":"/babelfish/wire-form"}]},{"group":"Plugins","icon":"puzzle-piece","pages":[{"title":"Plugins","icon":"puzzle-piece","href":"/plugins/index"},{"group":"Tools","icon":"wrench","pages":[{"title":"toolbox","href":"/plugins/tai42/toolbox"},{"title":"tools-github","href":"/plugins/tai42/tools-github"},{"title":"tools-stripe","href":"/plugins/tai42/tools-stripe"},{"title":"tools-twilio","href":"/plugins/tai42/tools-twilio"},{"title":"tools-whatsapp","href":"/plugins/tai42/tools-whatsapp"}]},{"group":"Identity","icon":"id-card","pages":[{"title":"accounts-postgres","href":"/plugins/tai42/accounts-postgres"},{"title":"identity-redis","href":"/plugins/tai42/identity-redis"}]},{"group":"Agents","icon":"robot","pages":[{"title":"agents","href":"/plugins/tai42/agents"}]},{"group":"Backends","icon":"server","pages":[{"title":"backend-arq","href":"/plugins/tai42/backend-arq"},{"title":"backend-celery","href":"/plugins/tai42/backend-celery"},{"title":"backend-rq","href":"/plugins/tai42/backend-rq"}]},{"group":"Sandboxes","icon":"box","pages":[{"title":"sandbox-docker","href":"/plugins/tai42/sandbox-docker"},{"title":"sandbox-local","href":"/plugins/tai42/sandbox-local"}]},{"group":"Channels","icon":"paper-plane","pages":[{"title":"channel-slack","href":"/plugins/tai42/channel-slack"},{"title":"channel-telegram","href":"/plugins/tai42/channel-telegram"},{"title":"channel-twilio","href":"/plugins/tai42/channel-twilio"},{"title":"channel-web","href":"/plugins/tai42/channel-web"},{"title":"channel-whatsapp","href":"/plugins/tai42/channel-whatsapp"}]},{"group":"Monitoring","icon":"chart-line","pages":[{"title":"monitoring-langfuse","href":"/plugins/tai42/monitoring-langfuse"}]},{"group":"Storage","icon":"database","pages":[{"title":"storage-github","href":"/plugins/tai42/storage-github"},{"title":"storage-local","href":"/plugins/tai42/storage-local"},{"title":"storage-s3","href":"/plugins/tai42/storage-s3"}]},{"group":"Webhook verifiers","icon":"bolt","pages":[{"title":"webhook-verifier-github","href":"/plugins/tai42/webhook-verifier-github"},{"title":"webhook-verifier-stripe","href":"/plugins/tai42/webhook-verifier-stripe"}]},{"group":"Connect outside systems","icon":"plug","pages":[{"title":"Atlassian","href":"/plugins/tai42/connector-atlassian"},{"title":"GitHub","href":"/plugins/tai42/connector-github"},{"title":"Google","href":"/plugins/tai42/connector-google"},{"title":"Slack","description":"Slack OAuth connector provider for the TAI ecosystem. Pure descriptor data against Slack's hosted MCP server; ships no package.","href":"/plugins/tai42/connector-slack"},{"title":"mcp-dynamic-postgres","href":"/plugins/tai42/mcp-dynamic-postgres"}]}]}]},{"tab":"Studio","pages":[{"title":"Studio","href":"/studio"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/api"}]}]},"basePath":"","title":"TAI42 — the OS for AI tools","buildId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","deploymentId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","dynamics":[],"chunks":[]}