MCP.so
ログイン

PostgreSQL MCP Server

@vignesh-codes

基本情報

カテゴリ

データベース

ライセンス

MIT

トランスポート

stdio

作者

vignesh-codes

PostgreSQL MCP Server について

This repo is an extension of PostgreSQL MCP Server providing functionalities to create tables, insert entries, update entries, delete entries, and drop tables.

#mcp#ai-agents#llm-postgres

PostgreSQL MCP Server の設定

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

{
  "mcpServers": {
    "postgres": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/postgres",
        "postgresql://username:password@host.docker.internal:5432/mydatabase"
      ]
    }
  }
}

PostgreSQL MCP Server のツール

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

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

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

概要

What is PostgreSQL MCP Server?

A Model Context Protocol server that enables LLMs to interact with PostgreSQL databases. It supports inspecting schemas, executing read-only queries, and performing CRUD operations such as creating tables, inserting, updating, deleting entries, and dropping tables. Designed for use with Claude Desktop.

How to use PostgreSQL MCP Server?

Install Docker and Claude Desktop, clone the repository, run a PostgreSQL Docker container, build the MCP server image, then configure claude_desktop_config.json with a Docker command pointing to your PostgreSQL URL. Restart Claude Desktop to connect.

Key features of PostgreSQL MCP Server

  • Execute read-only SQL queries via the query tool.
  • Create tables dynamically with specified columns and data types.
  • Insert new entries into any table.
  • Update existing entries based on conditions.
  • Delete entries from tables using conditions.
  • Drop entire tables from the database.
  • Provides JSON schema information for each table as a resource.

Use cases of PostgreSQL MCP Server

  • Ask an LLM to inspect database schemas and explain table structure.
  • Have the LLM create new tables and populate them with sample data.
  • Update or delete records in a database through natural language instructions.
  • Perform ad‑hoc read‑only queries to analyze data without writing SQL.
  • Prototype database schemas and test relationships interactively.

よくある質問

1

What does this server do that the base PostgreSQL MCP server doesn’t?

It extends the base server with full CRUD capabilities: create tables, insert, update, delete entries, and drop tables, beyond the original read‑only query functionality.

2

What are the runtime requirements?

Docker is required to build and run the MCP server. The PostgreSQL database can run in a separate Docker container or be an existing remote instance accessible via connection URL.

3

Where does the data live?

Data resides in the PostgreSQL database you connect to. The server does not store any data locally; it only executes operations against the provided database.

4

How do I connect the server to my database?

In `claude_desktop_config.json`, provide a PostgreSQL connection string (e.g., `postgresql://user:password@host:port/db-name`) as an argument to the Docker container. Use `host.docker.internal` to reach a host service when running Docker on macOS.

5

Are operations atomic or transactional?

Read‑only queries are executed within a READ‑ONLY transaction. The CRUD operations (create, insert, update, delete, drop) are performed immediately; the README does not mention explicit transaction control for those operations.

コメント

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