PostgreSQL MCP Server
@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 対応クライアントに追加してください。
{
"mcpServers": {
"postgres": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/postgres",
"postgresql://username:[email protected]:5432/mydatabase"
]
}
}
}ツール
ツールは検出されませんでした
ツールは 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
querytool. - 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.
FAQ from PostgreSQL MCP Server
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.
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.
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.
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.
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.
「データベース」の他のコンテンツ
MongoDB Lens
furey🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases
Elasticsearch/OpenSearch MCP Server
cr7258A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction.
MongoDB MCP Server
mongodb-jsA Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
mcp-server-duckdb
ktanaka101A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities
コメント