Most database servers say read-only and mean they hope the model behaves. Here the read-only property is requested as part of opening the transaction, and statements are additionally screened for the constructs that would escape it — the documentation is explicit that an earlier design set it after the transaction had already begun, and that this replaces it. Being able to disable individual tools so they never appear in the tool list is the other useful control: an agent cannot call what it was never offered.
A Go MCP server for PostgreSQL that adds semantic search on top of ordinary querying. The read-only guarantee is the design centre: the server asks for read-only access as part of the BEGIN that opens each transaction, so there is no window in which the transaction is writable.
- query_database — SQL in a read-only transaction unless the connection explicitly sets allow_writes; statements are also screened for constructs known to escape read-only mode
- get_schema_info — tables, columns and relationships, so the model writes queries against the real shape
- count_rows, which always runs read-only so the screening applies even on a connection that permits writes
- execute_explain — read the plan rather than guessing why a query is slow
- Several databases at once — list_database_connections and select_database_connection
- Semantic search over your own data — generate_embedding and similarity_search
- search_knowledgebase for retrieval over an indexed corpus, and read_resource, which is always enabled because listing resources depends on it
- Any individual tool can be disabled in the server configuration — a disabled tool is not advertised in tools/list at all, and calling it returns an error
- Four prompts that carry a whole workflow: setup, explore, diagnose and design
A reachable PostgreSQL database and a connection string. The server is a Go binary, configured through a file or environment variables, and several database connections can be registered so one server serves more than one database. Writes are off unless a connection sets allow_writes — attempting one otherwise fails with Postgres's own read-only transaction error rather than being silently dropped. Semantic search needs an embedding provider configured.
One command plus a key — sudo apt-get install -y pgedge-postgres-mcp, then supply credentials
