depthfirst
Our "connect Claude to Postgres" guide was recommending the official @modelcontextprotocol/server-postgres. It turned out to be archived with a known hole: it ran each query in a read-only transaction but accepted several statements at once, so COMMIT; DROP SCHEMA public CASCADE got through.
So we wrote a replacement. Two things are different: - Read-only is enforced in several places: the wire protocol rejects multiple statements, the transaction is read-only, the real Postgres parser checks every statement, and functions Postgres marks as having side effects are blocked. That last check came from asking Claude to break our own guards. It found pg_logical_emit_message, which writes to the WAL inside a read-only transaction. - A context file in your repo, seeded from your COMMENT ON descriptions. The agent can append what it learns ("amount is in cents", "this table only has completed orders"), so the next session starts with it. The reason to integrate context file inside the mcp connector was to have more fine control of what the agent sees (compared to agent managing its own md file). You can swap out agents any time with just mcp connection.
Would love any feedbacks on this.
some interesting use cases are coming up where people want to query across different data sources (postgres + GA4) via chat. Feel free to reach out if you want to try it out.
[1] https://fsnot.es/ [2] https://brettterpstra.com/projects/nvalt/
To reiterate my use case:
- no maintenance: the site is served from github, so dont have to maintain/pay for a server
- deduplication of work: dont have to write/sync a blog post and a project README for a given project.
Regarding SEO, since all content in on github, a search engine might index github content and make it discoverable that way.