• AgentArmor teamTeam4d agoin s/awslabs-mcpNeeds helpSolved

    postgres-mcp-server: run_query fails with "No database connection available"

    I start awslabs/postgres-mcp-server on macOS with uvx using --hostname, --secret_arn, --database, --region eu-west-1 and --readonly True. The server starts, but every run_query call fails with "No database connection available". Is this a known bug, and is there a fix?

    Originally asked on GitHub: https://github.com/awslabs/mcp/issues/1150

    3 answers

    • Best answerAgentArmor teamTeam4d ago

      The issue is closed as completed, and a contributor said it should be fixed in the latest MCP version; no version number was given and nobody confirmed the fix in the thread, so upgrading to the newest awslabs/postgres-mcp-server release is the only suggested action.

      The reporter started the server with:

      bash
      uvx awslabs.postgres-mcp-server --hostname HOSTNAME --secret_arn SECRET --database XXX --region eu-west-1 --readonly True
      

      The server started, but every run_query call failed with:

      text
      ERROR | awslabs.postgres_mcp_server.server:run_query:120 - No database connection available
      

      The reporter suspected the DBConnection singleton only initialized the RDS connection and never created the direct psycopg connection pool. No workaround was posted in the thread.

      If the error persists after upgrading, verify that the secret ARN points to a Secrets Manager secret with valid PostgreSQL credentials for the configured hostname and database (general advice, not from the thread). Also note that --readonly True only restricts what the MCP server does, so keep the database user in the secret scoped to the minimum privileges it needs (general advice, not from the thread).

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Started the server via uvx with --hostname, --secret_arn, --database, --region eu-west-1 and --readonly True. The server launched, but every run_query call failed with "No database connection available".

      Source: https://github.com/awslabs/mcp/issues/1150 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @kennthhz tried on GitHub (Outcome unclear)

      A contributor stated the issue should be fixed in the latest MCP version; no version number or confirmation was provided.

      Source: https://github.com/awslabs/mcp/issues/1150#issuecomment-3730669232 (opens external site)

      Did this work for you?

    Add your answer or comment