Skip to main content
Glama
eddykuhan

Postgres MCP Server

by eddykuhan

Postgres MCP Server

A Model Context Protocol (MCP) server that exposes Postgres database information to VS Code agents and other MCP-compatible clients.

Features

  • List available databases

  • List schemas in a database

  • List tables in a schema

  • Get table schema (columns)

  • Execute read-only SQL queries

Related MCP server: PostgreSQL MCP Server

Setup

  1. Create a virtual environment and install dependencies:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  2. Configure your Postgres connection in .env:

    DB_HOST=localhost
    DB_PORT=5432
    DB_NAME=postgres
    DB_USER=postgres
    DB_PASSWORD=your_password
  3. Run the server:

    source venv/bin/activate
    python server.py

Usage with VS Code

Add to your .vscode/mcp.json:

{
  "servers": {
    "postgres-mcp": {
      "type": "stdio",
      "command": "venv/bin/python",
      "args": ["server.py"]
    }
  }
}

Tools

  • list_databases: Lists all databases

  • list_schemas: Lists schemas in a database

  • list_tables: Lists tables in a schema

  • get_table_schema: Gets column details for a table

  • execute_query: Runs SELECT queries (read-only)

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables secure querying of PostgreSQL databases through MCP-compatible clients. Supports read-only SQL execution, table exploration, and connection management with built-in security validation.
    3
    41
    9
    MIT
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables users to perform SQL query execution, schema exploration, and performance analysis on PostgreSQL databases through any MCP-compatible client. It prioritizes security with read-only protection by default and provides guided workflows for database documentation and optimization.
    -
  • A
    license
    A
    quality
    C
    maintenance
    Provides PostgreSQL database management and analysis via MCP, enabling schema exploration, query execution, performance monitoring, and database health checks.
    36
    23
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables interaction with PostgreSQL databases through MCP, supporting queries, DDL, DML, and schema inspection.
    6
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eddykuhan/postgres-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server