postgres-mcp

postgres-mcp

6

Postgres MCP is a Model Control Protocol (MCP) server designed for PostgreSQL databases, allowing users to execute read-only queries via an HTTP interface. It is built with Go and uses the Gin web framework.

Postgres MCP (Research Project)

A Model Control Protocol (MCP) server implementation for PostgreSQL databases. This project provides a simple HTTP interface to interact with PostgreSQL databases through MCP, allowing execution of read-only queries and exploration of database resources.

Features

  • MCP-compliant HTTP server
  • Read-only SQL query execution
  • Database resource listing
  • Environment variable support through .env files
  • Built with Go and Gin web framework

Prerequisites

  • Go 1.23.6 or later
  • PostgreSQL database
  • Git

Installation

Clone the repository and download the modules.

Configuration

Configure the database connection using command-line flags or environment variables.

Usage

Start the server and interact with MCP endpoints for listing resources and executing read-only queries.