PostgreSQL MCP Server
@habuvo
关于 PostgreSQL MCP Server
MCP server to interact with and inspect PostgreSQL DB
基本信息
配置
工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is PostgreSQL MCP Server?
PostgreSQL MCP Server is a Model Context Protocol (MCP) server that provides a standardized API for interacting with PostgreSQL databases. It enables developers to execute queries, perform database operations, and manage transactions through MCP-compatible clients while using parameterized inputs for secure SQL execution.
How to use PostgreSQL MCP Server?
Clone the repository, install dependencies via go mod download, configure database credentials in a .env file, build with go build -o postgres-mcp, and run the server with ./postgres-mcp. The server exposes four MCP tools—execute_tool, query_tool, transaction_tool, and schema_tool—that accept JSON-formatted requests and return structured responses. A Go client example is provided in the README.
Key features of PostgreSQL MCP Server
- Execute SQL queries with parameterized inputs
- Perform database operations (INSERT, UPDATE, DELETE)
- Execute transactions with multiple statements
- Retrieve database schema information for tables
- Secure parameter handling to prevent SQL injection
Use cases of PostgreSQL MCP Server
- Running SELECT queries and returning result rows with column metadata
- Inserting, updating, or deleting records via parameterized statements
- Executing multiple statements atomically within a single transaction
- Obtaining column names, data types, and nullability for a given table
FAQ from PostgreSQL MCP Server
What MCP tools does the server expose?
The server provides four tools: execute_tool (single SQL statement), query_tool (SELECT queries), transaction_tool (multi-statement transactions), and schema_tool (table schema).
How does the server prevent SQL injection?
All queries must use parameterized inputs (e.g., $1, $2) rather than concatenating user-provided values directly into SQL strings.
What are the runtime dependencies?
The server is written in Go and requires a PostgreSQL database. Database connection details are configured in a .env file using credentials provided by the user.
Can I run multiple statements in a single request?
Yes, the transaction_tool accepts an array of statements and executes them as an atomic transaction, returning results for each statement.
Is SSL/TLS supported for database connections?
Yes, the README recommends using SSL/TLS for database connections in production environments.
数据库 分类下的更多 MCP 服务器

Redis
modelcontextprotocolModel Context Protocol Servers
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
MCP Server for MySQL based on NodeJS
benborlaA Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
Postgres Mcp
crystaldbaPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
评论