Skip to main content
Glama
psreekrishnan

PostgreSQL MCP Server

PostgreSQL MCP Server

MCP-compliant server for PostgreSQL database integration with Amazon Q.

Installation

pip install -r requirements.txt

Related MCP server: Enterprise PostgreSQL MCP Server

Setup

  1. Test connection:

python server.py --host host.example.com --port 61025 --database example --username example_user --password example_pwd --test
  1. Configure 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
    }
  }
}
  1. 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 5

List tables:

List all tables in the capacity_planning2 schema

Describe table structure:

Describe the structure of the ports table in capacity_planning2 schema

Browse schemas:

Show me all available database schemas

Available 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

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to interact with PostgreSQL databases using natural language queries, providing secure read-only access to database schemas and SQL translation capabilities.
    Last updated
    6
    13
  • -
    license
    -
    quality
    -
    maintenance
    Enables secure read-only interactions with PostgreSQL databases through natural language. Provides database inspection, table listing, and SQL query execution with built-in security validation.
    Last updated
  • A
    license
    -
    quality
    A
    maintenance
    Enables 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.
    Last updated
    484
    4
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables read-only interaction with PostgreSQL databases through natural language queries, supporting dynamic connections and secure query validation.
    Last updated
    3
    211
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.

  • Comprehensive PostgreSQL documentation and best practices, including ecosystem tools

  • Run SOQL queries to explore and retrieve Salesforce data. Access accounts, contacts, opportunities…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/psreekrishnan/postgresql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server