{"id":23320,"library":"awslabs-postgres-mcp-server","title":"AWS Labs PostgreSQL MCP Server","description":"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.","status":"active","version":"1.1.1","language":"python","source_language":"en","source_url":"https://github.com/awslabs/postgres-mcp-server","tags":["aws","postgresql","mcp","ai-agent","database"],"install":[{"cmd":"pip install awslabs-postgres-mcp-server","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core MCP protocol library","package":"mcp","optional":false},{"reason":"PostgreSQL adapter","package":"psycopg2-binary","optional":false}],"imports":[{"note":"Package uses underscores, not hyphens, in module name","wrong":"from postgres_mcp_server import PostgresMCPServer","symbol":"PostgresMCPServer","correct":"from awslabs_postgres_mcp_server import PostgresMCPServer"}],"quickstart":{"code":"import os\nfrom awslabs_postgres_mcp_server import PostgresMCPServer\n\n# Connection parameters (use env vars for security)\ndatabase_url = os.environ.get('DATABASE_URL', 'postgresql://user:pass@localhost:5432/mydb')\n\n# Initialize and run the MCP server\nserver = PostgresMCPServer(database_url=database_url, read_only=True)\nserver.run()","lang":"python","description":"Creates a read-only MCP server that exposes PostgreSQL schema and query capabilities."},"warnings":[{"fix":"Use `import awslabs_postgres_mcp_server` (underscores).","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Update instantiation: `server = PostgresMCPServer(database_url=..., port=8080)`.","message":"Version 1.0.0 introduced a breaking change: the `run()` method no longer accepts a `port` argument; use the constructor parameter instead.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use `read_only=True` instead of `allow_write=False`.","message":"The parameter `allow_write` is deprecated as of v1.1.0; use `read_only` instead (inverted logic).","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `import awslabs_postgres_mcp_server` (underscores).","cause":"Attempting to import the package using hyphens, which is invalid in Python.","error":"ModuleNotFoundError: No module named 'awslabs-postgres-mcp-server'"},{"fix":"Instantiate with `PostgresMCPServer(database_url=..., port=8080)` and call `server.run()` without arguments.","cause":"Passing `port` to `__init__` is not supported; the constructor expects `port` as a parameter (check version docs). Actually, error arises from mis-match: in v1.0+ `port` must be passed to `run()`? No, corrected: In pre-1.0, `port` was in `run()`. In 1.0+, `port` is in constructor.","error":"TypeError: 'port' is an invalid keyword argument for PostgresMCPServer.__init__()"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}