
Postgres MCP
Let your coding agent inspect and query PostgreSQL using env-mapped credentials, selectable tools, and read-only defaults for safer exploration.
Overview
Postgres MCP is a MCP server for the Build phase that connects AI agents to PostgreSQL with .env key mapping, configurable tools, and read-only-by-default safety.
What is this MCP server?
- npm package @edelciomolina/postgres-mcp v1.0.9 with stdio transport
- .env indirection via MCP_KEY_HOST, PORT, NAME, USER, PASS variable names
- Tool selection so you expose only the database operations you intend
- Safe read-only defaults to limit accidental writes during agent sessions
- Package version 1.0.9
- Five MCP_KEY_* environment variable name mappings
- Transport: stdio via npm registry
Community signal: 5 GitHub stars.
What problem does it solve?
Agents need database context but pasting connection strings into prompts is unsafe and full write access is risky during exploratory coding.
Who is it for?
Solo builders shipping Postgres-backed SaaS or APIs who want stdio MCP in Claude Code or Cursor with guarded defaults.
Skip if: Builders without a Postgres instance, or teams that need a managed hosted analytics warehouse instead of direct SQL agent access.
What do I get? / Deliverables
Your agent can list schemas, run approved read queries, and assist backend work using credentials referenced from your local .env mapping.
- Agent-executable read-oriented SQL and schema operations against your Postgres
- Configurable MCP tool surface aligned with your risk tolerance
Recommended MCP Servers
Journey fit
Build is the canonical phase because the server wires live Postgres access into agent-driven implementation and debugging work. Backend subphase matches schema introspection, SQL execution, and data-layer tasks during feature work rather than launch analytics.
How it compares
stdio database MCP integration—not a migration framework, ORM skill, or cloud provisioning CLI.
Common Questions / FAQ
Who is Postgres MCP for?
Developers using AI agents who maintain PostgreSQL apps and want MCP-driven schema and query assistance with env-based credential mapping.
When should I use Postgres MCP?
Use it while building or debugging backend features when the agent needs live database context and you want read-only defaults until you explicitly enable more tools.
How do I add Postgres MCP to my agent?
Install @edelciomolina/postgres-mcp from npm, add a stdio MCP server entry in your client config, and set MCP_KEY_HOST, MCP_KEY_PORT, MCP_KEY_NAME, MCP_KEY_USER, and MCP_KEY_PASS to the names of your .env variables.