FlowiseAI/Flowise · error · Error

No postgres url provided

Error message

No postgres url provided

What it means

Thrown by PostgreSQLMCP.getTools when the bound credential has no 'postgresUrl'. The node spawns the @modelcontextprotocol/server-postgres stdio process passing the URL as an argument, so an empty URL would start the server with no database and is rejected up front.

Source

Thrown at packages/components/nodes/tools/MCP/PostgreSQL/PostgreSQLMCP.ts:92

        const _mcpActions = nodeData.inputs?.mcpActions
        let mcpActions = []
        if (_mcpActions) {
            try {
                mcpActions = typeof _mcpActions === 'string' ? JSON.parse(_mcpActions) : _mcpActions
            } catch (error) {
                console.error('Error parsing mcp actions:', error)
            }
        }

        return tools.filter((tool: any) => mcpActions.includes(tool.name))
    }

    async getTools(nodeData: INodeData, options: ICommonObject): Promise<Tool[]> {
        const credentialData = await getCredentialData(nodeData.credential ?? '', options)
        const postgresUrl = getCredentialParam('postgresUrl', credentialData, nodeData)

        if (!postgresUrl) {
            throw new Error('No postgres url provided')
        }

        const packagePath = getNodeModulesPackagePath('@modelcontextprotocol/server-postgres/dist/index.js')

        const serverParams = {
            command: 'node',
            args: [packagePath, postgresUrl]
        }

        const toolkit = new MCPToolkit(serverParams, 'stdio')
        await toolkit.initialize()

        const tools = toolkit.tools ?? []

        return tools as Tool[]
    }
}

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Open the PostgreSQL_MCP node and bind a PostgreSQL credential.
  2. In that credential, set postgresUrl to a full connection string (e.g. postgresql://user:pass@host:5432/db).
  3. Confirm the package @modelcontextprotocol/server-postgres is installed so packagePath resolves.
  4. Save and retry.

Example fix

// before: postgresUrl is empty
// after:  postgresql://user:password@localhost:5432/mydb
Defensive patterns

Strategy: validation

Validate before calling

const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const postgresUrl = getCredentialParam('postgresUrl', credentialData, nodeData)
if (!postgresUrl || !postgresUrl.trim()) {
    throw new Error('No postgres url provided')
}

Type guard

function isPostgresUrl(s: string): boolean {
    return /^postgres(?:ql)?:\/\/.+/i.test(s.trim())
}

Try / catch

try { await pgMcp.getTools(nodeData, options) }
catch (e) { if (e instanceof Error && e.message === 'No postgres url provided') { /* bind postgresUrl credential */ } }

Prevention

When it happens

Trigger: The PostgreSQL_MCP node's credential is missing or its 'postgresUrl' field is empty when getTools/init runs.

Common situations: No credential selected; credential selected but postgresUrl blank; credential was created from a different schema; connection string field renamed/migrated.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/0f835d61a35a6113. Report an issue: GitHub.