Registry / aws / awslabs-postgres-mcp-server

awslabs-postgres-mcp-server

JSON →
library1.1.6pypypiunverified

An AWS Labs Model Context Protocol (MCP) server for PostgreSQL. It provides a lightweight MCP interface to interact with PostgreSQL databases, enabling AI agents to query schemas, execute read-only queries, and retrieve metadata. Current version is 1.1.1 with a fast release cadence. Requires Python >=3.10.

pip install awslabs-postgres-mcp-server
INSTALL
IMPORT
SIG · AWSLABS-POSTGRES-M
A
awslabs-postgres-mcp-server
awspythonv1.1.6
Install
10.4s avg
Import
Disk
124MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 12.7s
py 3.11
✓ —
✓ 11s
py 3.12
✓ —
✓ 9.1s
py 3.13
✓ —
✓ 8.9s
py 3.9
✕ build_error
✕ build_error
124MB installed
● package 124MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PostgresMCPServer
from awslabs.postgres_mcp_server import PostgresMCPServer
from awslabs_postgres_mcp_server import PostgresMCPServer

Creates a read-only MCP server that exposes PostgreSQL schema and query capabilities.

import os from awslabs_postgres_mcp_server import PostgresMCPServer # Connection parameters (use env vars for security) database_url = os.environ.get('DATABASE_URL', 'postgresql://user:pass@localhost:5432/mydb') # Initialize and run the MCP server server = PostgresMCPServer(database_url=database_url, read_only=True) server.run()
postgres-mcp-server --version
Debug
Known issues
gotchaThe package name on PyPI uses hyphens (awslabs-postgres-mcp-server), but the Python module uses underscores (awslabs_postgres_mcp_server). Many users incorrectly import using hyphens.
fix
Use `import awslabs_postgres_mcp_server` (underscores).
affects: all
breakingVersion 1.0.0 introduced a breaking change: the `run()` method no longer accepts a `port` argument; use the constructor parameter instead.
fix
Update instantiation: `server = PostgresMCPServer(database_url=..., port=8080)`.
affects: >=1.0.0
deprecatedThe parameter `allow_write` is deprecated as of v1.1.0; use `read_only` instead (inverted logic).
fix
Use `read_only=True` instead of `allow_write=False`.
affects: >=1.1.0
Upgrade
Version history
1.1.6latest on PyPI · released Jun 3, 2026
Audit
Dependencies
mcprequiredCore MCP protocol library
psycopg2-binaryrequiredPostgreSQL adapter
Agent activity
46 hits · last 30 days
node
38
OpenAI (training)
2
Bingbot
1
Resources
awslabs-postgres-mcp-server — pip install awslabs-postgres-mcp-server · libregistry