Keyflow

Search Keyflow

Find a shortcut, workflow, MCP server or skill

Build your own PostgreSQL MCP server

n8n template #3631
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 -https://github.com/modelcontextprotocol/servers/tree/main/src/postgres How it works A MCP server trigger is used and connected to 5 tools: 2 postgreSQL and 3 custom workflow. The 2 postgreSQL tools are simple read-only queries and as such, the postgreSQL tool can be simply used. The 3 custom workflow tools are used for select, insert and update queries as these are operations which require a bit more discretion. Whilst it may be easier to allow the age

How to set it up

  1. Open template #3631 on n8n.io and click Use for free, or copy the template JSON and paste it onto an empty canvas in n8n.
  2. Create a credential under Credentials → Add credential: Postgres. Then open each of those nodes and pick the credential.
  3. Click Execute workflow and step through each node's output to confirm the data looks right.
  4. Toggle the workflow to Active so its trigger runs on its own.

Hand off to your agent

Prompt

Help me set up the n8n workflow "Build your own PostgreSQL MCP server" (https://n8n.io/workflows/3631). It uses: Postgres, Call n8n Workflow Tool. Import the template JSON into my n8n instance, list every credential I need to create, and walk me through testing it.

Paste into Claude Code and it will do the rest.

Apps and nodes

Questions

Yes. Jimleuk published it free on n8n.io as a verified creator, and it has 5,672 views. It runs on n8n Cloud or a self-hosted n8n instance.

Postgres. The other 1 node are built into n8n.

Similar workflows

NameViews
  1. Query Google Sheets/CSV data through an AI Agent using PostgreSQL8,069
  2. AI agent that can scrape webpages212K
  3. Build Your First AI Data Analyst Chatbot134K
  4. Create a Branded AI-Powered Website Chatbot88K
  5. Generate Instagram Content from Top Trends with AI Image Generation72K
  6. AI web researcher for sales69K
  7. Autonomous AI crawler61K
  8. Telegram AI bot with LangChain nodes59K