PostgreSQL MCP Server
Integrates with Amazon Q to allow users to query and explore PostgreSQL databases directly through the chat interface.
Enables the loading and use of the PostgreSQL MCP server within the IntelliJ IDEA development environment via Amazon Q.
Provides tools for executing SELECT queries, listing tables, and describing schema structures in PostgreSQL databases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostgreSQL MCP ServerDescribe the structure of the ports table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PostgreSQL MCP Server
MCP-compliant server for PostgreSQL database integration with Amazon Q.
Installation
pip install -r requirements.txtRelated MCP server: MCP PostgreSQL Server
Setup
Test connection:
python server.py --host host.example.com --port 61025 --database example --username example_user --password example_pwd --testConfigure Amazon Q MCP:
Update C:\Users\%USERNAME%\.aws\amazonq\mcp.json:
{
"mcpServers": {
"local-postgres-mcp": {
"command": "C:\\Users\\sk\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
"args": [
"C:\\Workspace\\GitLab\\capacity-planning2\\postgresql-mcp\\server.py",
"--host", "host.example.com",
"--port", "61025",
"--database", "example",
"--username", "example_user",
"--password", "example_pwd"
],
"env": {"PYTHONUNBUFFERED": "1"},
"timeout": 60000
}
}
}Restart IntelliJ IDEA to load the new MCP server
Using with Amazon Q Chat
Once configured, you can use these commands in Amazon Q chat:
Query database:
Query the database: SELECT * FROM "capacity_planning2".ports LIMIT 5List tables:
List all tables in the capacity_planning2 schemaDescribe table structure:
Describe the structure of the ports table in capacity_planning2 schemaBrowse schemas:
Show me all available database schemasAvailable Tools
query_database: Execute SELECT queries with automatic LIMIT
describe_table: Get detailed table column information
list_tables: List tables in specific schema or all schemas
Security
Read-only access (SELECT queries only)
Automatic query limits (100 rows max)
Connection timeout protection
This server cannot be deployed
Maintenance
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases using natural language queries, providing secure read-only access to database schemas and SQL translation capabilities.67 npm-
- AlicenseNot gradedqualityCmaintenanceEnables secure read-only access to PostgreSQL databases, allowing users to list tables, query schemas, execute SELECT statements, and inspect table structures through natural language interactions.529 npm4MIT
- AlicenseAqualityAmaintenanceEnables read-only interaction with PostgreSQL databases through natural language queries, supporting dynamic connections and secure query validation.3128 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables secure, read-only PostgreSQL database interaction through natural language, with automatic database discovery and connection management.2MIT