PostgreSQL
@jamesg31
About PostgreSQL
No overview available yet
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-server-postgres": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}Tools
1Execute read-only SQL queries against the connected database
Overview
What is PostgreSQL?
A Model Context Protocol server that provides read-only access to PostgreSQL databases. It enables LLMs to inspect database schemas and execute read-only SQL queries.
How to use PostgreSQL?
Configure the server in the mcpServers section of your claude_desktop_config.json using either Docker or NPX. Provide a PostgreSQL connection URL (e.g., postgresql://localhost/mydb). The server exposes a query tool for read-only SQL execution and automatically discovers table schemas as resources.
Key features of PostgreSQL
- Execute read-only SQL queries against the database
- Automatically discover table schemas (column names, data types)
- All queries run within a READ ONLY transaction
- Schema information exposed as JSON resources
- Supports Docker and NPX deployment methods
Use cases of PostgreSQL
- Let an LLM explore and query a PostgreSQL database safely
- Inspect database schema without write access
- Integrate read-only database queries into AI workflows
FAQ from PostgreSQL
What operations does the server allow?
The server only permits read-only SQL queries executed within a READ ONLY transaction. No write operations are possible.
How do I connect to a PostgreSQL database?
Use a PostgreSQL connection URL such as postgresql://user:password@host:port/db-name. For Docker on macOS, use host.docker.internal if the database runs on the host.
What schema information is exposed?
Table schemas are provided as JSON resources at postgres://<host>/<table>/schema, including column names and data types. Schemas are automatically discovered from database metadata.
What are the runtime requirements?
The server can be run via Docker (using the mcp/postgres image) or via NPX (using @modelcontextprotocol/server-postgres). No additional dependencies are listed beyond a PostgreSQL connection.
Is the server licensed?
Yes, it is licensed under the MIT License.
Frequently asked questions
What operations does the server allow?
The server only permits read-only SQL queries executed within a READ ONLY transaction. No write operations are possible.
How do I connect to a PostgreSQL database?
Use a PostgreSQL connection URL such as `postgresql://user:password@host:port/db-name`. For Docker on macOS, use `host.docker.internal` if the database runs on the host.
What schema information is exposed?
Table schemas are provided as JSON resources at `postgres://<host>/<table>/schema`, including column names and data types. Schemas are automatically discovered from database metadata.
What are the runtime requirements?
The server can be run via Docker (using the `mcp/postgres` image) or via NPX (using `@modelcontextprotocol/server-postgres`). No additional dependencies are listed beyond a PostgreSQL connection.
Is the server licensed?
Yes, it is licensed under the MIT License.
Basic information
More Databases MCP servers
Neon MCP Server
neondatabase-labsMCP server for interacting with Neon Management API and databases
Database Gateway
centralmindUniversal MCP-Server for your Databases optimized for LLMs and AI-Agents.
Postgres Mcp
crystaldbaPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Sail MCP Server for Spark SQL
lakehqDrop-in Apache Spark replacement written in Rust, unifying batch processing, stream processing, and compute-intensive AI workloads.
Comments