MCP.so
ログイン

PostgreSQL MCP Server

@aadarshjain

PostgreSQL MCP Server について

MCP Server (STDIO) for PostgreSQL Database

基本情報

カテゴリ

データベース

ライセンス

MIT

ランタイム

python

トランスポート

stdio

公開者

aadarshjain

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "postgres-mcp-server-aadarshjain": {
      "command": "python",
      "args": [
        "server.py",
        "postgresql://username:password@hostname:port/database"
      ]
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is PostgreSQL MCP Server?

A Model Context Protocol (MCP) server implementation that connects to a PostgreSQL database and exposes data discovery and querying capabilities as MCP tools. It is intended for developers and AI assistants (e.g., Claude Desktop) to explore database structure and query data through a standardized interface.

How to use PostgreSQL MCP Server?

Run the server by providing a PostgreSQL connection string: python server.py postgresql://username:password@hostname:port/database. For integration with Claude Desktop, add the configuration to the Claude Desktop config file (located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows, or ~/.config/Claude/claude_desktop_config.json on Linux) and restart the app.

Key features of PostgreSQL MCP Server

  • Connect to any PostgreSQL database using a connection string.
  • Execute custom SELECT queries with structured results.
  • List all tables in the connected database.
  • Get detailed schema information for any table.
  • Filter database records with simple equality conditions.
  • Get database statistics including size, table count, and largest tables.

Use cases of PostgreSQL MCP Server

  • Explore database tables and schemas through an AI assistant.
  • Query data from PostgreSQL using natural language in Claude Desktop.
  • Retrieve database statistics for monitoring or reporting.
  • Filter records based on simple criteria without writing raw SQL.
  • Integrate PostgreSQL exploration into MCP-compatible applications.

FAQ from PostgreSQL MCP Server

What types of SQL queries are allowed?

Only SELECT queries are permitted to prevent database modifications. Connection credentials are provided via the command line and not stored.

What are the requirements to run the server?

Python 3.7+ and the required packages (mcp, pg8000, sqlalchemy) must be installed. A virtual environment is recommended.

How do I configure this server for Claude Desktop?

Add a JSON entry to the Claude Desktop config file (see the config file locations above) with the command pointing to the absolute path of server.py and the connection string as an argument. Then restart Claude Desktop.

Where is the Claude Desktop configuration file located?

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %APPDATA%\Claude\claude_desktop_config.json. On Linux: ~/.config/Claude/claude_desktop_config.json.

Why does the server crash or fail to connect?

Check that the PostgreSQL connection string is correct, the server allows connections from your client, and all dependencies are installed. Use absolute paths for the Python executable if needed.

コメント

「データベース」の他のコンテンツ