Basic information
About PostgreSQL Model Context Protocol (PG-MCP) Server
# PostgreSQL Model Context Protocol (PG-MCP) Server
PostgreSQL Model Context Protocol (PG-MCP) Server is a MCP server in the Databases category listed in the AddMCP.net directory, published by tanster1234. Supported transport: stdio. Runtime: python. Source code is hosted on github.com.
Setup
{
"mcpServers": {
"mcp_server_postgres": {
"command": "python",
"args": [
"-m",
"venv",
".venv"
]
}
}
}
{
"mcpServers": {
"mcp_server_postgres": {
"command": "python",
"args": [
"-m",
"venv",
".venv"
]
}
}
}
{
"servers": {
"mcp_server_postgres": {
"command": "python",
"args": [
"-m",
"venv",
".venv"
]
}
}
}
PostgreSQL Model Context Protocol (PG-MCP) Server — by tanster1234 config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp_server_postgres": {
"command": "python",
"args": [
"-m",
"venv",
".venv"
]
}
}
}
PostgreSQL Model Context Protocol (PG-MCP) Server — by tanster1234 tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is PostgreSQL Model Context Protocol (PG-MCP) Server?
It is an MCP server for PostgreSQL databases that provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture. It is built for AI agents and developers who need to integrate natural language interfaces with PostgreSQL.
How to use PostgreSQL Model Context Protocol (PG-MCP) Server?
Install via Docker or manual setup with Python 3.13+. Run python -m server.app after installing dependencies with uv sync --frozen. Clients connect to the SSE endpoint (default http://localhost:8000/sse) and invoke tools like connect, pg_query, and pg_explain using a secure connection ID.
Key features of PostgreSQL Model Context Protocol (PG-MCP) Server
- Multi-database support with simultaneous connections.
- Rich catalog information from table/column descriptions.
- Query execution plan analysis via
pg_explaintool. - Built-in extension context for PostGIS and pgvector.
- Read-only mode enforced via transaction settings.
- Connection pooling and secure opaque connection IDs.
Use cases of PostgreSQL Model Context Protocol (PG-MCP) Server
- AI agents exploring database schema and sample data.
- Natural language to SQL conversion using Claude CLI.
- Automated database introspection for documentation or analysis.
- Query performance analysis with execution plan tool.
Frequently asked questions
1 What are the runtime requirements?
Python 3.13+ and a PostgreSQL database. The server can be run via Docker or manually.
2 How do I connect a database?
Use the connect tool with a PostgreSQL connection string to obtain an opaque connection ID for subsequent queries.
3 Is the server read-only?
Yes, the server runs in read-only mode enforced via transaction settings.
4 What PostgreSQL extensions are supported?
Built-in context for PostGIS and pgvector is provided, and additional extensions can be added via YAML files.
5 How is security handled?
Connection details are never exposed in resource URLs; only opaque connection IDs are used. Credentials are sent only once during the initial connection.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In