Skip to content

n8n-mcp fails to connect when using custom CA certificates #440

@rmiranda87

Description

@rmiranda87

Problem:
The n8n-mcp package cannot connect to n8n instances that use custom Certificate Authority (CA) certificates, even when NODE_TLS_REJECT_UNAUTHORIZED=0 is set in the environment configuration.

Environment:

  • OS: macOS
  • n8n instance: Self-hosted with custom CA certificate
  • MCP setup: Claude Code VS Code extension with n8n-mcp server

Error:

  • Health check fails with "No response from n8n server"
  • Direct Node.js testing reveals SELF_SIGNED_CERT_IN_CHAIN error
  • curl works fine (uses system certificate store)

Root Cause:
Node.js doesn't trust custom CA certificates by default, unlike curl which uses the system certificate store (/etc/ssl/cert.pem on macOS).

Working Solution:
Add NODE_EXTRA_CA_CERTS environment variable pointing to the custom CA certificate:
{
"env": {
"N8N_API_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key",
"NODE_TLS_REJECT_UNAUTHORIZED": "0",
"NODE_EXTRA_CA_CERTS": "/path/to/custom-ca.pem"
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions