PostgreSQL MCP Server (Enhanced)
@GarethCott
关于 PostgreSQL MCP Server (Enhanced)
暂无概览
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"enhanced-postgres-mcp-server": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"Dockerfile",
"."
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is PostgreSQL MCP Server (Enhanced)?
A Model Context Protocol server that provides both read and write access to PostgreSQL databases. It enables LLMs to inspect database schemas, execute queries, modify data, and create or modify database schema objects. This is an enhanced version of the original read-only PostgreSQL MCP server by Anthropic, adding write capabilities and schema management.
How to use PostgreSQL MCP Server (Enhanced)?
Configure it in the "mcpServers" section of your claude_desktop_config.json. Use either Docker (run docker run -i --rm mcp/postgres) or NPX (run npx -y @modelcontextprotocol/server-postgres), providing a PostgreSQL connection URL such as postgresql://host:port/db-name. Then invoke tools like /query, /insert, /update, /createTable, /createFunction, /createTrigger with the required arguments.
Key features of PostgreSQL MCP Server (Enhanced)
- Execute read-only SQL queries with prepared statements
- Insert, update, and delete records in tables
- Create and alter tables, indexes, functions, and triggers
- Automatic schema discovery as MCP resources
- Parameterized queries for SQL injection prevention
- Transactional handling with proper COMMIT/ROLLBACK
Use cases of PostgreSQL MCP Server (Enhanced)
- LLM-driven inspection of database schemas and data
- Automated data entry and record updates via natural language commands
- Schema evolution, such as adding columns or creating indexes
- Setting up database functions and triggers through conversational AI
FAQ from PostgreSQL MCP Server (Enhanced)
How does this version differ from the original PostgreSQL MCP server?
The original server provides read-only access. This enhanced version adds write capabilities (INSERT, UPDATE, DELETE) and schema management tools like create table, function, trigger, index, and alter table.
What security measures are implemented?
All data modification operations use transactions with COMMIT/ROLLBACK handling. Insert/update operations use parameterized queries to prevent SQL injection. The read-only query tool uses prepared statements to block multi‑statement injection attacks.
How do I connect to a PostgreSQL database?
Provide a PostgreSQL connection URL in the server configuration (e.g., postgresql://user:password@host:port/db-name). For Docker on macOS, use host.docker.internal if the server runs on the host network. Add ?sslmode=no-verify to bypass SSL verification if needed.
Can I create functions and triggers with this server?
Yes. Tools /createFunction and /createTrigger allow creating PostgreSQL functions (specifying language, parameters, body) and triggers (defining when, events, forEach, optional condition).
Does the server use transactions for modifications?
Yes. Each execution of the execute tool is performed within a transaction with proper COMMIT or ROLLBACK handling. Insert, update, and delete tools also run inside a transaction context.
数据库 分类下的更多 MCP 服务器
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
Snowflake MCP Server
isaacwassermanMeilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
MySQL MCP Server
designcomputerA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
评论