PostgreSQL MCP 服务器
@cynhardchuengc
About PostgreSQL MCP 服务器
No overview available yet
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"pg-mcp-server-cynhardchuengc": {
"command": "node",
"args": [
"dist/index.js",
"postgresql://用户名:密码@数据库地址:端口/数据库名"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is PostgreSQL MCP 服务器?
PostgreSQL MCP 服务器 is a database access server built on the Model Context Protocol (MCP) that enables AI assistants to safely execute PostgreSQL operations. It supports read-only SQL queries, data modification statements (INSERT, UPDATE, DELETE), table listing, and schema inspection through a standardized MCP tool interface. Designed for developers and AI agents, it acts as a secure bridge between an MCP-compatible client (e.g., Cursor) and a PostgreSQL database.
How to use PostgreSQL MCP 服务器?
Install Node.js 18+, clone the repository, run npm install and npm run build, then configure the MCP client with a connection string like postgresql://user:password@host:port/dbname. Start the server via node dist/index.js <connection_string> or through a Cursor mcp.json configuration. Environment variables control behavior such as transaction timeout, max concurrent transactions, and pool size.
Key features of PostgreSQL MCP 服务器
- Execute read-only SQL queries (SELECT statements)
- Perform data modifications with explicit commit or rollback
- List all tables in the connected database
- Describe table structure (columns, types, constraints)
- Manage database transactions with configurable timeout
- Configure connection pooling and statement timeouts via environment variables
Use cases of PostgreSQL MCP 服务器
- Let an AI assistant query production data for analysis without granting full SQL access
- Enable natural-language database exploration and schema discovery
- Automate data entry or updates under human review and confirmation
- Integrate PostgreSQL operations into AI-driven workflow automation tools
FAQ from PostgreSQL MCP 服务器
How do read-only queries differ from data modification operations?
Read-only queries (SELECT) execute immediately. DML operations (INSERT, UPDATE, DELETE) are wrapped in a transaction and require the user to reply "yes" to commit or "no" to rollback. Unconfirmed or timed-out transactions are automatically rolled back.
What are the runtime requirements?
Node.js 18.x or later and a running PostgreSQL database instance. The server uses npm and TypeScript and requires the @modelcontextprotocol/sdk package.
Where does the server store data or state?
It does not store any data locally. All data remains in the connected PostgreSQL database. Transaction state is tracked in memory and released after commit, rollback, or timeout.
What transport protocol is supported?
The server connects to the MCP client via stdio (StdioServerTransport). There is no HTTP or WebSocket transport described.
Are there any security or production deployment warnings?
The README advises against using production credentials in configuration files and recommends using read-only query capabilities instead of direct modifications on production databases. Sensible timeout and connection pool limits should be configured for production use.
More Databases MCP servers
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Elasticsearch/OpenSearch MCP Server
cr7258A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction.
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
Comments