
javimaligno/postgres_mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
The only postgress MCP server I have been able to connect to my docker postgres
Обзор
MCP server for PostgreSQL database operations. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client. This repository contains both and implementations: : The TypeScript version is used for Smithery deployments. Both versions provide identical functionality. : both servers speak the 2026-07-28 revision and are — clients that still open with the 2025-era initialize handshake are served exactly as before, so no client needs upgrading. The TypeScript package requires patched Node.js 22.23.4 or 24.22.1; the Python package requires Python 3.11+ (CI uses patched 3.11.17 and 3.12.15).
README
Показан фрагмент оригинального README. Открыть оригинал.
PostgreSQL MCP Server
MCP server for PostgreSQL database operations. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.
Language Versions
This repository contains both TypeScript and Python implementations:
| Version | Directory | Status | MCP protocol | Installation |
|---|---|---|---|---|
| TypeScript | /typescript |
✅ Recommended (Smithery) | 2026-07-28 (SDK v2) |
npm install -g @javiagui/postgresql-mcp |
| Python | /python |
✅ Stable | 2026-07-28 (SDK v2) |
pipx install postgresql-mcp |
Note: The TypeScript version is used for Smithery deployments. Both versions provide identical functionality.
Protocol compatibility: both servers speak the
2026-07-28revision and are dual-era — clients that still open with the 2025-erainitializehandshake are served exactly as before, so no client needs upgrading. The TypeScript package requires patched Node.js 22.23.4 or 24.22.1; the Python package requires Python 3.11+ (CI uses patched 3.11.17 and 3.12.15).
Features
- Query Execution: Execute SQL queries with read-only protection by default
- Schema Exploration: List schemas, tables, views, and functions
- Table Analysis: Describe structure, indexes, constraints, and statistics
- Performance Tools: EXPLAIN queries and analyze table health
- Security First: SQL injection prevention, credential protection, read-only by default
- MCP Prompts: Guided workflows for exploration, query building, and documentation
- MCP Resources: Browsable database structure as markdown
Quick Start
TypeScript (Recommended for Smithery)
# Install globally
npm install -g @javiagui/postgresql-mcp
# Or run directly with npx
npx @javiagui/postgresql-mcp
Python
# Install
pipx install postgresql-mcp
# Configure Claude Code
claude mcp add postgres -s user \
-e POSTGRES_HOST=localhost \
-e POSTGRES_USER=your_user \
-e POSTGRES_PASSWORD=your_password \
-e POSTGRES_DB=your_database \
-- postgresql-mcp
Full Installation Guide - Includes database permissions setup, remote connections, and troubleshooting.
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|
Установка
npx @javiagui/postgresql-mcpКонфигурация
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["@javiagui/postgresql-mcp"],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "your_user",
"POSTGRES_PASSWORD": "your_password",
"POSTGRES_DB": "your_database"
}
}
}
}