Build your own PostgreSQL MCP server
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 11 nodes and runs when an MCP client calls one of its tools (plus 1 other trigger). Along the way it connects Postgres.
How it runs
Trigger: When an MCP client calls one of its tools (plus 1 other trigger).
- Operation (Switch): routes items into 3 branches
- ReadTableRecord (Postgres): run a query
- CreateTableRecord (Postgres): run a query
- UpdateTableRecord (Postgres): run a query
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Postgres Tool
n8n-nodes-base.postgresTool - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Postgres
n8n-nodes-base.postgres - Switch
n8n-nodes-base.switch - MCP Server Trigger
@n8n/n8n-nodes-langchain.mcpTrigger
From the author
This n8n demonstrates how to build a simple PostgreSQL MCP server to manage your PostgreSQL database such as HR, Payroll, Sale, Inventory and More! This MCP example is based off an official MCP reference implementation which can be found here…