Skip to content

PostgreSQL MCP client error: self-signed certificate with sslmode on #1803

Closed as not planned

Description

@wfrankoti

Describe the bug
Using postgresql with SSLmode active in DB (alloydb gcp) in n8n self-hosted

To Reproduce
In n8n

  1. Add MCP client - execute tools
  2. Config credentials +
  3. STDIO
  4. Command npx
    5.-y @modelcontextprotocol/server-postgres postgresql://user@password@google-db:5432/mydb?sslmode=require
  5. Save

And use in agentAI, generate:

Failed execute operation: Failed to execute tool ‘query’: MCP error -32603: self-signed certicate

But, if we use postgresql n8n native node with this parameters, it works ok.

Expected behavior
Connect and operate correct in postgresql db with queries with sslmode true (require)

Logs
NA

Additional context
If we use postgresql db without sslmode active, or postgresql db bitnami default (localhost), the MCP client works ok.

Thanks!

Activity

  1. changed the title [-]PostgreSQL MCP client error: self-signed certificate[/-] [+]PostgreSQL MCP client error: self-signed certificate whit sslmode on[/+] on May 16, 2025
  2. changed the title [-]PostgreSQL MCP client error: self-signed certificate whit sslmode on[/-] [+]PostgreSQL MCP client error: self-signed certificate with sslmode on[/+] on May 16, 2025
  3. Connoropolous commented on May 17, 2025

    @Connoropolous

    Hit this today. Got over it.
    In order for it to work, you need to include the "CA Cert" for it... it will be available from the provider, maybe google in your case?
    Download it, put it somewhere in your file system, and then append this to your DB string after sslmode=require

    &sslrootcert=/path/to/your/cert/ca-certificate.crt

    I have a feeling it's not a bug so much as legit security practices

  4. wfrankoti commented on May 21, 2025

    @wfrankoti
    Author

    Thank you @Connoropolous for your answer.

    My point is that using the n8n native PostgreSQL node, you don't need to pass the certificate, and it works correctly. Why is it required (in the connection string) when using the MCP server with PostgreSQL?

  5. olaservo commented on May 29, 2025

    @olaservo
    Member

    Thanks for reporting this. This server has been moved to the archived repository at https://github.com/modelcontextprotocol/servers-archived to reduce maintenance overhead, so we can focus our efforts on a smaller set of core servers.
    Since this server is no longer actively maintained, we recommend checking out the alternatives listed in the Readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions