Skip to main content
MCP server CX Codex

read-only-local-postgres-mcp-server — Claude Code MCP server

Connect PostgreSQL to an agent over MCP and run queries that cannot write to the database. Useful for asking questions about tables and records in plain language.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add read-only-local-postgres-mcp-server -- npx -y @hovecapital/read-only-postgres-mcp-server
Open on GitHub

What read-only-local-postgres-mcp-server does

This MCP server lets Claude Code query PostgreSQL and returns results as JSON. You can switch database connections at runtime. Set DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD as environment variables for the connection.

Before a query runs, the server validates its SQL and uses a transaction marked READ ONLY. Writes through this connection are blocked. You need Node.js version 16 or later and a PostgreSQL server; with mise, configure the full path to the Node.js executable.

What it helps with

  • inspect the tables in a PostgreSQL database
  • retrieve database records through natural-language requests
  • run SQL that cannot modify data
  • switch to another database connection at runtime

Example prompts for the agent

  • List the tables in my PostgreSQL database.
  • Show rows from customers without changing anything.
  • Connect to another PostgreSQL database and find its order tables.

How to install read-only-local-postgres-mcp-server

Platform CLI

claude mcp add read-only-local-postgres-mcp-server -- npx -y @hovecapital/read-only-postgres-mcp-server

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about read-only-local-postgres-mcp-server

How do I install read-only-local-postgres-mcp-server in Claude Code?

Run claude mcp add read-only-local-postgres-mcp-server -- npx -y @hovecapital/read-only-postgres-mcp-server, set the PostgreSQL connection environment variables, then restart Claude Code.

What does read-only-local-postgres-mcp-server do?

It gives Claude Code an MCP connection for querying PostgreSQL and returns the results as JSON. SQL is validated, and queries run in read-only transactions.

What does the server need to run?

It requires Node.js version 16 or later, a PostgreSQL server, and connection settings for the host, port, database, username, and password.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor