Skip to main content
Glama
MCP Postgres Server

MCP Postgres Server

by MadeByNando

MCP Postgres 서버

이 서버는 Cursor에 대한 MCP(Model Context Protocol)를 구현하여 PostgreSQL 데이터베이스를 모델 컨텍스트의 저장소로 사용할 수 있도록 합니다.

필수 조건

  • 도커

  • 도커 컴포즈

Related MCP server: pg-mcp-server

설치 및 시작

  1. 이 저장소를 복제하세요

  2. Docker Compose로 서버를 시작합니다.

지엑스피1

커서의 구성

  1. 커서 열기

  2. 설정 > MCP로 이동하세요

  3. 다음 설정으로 새 연결을 추가합니다.

    • 이름: MCP Postgres 서버

    • 유형: 명령

    • 명령어: docker exec -i mcp-postgres-server node dist/index.js

문제 해결

서버가 올바르게 시작되지 않으면:

  1. 컨테이너 로그를 확인하세요.

    docker logs mcp-postgres-server
  2. 서버를 다시 시작하려면:

    docker-compose restart

MCP 서버 기능

MCP PostgreSQL 서버는 Cursor에 대해 다음과 같은 도구를 제공합니다.

  1. postgres_query - 읽기 전용 SQL 쿼리 실행

  2. postgres_list_tables - 데이터베이스의 모든 테이블 나열

  3. postgres_describe_table - 특정 테이블의 스키마를 가져옵니다

이러한 도구를 사용하면 Cursor가 데이터베이스를 안전하게 탐색하고 쿼리할 수 있습니다.

Available Tools

10 tools
describe_tableC

Get the structure of a database table

Inputs: schema (required), table (required).

explain_queryC

Get query execution plan (EXPLAIN)

Inputs: sql (required), analyze, buffers, costs, +1 more.

get_constraintsC

Get constraints for a table

Inputs: schema (required), table (required).

get_table_statsC

Get table statistics and size information

Inputs: schema (required), table.

list_functionsC

List functions and procedures in a schema

Inputs: schema.

list_indexesC

List indexes for a table or schema

Inputs: schema (required), table.

list_schemasC

List all schemas in the database

Inputs: includeSystemSchemas.

list_tablesC

List all tables in a schema

Inputs: schema.

list_viewsC

List views in a schema

Inputs: schema.

queryA

Execute SQL queries with pagination support and parameterization for security. Supports page sizes up to 500 rows.

Inputs: sql (required), offset, pageSize, parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific database metadata or operations, with no overlap. For example, list_tables enumerates tables, describe_table provides table structure, and query executes SQL, making them easily distinguishable.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern using snake_case, such as list_tables, describe_table, and get_constraints. This uniformity makes the tool set predictable and easy to navigate.

    Tool Count5/5

    With 10 tools, the server is well-scoped for database introspection and querying, covering essential metadata operations without being overwhelming. Each tool serves a clear, necessary function in the domain.

    Completeness4/5

    The tool set provides comprehensive coverage for database metadata exploration and query execution, including listing, describing, and analyzing tables, schemas, and functions. A minor gap is the lack of tools for modifying database structures (e.g., creating or altering tables), but core read operations are complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server for PostgreSQL databases that enables AI agents to connect, query, and explore multiple databases with schema discovery and extension context.
      542
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for PostgreSQL that enables Cursor and other MCP clients to execute SQL queries, list tables, and explore database schemas via HTTP.
      MIT