Sponsored by Deepsite.site

MCP Server for PostgreSQL

Created By
JaviMalignoa month ago
MCP server with 14 tools for PostgreSQL database operations. Query databases, explore schemas, analyze tables, list indexes/constraints, and get performance statistics. Features security-first design with SQL injection prevention and read-only mode by default. Works with Claude Desktop, Claude Code, and any MCP-compatible client.
Overview

What is PostgreSQL MCP?

PostgreSQL MCP is a server designed for PostgreSQL database operations, providing a suite of 14 tools for querying databases, exploring schemas, analyzing tables, and obtaining performance statistics. It emphasizes security with features like SQL injection prevention and a read-only mode by default.

How to use PostgreSQL MCP?

To use PostgreSQL MCP, install it via pipx or pip, configure it with your PostgreSQL credentials, and then interact with it through compatible clients like Claude Code or Claude Desktop.

Key features of PostgreSQL MCP?

  • Query Execution: Execute SQL queries with read-only protection.
  • Schema Exploration: List schemas, tables, views, and functions.
  • Table Analysis: Describe structure, indexes, constraints, and statistics.
  • Performance Tools: Analyze query performance and table health.
  • Security First: SQL injection prevention and credential protection.
  • Guided Workflows: MCP prompts for exploration and query building.

Use cases of PostgreSQL MCP?

  1. Executing read-only SQL queries against a PostgreSQL database.
  2. Exploring database schemas and structures.
  3. Analyzing table performance and generating documentation.

FAQ from PostgreSQL MCP?

  • Can PostgreSQL MCP handle write operations?

Yes, write operations can be enabled, but are blocked by default for security.

  • Is PostgreSQL MCP free to use?

Yes, PostgreSQL MCP is open-source and free to use.

  • How does PostgreSQL MCP ensure security?

It implements multiple security layers including SQL injection prevention and read-only mode by default.

Server Config

{
  "mcpServers": {
    "postgres": {
      "command": "postgresql-mcp",
      "env": {
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "your-user",
        "POSTGRES_PASSWORD": "your-password",
        "POSTGRES_DB": "your-database"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.