Repository navigation
v0.1.0
First release.
Added
- The
mcp-nameline the MCP Registry reads in the README, and auvx postgres-schema-mcpclient config next to the clone-based one. - Result caps: rows are read from a server-side cursor in batches, with a row cap, a per-cell cap (
PGSS_MAX_CELL_CHARS) and a total size cap (PGSS_MAX_RESULT_BYTES). Each cut is reported to the model. - A tighter database role, the third layer, in
init/20-grants.sql:EXECUTErevoked fromPUBLICon the functions the guard refuses, and a connection limit and temp-file limit onscout_ro. - Nine planted faults and three clean inputs for the guard bypasses below. The matrix is 21 must-block and 12 must-allow.
- The release workflow checks that the tag matches
pyproject.tomlandserver.jsonand is onmain, and every action is pinned by commit SHA. - Four MCP tools:
search_schema,describe_table,explain_queryandrun_query. - Retrieval over one document per table with BM25, plus one damped round of score propagation across foreign keys.
- Read-only enforced in three layers: tool annotations, an AST policy, and a
scout_rodatabase role that holds only SELECT. - An optional Amazon Titan embedding backend through Bedrock, not the default.
- A seeded AdventureWorks Postgres in Docker, so every number is reproducible.
- Evals: a two-sided fault matrix, retrieval quality, and the schema-context measurement, all printed as one JSON object by
make evalsand re-measured in CI. - A frozen copy of the schema in
evals/fixtures/catalog.json, so figures are measured without a database and checked against a freshly seeded one. - README figures wrapped in eval markers that CI checks against
evals/results/latest.json. server.jsonfor the MCP Registry.- A terminal demo in the README.
docs/demo.taperecords it withvhs, andevals/demo.pyis what it runs, offline.
Security
A review before this release found and fixed these. They are recorded in docs/DECISIONS.md.
- A double-quoted function name (
"pg_sleep"(1)) or aU&"..."escape bypassed the function denylist. Names are now compared unquoted, and a name that is not a plain identifier is refused. - Side-effect functions outside the list ran inside a SELECT: advisory locks,
nextval,pg_notify, large objects andcrosstab. The denylist now covers whole families by prefix. - Transactions were not explicitly read-only, so
set_config('default_transaction_read_only', 'off', false)could change the session default. Every transaction is nowBEGIN READ ONLY, and a connection is reset when it returns to the pool. - The HTTP transport refuses a non-loopback bind unless
PGSS_ALLOW_REMOTE=1, because it has no authentication. - Database comments shown to the model are joined onto one line and capped, and the instructions call comments and rows untrusted.
Changed
- Renamed from
pg-schema-scouttopostgres-schema-mcp. Nothing had been published under the old name. - Code is split into
core/(no I/O) andadapters/(Postgres, Bedrock). - Python 3.12 or newer. CI runs 3.12 and 3.13 through
make check. BlockedQueryis nowBlockedQueryError.