MCP.so
Sign In

PostgreSQL MCP Server

@tobecrazy

About PostgreSQL MCP Server

A postgresql-mcp server

Basic information

Category

Databases

Runtime

python

Transports

stdio

Publisher

tobecrazy

Config

No standard config provided

This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.

Repository

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is PostgreSQL MCP Server?

PostgreSQL MCP Server is a Model Context Protocol server that provides CRUD operations for PostgreSQL database tables through a set of MCP tools. It uses the FastMCP library, runs in stdio mode, and is compatible with various MCP clients.

How to use PostgreSQL MCP Server?

Clone the repository, install dependencies with pip install -r requirements.txt, edit the config.yaml file with database credentials and table permissions, then run python postgresql_mcp_server.py to start the server in stdio mode.

Key features of PostgreSQL MCP Server

  • Connect to PostgreSQL databases
  • Perform CRUD operations on specified tables
  • Table and column-level access control
  • Schema inspection
  • Custom SQL query execution
  • Configuration via YAML file

Use cases of PostgreSQL MCP Server

  • Query and modify PostgreSQL tables from an MCP-compatible language model
  • Inspect table schemas to understand database structure
  • Execute parameterized custom SQL queries
  • Manage data with configurable per-table and per-column permissions

FAQ from PostgreSQL MCP Server

What dependencies are required?

Python 3 with the FastMCP package and other dependencies listed in requirements.txt (install via pip install -r requirements.txt).

How is access to tables and columns controlled?

Access is configured in the config.yaml file, where you specify which tables are accessible, which columns are allowed for operations, and which operations (create, read, update, delete) are permitted per table.

What transport mode does the server use?

The server runs in stdio mode, making it compatible with MCP clients that communicate over standard input and output.

Is there a security risk with the execute_query tool?

Yes. The execute_query tool allows arbitrary SQL execution. The README advises considering restricting its use or implementing additional validation, as this could be a security risk if not carefully managed.

How are database credentials stored?

Database credentials are stored in plain text in the config.yaml file. The README recommends using environment variables or a secure secret management solution in production.

Comments

More Databases MCP servers