PostgreSQL
@vinsidious
关于 PostgreSQL
MCP server for getting schema information from a PostgreSQL database
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mcp-pg-schema": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}工具
1Execute read-only SQL queries against the connected database
概览
What is PostgreSQL?
A Model Context Protocol server that provides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only SQL queries.
How to use PostgreSQL?
Configure the server in the claude_desktop_config.json under mcpServers using either Docker (run mcp/postgres image) or NPX (@modelcontextprotocol/server-postgres). Provide a PostgreSQL connection URL (e.g., postgresql://host.docker.internal:5432/mydb) as an argument.
Key features of PostgreSQL
- Execute read-only SQL queries via the
querytool. - Automatically discover and serve table schemas as JSON resources.
- All queries run within a READ ONLY transaction.
- Supports Docker and NPX deployment methods.
- MIT licensed.
Use cases of PostgreSQL
- Let an LLM explore table structures and column types before generating queries.
- Allow an LLM to run safe, read-only SELECT statements against a live database.
- Provide database schema context to an AI assistant for answering questions about data.
FAQ from PostgreSQL
Is this server read-only?
Yes. All queries are executed inside a READ ONLY transaction, preventing any data modification.
What are the runtime requirements?
You need a running PostgreSQL database and either Docker or Node.js (for NPX). The server connects to the database via the provided URL.
How do I specify authentication credentials?
Include username and password in the PostgreSQL connection URL, e.g., postgresql://user:password@host:port/db-name.
Where does schema data come from?
Schema information is automatically discovered from the connected database's metadata. Each table's JSON schema includes column names and data types.
What transport does this server use?
The server follows the Model Context Protocol (stdio-based transport as typical for Claude Desktop MCP servers). The README does not detail other transport options.
数据库 分类下的更多 MCP 服务器
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
PostgreSQL Model Context Protocol (PG-MCP) Server
stuzeroClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
评论