postgres-mcp-server

postgres-mcp-server

0

The PostgreSQL MCP Server is a Model Context Protocol implementation that allows users to connect to a PostgreSQL database. It offers various tools for data exploration and querying through a standardized interface, enhancing database interaction with features like listing tables and retrieving schema details.

PostgreSQL MCP Server

A Model Context Protocol server for exploring and querying PostgreSQL databases.

Features

  • Connects to PostgreSQL databases with a standard connection string.
  • Executes custom SELECT queries with structured results.
  • Lists all tables in the connected database.
  • Provides schema information for tables.
  • Filters records with equality conditions.
  • Retrieves database statistics such as size and table count.

Requirements

  • Python 3.7+
  • Python packages: mcp, pg8000, sqlalchemy

Installation

  1. Clone the repository or download source code.
  2. Create a virtual environment.
  3. Install required packages.

Usage

  • Run the server with a PostgreSQL connection string.
  • Integrate with Claude Desktop via a config file.

Security

  • Restricts to SELECT queries.
  • Uses command line for connection credentials.
  • Environment variables recommended for production.