Easy Postgres

v1.0.0Databasesstable

Minimal MCP server for PostgreSQL. Easily execute SQL queries with configurable read-only or write access, simple setup, and structured results—ideal for integrating PostgreSQL with MCP-compatible tool

easy-postgres-mcpmcpai-integration
Share:
13
Stars
0
Downloads
0
Weekly
0/5

What is Easy Postgres?

Easy Postgres is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to minimal mcp server for postgresql. easily execute sql queries with configurable read-only or write access, simple setup, and structured results—ideal for integrating postgresql with mcp-compatible too...

Minimal MCP server for PostgreSQL. Easily execute SQL queries with configurable read-only or write access, simple setup, and structured results—ideal for integrating PostgreSQL with MCP-compatible tool

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Minimal MCP server for PostgreSQL. Easily execute SQL querie

Use Cases

Execute SQL queries against PostgreSQL with read-only or write access.
Integrate PostgreSQL databases with AI tools for data analysis and manipulation.
perrypixel

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx easy-postgres-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Easy Postgres

Easy Postgres MCP is a minimal TypeScript MCP server that gives AI assistants the ability to execute SQL queries against a PostgreSQL database in either read-only or write mode. It accepts a PostgreSQL connection string and a mode flag at startup, returning structured results with metadata for every query. This straightforward setup makes it ideal for analysts and developers who want to give their AI assistant direct, controlled access to a Postgres database without complex configuration.

Prerequisites

  • Node.js 18 or later and npm
  • A running PostgreSQL database instance
  • A valid PostgreSQL connection string (postgresql://user:password@host:5432/dbname)
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Clone the repository

Clone the Easy Postgres MCP repository from GitHub.

git clone https://github.com/perrypixel/Easy-Postgres-MCP
cd Easy-Postgres-MCP
2

Install dependencies and build

Install Node.js dependencies and compile the TypeScript source to JavaScript.

npm install
npm run build
3

Choose your access mode

Decide whether the AI assistant should have read-only or write access to your database. Read-only mode is recommended for analysis and exploration; write mode allows INSERT, UPDATE, and DELETE operations.

4

Configure Claude Desktop for read-only access

Add the server to your MCP client configuration, passing your connection string and 'readonly' as command-line arguments.

{
  "mcpServers": {
    "easy-postgres": {
      "command": "node",
      "args": [
        "/path/to/Easy-Postgres-MCP/build/index.js",
        "postgresql://username:password@localhost:5432/your_database",
        "readonly"
      ]
    }
  }
}
5

Configure for write access (optional)

To enable write operations, change the mode argument from 'readonly' to 'write'. Use with caution and only against databases where AI-generated modifications are acceptable.

{
  "mcpServers": {
    "easy-postgres-write": {
      "command": "node",
      "args": [
        "/path/to/Easy-Postgres-MCP/build/index.js",
        "postgresql://username:password@localhost:5432/your_database",
        "write"
      ]
    }
  }
}
6

Restart your MCP client and query

Restart Claude Desktop or your MCP client to load the configuration. You can now ask your AI assistant to run SQL queries against your PostgreSQL database.

Easy Postgres Examples

Client configuration

Claude Desktop configuration for Easy Postgres MCP in read-only mode.

{
  "mcpServers": {
    "easy-postgres": {
      "command": "node",
      "args": [
        "/path/to/Easy-Postgres-MCP/build/index.js",
        "postgresql://username:password@localhost:5432/mydb",
        "readonly"
      ]
    }
  }
}

Prompts to try

Example prompts for querying your PostgreSQL database through an AI assistant.

- "List all tables in the current database schema"
- "Show me the 10 most recent orders from the orders table"
- "How many users signed up in the last 30 days?"
- "Write a SQL query to find the top 5 products by revenue and run it"
- "Describe the schema of the customers table including column types and constraints"

Troubleshooting Easy Postgres

Connection refused or authentication failed error

Verify the connection string format: postgresql://user:password@host:port/dbname. Ensure PostgreSQL is running and the user has permission to connect. Test the connection string directly with psql before adding it to the MCP config.

Write operations fail when mode is 'readonly'

Read-only mode blocks INSERT, UPDATE, DELETE, and DDL statements by design. If write access is needed, configure a separate server entry with 'write' mode, or change the existing entry's mode argument.

Build fails with TypeScript errors

Ensure you are using Node.js 18 or later. Run npm install again to confirm all dependencies are present, then retry npm run build. If errors persist, check that your Node.js and TypeScript versions meet the project's requirements.

Frequently Asked Questions about Easy Postgres

What is Easy Postgres?

Easy Postgres is a Model Context Protocol (MCP) server that minimal mcp server for postgresql. easily execute sql queries with configurable read-only or write access, simple setup, and structured results—ideal for integrating postgresql with mcp-compatible tool It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Easy Postgres?

Follow the installation instructions on the Easy Postgres GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Easy Postgres?

Easy Postgres works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Easy Postgres free to use?

Yes, Easy Postgres is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "easy-postgres-mcp": { "command": "npx", "args": ["-y", "easy-postgres-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Easy Postgres?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides