Easy Postgres
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
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
Maintainer
Works with
Installation
Manual Installation
npx easy-postgres-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
Clone the repository
Clone the Easy Postgres MCP repository from GitHub.
git clone https://github.com/perrypixel/Easy-Postgres-MCP
cd Easy-Postgres-MCPInstall dependencies and build
Install Node.js dependencies and compile the TypeScript source to JavaScript.
npm install
npm run buildChoose 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.
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"
]
}
}
}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"
]
}
}
}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.
Easy Postgres Alternatives — Similar Databases Servers
Looking for alternatives to Easy Postgres? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
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.
Set Up Easy Postgres in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.