MCP.so
ログイン

PostgreSQL MCP Server (MCP)

@VivekMalipatel

基本情報

カテゴリ

データベース

ライセンス

MIT

トランスポート

stdio

作者

VivekMalipatel

PostgreSQL MCP Server について

FastMCP Based MCP Server to Control Postgres

PostgreSQL MCP Server の設定

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

{
  "mcpServers": {
    "Postgres_MCP_Server": {
      "command": "python",
      "args": [
        "-m",
        "venv",
        ".mcp"
      ]
    }
  }
}

PostgreSQL MCP Server のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

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

概要

What is PostgreSQL MCP Server?

A FastMCP-powered Model Context Protocol server that gives AI assistants (Claude, Cursor, etc.) full, structured access to a PostgreSQL database — no SQL knowledge required from the user.

How to use PostgreSQL MCP Server?

Clone the repository, create a virtual environment, install dependencies from requirements.txt, and configure a .env file with database credentials. Then connect an MCP-compatible client (e.g., Claude Desktop) by adding the provided JSON block to its MCP config file. Alternatively, run manually with python postgres_mcp_server.py.

Key features of PostgreSQL MCP Server

  • Exposes database as MCP Resources (read-only) and MCP Tools (read/write)
  • Parameterised queries throughout — no SQL injection
  • Structured stdout logs on every tool/resource call
  • Schema inspection: list tables, column definitions
  • Read/write/DDL operations via tools
  • Raw SQL execution via the execute_query tool

Use cases of PostgreSQL MCP Server

  • AI assistant querying database in natural language
  • Automated schema exploration and data preview
  • Performing insert, update, delete operations through conversational interface
  • Creating and dropping tables via AI assistant

よくある質問

1

What transport does PostgreSQL MCP Server use?

The server uses stdio transport (MCP protocol over standard input/output).

2

What are the runtime requirements?

Python 3.8+ and a PostgreSQL server (local or remote) with the `uv` package runner (recommended) or `pip`.

3

How are database credentials configured?

Via a `.env` file with `POSTGRES_HOST`, `POSTGRES_PORT`, `POSTGRES_DB`, `POSTGRES_USER`, and `POSTGRES_PASSWORD`, or directly in the client config's `env` block.

4

What dependencies are required?

`mcp[cli]`, `asyncpg`, `psycopg2-binary`, `python-dotenv`, `httpx`, `uvicorn`, and `uv`.

5

What are the limits on data access?

The `postgres://data/{table_name}` resource returns only the first 100 rows as a safe preview. Other tools allow configurable limits.

コメント

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