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.
数据库 分类下的更多 MCP 服务器
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
PostgreSQL Model Context Protocol (PG-MCP) Server
stuzeromcp-server-qdrant: A Qdrant MCP server
qdrantAn official Qdrant Model Context Protocol (MCP) server implementation
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
评论