Can it write to my database?
No. The only tool runs queries inside a read-only transaction.

@modelcontextprotocol
Basic information
Archived reference MCP server for read-only PostgreSQL access: inspect schemas and run SQL inside read-only transactions.
Documentation reviewed 2026-10-25
This is the older PostgreSQL reference server, now documented in the servers-archived repository. It offers schema inspection and SQL queries described as read-only in the upstream README.
For a new deployment, compare maintained database integrations first. If evaluating this reference, use a disposable database and a database-enforced read-only role; do not rely only on the tool description. Its former servers/main/src/postgres source link is no longer the current location.
These notes check the linked documentation, not a live authenticated connection. Suggested checks are steps for you to run.
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}Run a read-only SQL query
PostgreSQL MCP Server is the original reference server from the Model Context Protocol project that gives an AI assistant read-only access to a PostgreSQL database. It lets the model inspect table schemas and run SQL queries, with every query executed inside a READ ONLY transaction.
Status: this server is archived. It moved to the modelcontextprotocol/servers-archived repository, which is no longer maintained, and the npm package @modelcontextprotocol/server-postgres (last version 0.6.2) is marked "Archived and unmaintained; no security guarantees". For new setups, prefer an actively maintained PostgreSQL MCP server.
Add it to your MCP client (for example claude_desktop_config.json), replacing /mydb with your database name:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
}
}
}
A Docker image mcp/postgres was also published; when the database runs on your host, use host.docker.internal instead of localhost in the connection URL. Credentials can go in the URL as postgresql://user:password@host:port/db-name.
query tool: run read-only SQL; input is sql (string)postgres://<host>/<table>/schema, with column names and data types discovered from database metadataNo. The only tool runs queries inside a read-only transaction.
No. It is archived with no security guarantees; use it only for testing, and avoid connecting it to production data.
MIT. Sources: [servers-archived/src/postgres](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres), [npm](https://www.npmjs.com/package/@modelcontextprotocol/server-postgres). Checked 2026-11-10.
MCP server for interacting with Neon Management API and databases
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases

Fund Momentum MCP Server — VC intelligence for AI assistants. 1000+ active VC funds, live investor signals, AI-powered startup matching.

Access millions of official legal and regulatory source documents from 155+ jurisdictions via MCP. Lawstronaut supports AI agents with structured legal research, legal data, laws, regulations, cases, guidance, official s

Verified golf club data for AI agents: holes, par, address, phone, booking links, facilities, visitor rules and green fees for golf clubs in Spain (Canary Islands and mainland), expanding across Europe. Every fact comes
Comments