JP

javimaligno/postgres_mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

12 stars 5 forks 품질 86 트렌드 39MIT

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-28 revision and are dual-era — 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).

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

# 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
GitHub에서 전체 README 보기

설치

npx @javiagui/postgresql-mcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "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" } } } }