Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • SQLite MCP Server
  • TMDB MCP Server
  • MCP Model Context Protocol Server
  • Xano MCP Server for Smithery
  • CouchDB MCP Server
Back to MCP Servers
PostgreSQL MCP Server

PostgreSQL MCP Server

Public
jamesg31/mcp-server-postgres

Provides read-only access to PostgreSQL databases via Model Context Protocol, enabling LLMs to inspect database schemas and execute secure, read-only SQL queries for enhanced data analysis and integration.

javascript
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with PostgreSQL MCP Server

MCP Server

Unlock the full potential of PostgreSQL MCP Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

PostgreSQL

A Model Context Protocol server that provides read-only access to PostgreSQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

Components

Tools

  • query
    • Execute read-only SQL queries against the connected database
    • Input: sql (string): The SQL query to execute
    • All queries are executed within a READ ONLY transaction

Resources

The server provides schema information for each table in the database:

  • Table Schemas (postgres:////schema)
    • JSON schema information for each table
    • Includes column names and data types
    • Automatically discovered from database metadata

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

Docker

  • when running docker on macos, use host.docker.internal if the server is running on the host network (eg localhost)
  • username/password can be added to the postgresql url with postgresql://user:password@host:port/db-name
{ "mcpServers": { "postgres": { "command": "docker", "args": [ "run", "-i", "--rm", "mcp/postgres", "postgresql://host.docker.internal:5432/mydb"] } } }

NPX

{ "mcpServers": { "postgres": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb" ] } } }

Replace /mydb with your database name.

Building

Docker:

docker build -t mcp/postgres -f src/postgres/Dockerfile .

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • SQLite MCP Server
    SQLite MCP Server

    A Model Context Protocol server enabling AI models to execute SQL queries, manage SQLite database sc...

    Added May 30, 2025
  • TMDB MCP Server
    TMDB MCP Server

    Provides AI assistants with seamless access to The Movie Database API via Model Context Protocol, en...

    Added May 30, 2025
  • MCP Model Context Protocol Server
    MCP Model Context Protocol Server

    Demonstrates Model Context Protocol (MCP) integration enabling AI models to execute tools, access re...

    Added May 30, 2025
  • Xano MCP Server for Smithery
    Xano MCP Server for Smithery

    Model Context Protocol server enabling seamless integration between Claude AI and Xano databases wit...

    Added May 30, 2025
  • CouchDB MCP Server
    CouchDB MCP Server

    Model Context Protocol server enabling AI assistants to manage CouchDB databases and documents with ...

    9 tools
    Added May 30, 2025