匠人学院 JR Academy
  • Position

    Where am I now, and where should I go?

    How your job is changing, where your experience can take you and what you still need for a target role, worked out from what you have actually done. Free, and the full result needs no sign-up.

    Analyse my career and skills

    Look up a career

    Will AI replace my job?AI impact and transition paths for common careersNew jobs in the AI eraWhat they do, what they need, how to move in

    Focused tools

    AI Engineer interview readiness30 timed questions on what you still need before interviewsCareer personality testDirections that suit how you workReturning to China checkJob prospects in China by school, major and graduation date

    AI coach

    Talk to your AI coachStill unsure after your result? Talk through what is holding you back
  • Core courses

    AI Engineer BootcampEngineering bootcamp from LLM apps to agentsAI Engineer Full-Stack Project Class16 weeks · RAG and full-stack AI projectsVibe Coding Masterclass8 weeks · direct agents to build and ship a productAI Essentials10 hours · use AI for email, reports, data and copyAI Office Automation Course8 weeks · help a whole company adopt AIOne-Person Company (OPC) Bootcamp15 weeks in person · build a one-person company with AIAll courses →

    AI engineering

    Machine Learning & Data Engineering Full-Stack ClassAI Agent & MCP Project BootcampAI Engineer Core TechniquesAI Engineer FoundationsAI Engineer Advanced: RAG to Agents and TuningClaude Code TasterAll AI engineering courses →

    AI at work

    AI Coding for everyoneClaude Code One-Day Masterclass (Non-Technical)Enterprise AI Automation BootcampAI Marketing BootcampAI Risk, Governance and Audit CourseOpenClaw 4-Week Personal AI Assistant BootcampAll AI-at-work courses →

    Career development

    AI Product Manager (BA) Bootcamp + InternshipAustralia IT Interview BootcampAustralia IT Technical Interview BootcampAustralia IT Resume BootcampAustralia Big Tech Job Search BootcampAustralia IT Career Planning BootcampAll career courses →

    Learn free first

    Vibe CodingAI for office workPrompt MasterAI EngineerAI data analysisResource centerInstructorsAll learning paths →
  • Evidence

    What will convince an employer?

    Certifications, projects, team work and competition entries, collected into one portfolio.

    See the portfolio

    Certifications

    Cert Master · all certificationsPrep and mock exams for AWS, Azure, GCP, Claude and moreAWS CLF-C02Entry-level AWS cloud certificationAWS SAA-C03Entry certification for cloud architectsClaude certificationsAnthropic Claude certification seriesAll certifications →

    Projects and team work

    P3 team projectsBuild a project with real teammates in a simulated team workflowP3 project experienceThe parts of a P3 project that go on your resumeDemo DayProject showcaseP3 certificatesProof once a project is completeAll of P3 →

    Competitions and work

    HackathonsBuild something against the clockSubmit your workAdd your project to the showcaseCareerOS portfolioDo tasks in the desktop app; your results become portfolio pieces
    Cert MasterBrowser extension, app and mini programScreenshot a question for analysis and practise anywhereAbout Cert Master
  • Connect

    How do I get myself in front of employers?

    Resume, interviews, referrals and mentors. See how far you are from the target role first, then decide what to fix.

    Start with Jobpin

    Resume and openings

    Graduate careersGraduate preparation across Australia, China, Malaysia, Singapore, the US and UKJobpinAI job search workspace: resume, roles, applicationsAI resumeRewrite your resume against a job descriptionReferralsRoles shared by students and mentorsOpportunitiesInternships, projects and collaborationsOffer boardOffers students have received

    Interviews

    AI Engineer interview guideSeven areas, with worked examplesFDE interview guideFive rounds, from scoping to the customer roundAI mock interviewPractise by text or voice and see the gapsInterview storiesReal interview experiencesSystem Design handbookPrepare for system design interviewsAll interview prep →

    Mentors

    1:1 mentorsBook AI, career and technical mentors by the hourGroup tutoringShare a tutor with a few others and pay less eachCareer coachingResume, interview and direction packages
    Jobpin desktopOne workspace for the whole job searchOrganise real experience and refine resume versions for target roles on macOS or Windows.About Jobpin
BusinessMembershipDownload CareerOS
0
匠人学院 JR Academy

Follow Us

linkedinfacebooktwitterinstagramyoutube

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png
Airbotix · AI learning & creation for kids Another Life · AI story game
Products46

CareerOS and tools

  • CareerOS
  • Cert Master
  • Jobpin
  • Jobpin web
  • Jobpin report
  • Jobpin desktop download
  • My job search reports
  • Buy report credits
  • Jobpin billing
  • AI Toolbox
  • AI Skill Marketplace

Membership

  • Membership
  • AI membership

Courses

  • Bootcamps
  • Training Camp
  • Kanban learning
  • AI Builder course
  • MCP course
  • NotebookLM workshop
  • Business Analyst course
  • Web Full-Stack Bootcamp
  • DevOps Bootcamp
  • Data Engineering Bootcamp
  • Data Analysis Bootcamp
  • Coding for Beginners
  • Algorithm Bootcamp

Career services

  • Graduate careers
  • Graduate careers in Australia
  • Graduate careers in China
  • Graduate careers in Malaysia
  • Graduate careers in Singapore
  • Graduate careers in the US
  • Graduate careers in the UK
  • 1:1 coaching
  • Career coaching
  • AI Engineer VIP
  • BA & PM Internship
  • Data Science Internship
  • Data Analysis Internship
  • Marketing Internship
  • Resume Review
  • Interview Coaching
  • Job Application Service
  • Job Monitoring
  • LinkedIn Management
  • LinkedIn Networking
Library57

Learning paths

  • All Learning Paths
  • AI Engineer
  • Context Engineering
  • Vibe Coding
  • Prompt Master
  • AI Builder
  • AI Product Manager
  • Python Basics
  • AI Productivity
  • AI Data Analysis
  • AI Finance
  • AI Content Creation
  • AI Image Creation
  • Frontend Development
  • Hermes Agent
  • OpenClaw Local Agent

Interactive labs

  • Prompt Lab
  • Frontend Lab
  • JavaScript Lab
  • Python Lab
  • AWS Lab
  • Azure Lab
  • LLM Lab
  • Git Lab

Reference and guides

  • Resources
  • Wiki
  • Cheat sheets
  • Roadmaps
  • AI roadmaps
  • Videos
  • Ebooks
  • Blog
  • Interview handbook
  • Mock exams
  • Free resources

Cities

  • Sydney
  • Melbourne
  • Brisbane
  • Adelaide
  • Singapore
  • Kuala Lumpur
  • London
  • New York
  • San Francisco
  • Los Angeles
  • Seattle
  • Toronto
  • Vancouver

Immigration

  • Australia Immigration
  • Skilled Visa 189/190/491
  • Employer Sponsored 482/186/494
  • Business Visa 188/888
  • UK Immigration
  • US Immigration
  • Canada Immigration
  • Singapore immigration
  • Malaysia immigration
Business20

For business

  • AI for Business
  • Business portal sign-in
  • Corporate Training
  • Internship Partnership
  • Recruitment Partnership
  • Enterprise (EN)

Metatree AI Lab

  • Metatree AI Lab (Chinese)
  • AI solutions (Chinese)
  • Digital employees (Chinese)
  • Case studies (Chinese)
  • Metatree AI Lab
  • AI services
  • Digital employees
  • Case studies

AI education for kids

  • Airbotix — AI Learning & Creation for Kids
  • AU Family Resource Hub
  • NAPLAN Report Guide
  • My School Data Guide
  • Sydney Private School Fees 2026
  • Kids Coding Programs
About15

Company

  • About Us
  • Our Mentors
  • Become a Mentor
  • Metaverse Classroom
  • JR Careers
  • Another Life — AI Story Game
  • Contact Us

Help and policies

  • FAQs
  • Terms & Conditions
  • Privacy Policy
  • Cancellation & Refund Policy
  • Site map

Friend links

  • CS Browser

Contact

  • hello@jiangren.com.au
  • 0421-672-555

Offices

Level 10b, 144 Edward Street, Brisbane CBD (Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
45A13, Block B, Oriental Hope Tianxiang Plaza, 500 Tianfu Avenue Middle Section, Wuhou District, Chengdu, Sichuan, China
Business Hub, 155 Waymouth St, Adelaide SA 5000
Disclaimer
footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

All content on the JR Academy website, including course materials, logos, and information provided, is protected under Australian intellectual property laws. Unauthorized use, sale, distribution, reproduction, or modification is strictly prohibited. Violations may result in legal action. By accessing our website, you agree to respect our intellectual property. JR Academy Pty Ltd reserves all rights, including patents, trademarks, and copyrights. Any infringement will be subject to legal prosecution. View Terms of Service

© 2017-2026 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572

HomeLearnCoursesCerts
  1. Home
  2. Learn
  3. Blog
  4. n8n 自动化工作流实战指南 — n8n MCP 实战:让 Claude / Cursor 直接调用你的工作流
JR Academy · BlogCareer insights

n8n 自动化工作流实战指南 — n8n MCP 实战:让 Claude / Cursor 直接调用你的工作流

n8n 双向 MCP 集成:把工作流暴露成 MCP 工具给 AI 调用,同时在工作流内用 MCP Client 接入外部 AI 服务——完整配置 + 生产踩坑

Published2026-11-30
Reading time2 min
Author

Contents

  • 方向一:把 n8n 工作流变成 Claude 的工具
  • 核心概念
  • Step 1:在 n8n 里建 MCP Server 工作流
  • Step 2:给工作流挂工具
  • Step 3:在 Claude Desktop 里连接
  • Step 4:在 Claude Code 里连接
  • 方向二:在 n8n 工作流内调外部 MCP 服务器
  • 配置 MCP Client Tool 节点
  • 生产部署注意:Nginx 的 SSE 缓冲问题
  • 一个完整的实战例子
  • 两个方向的对比

n8n 在 MCP(Model Context Protocol)上同时支持两个方向:

  • MCP 服务端:用 MCP Server Trigger 节点把你的 n8n 工作流暴露成工具,让 Claude Desktop、Claude Code、Cursor 直接调用
  • MCP 客户端:在 AI Agent 里挂 MCP Client Tool 节点,连接外部 MCP 服务器(GitHub、Slack、数据库等)获取更多工具能力

这两个方向可以同时启用——你的 n8n 变成了一个 AI 工具集线器。


方向一:把 n8n 工作流变成 Claude 的工具

核心概念

MCP Server Trigger 是 n8n 的特殊触发节点,它不等 HTTP 请求或定时器,而是暴露一个持久连接端点(SSE 或 Streamable HTTP),让 MCP 客户端连进来,列出可用工具并主动调用。

每个挂在 MCP Server Trigger 后面的节点就是一个"工具"——Claude 能看到工具名、描述、参数,然后自主决定什么时候调用。

Step 1:在 n8n 里建 MCP Server 工作流

基本结构:

MCP Server Trigger
    ├── [Tool 1] Custom n8n Workflow Tool(调用另一个工作流)
    ├── [Tool 2] HTTP Request Tool(直接调外部 API)
    └── [Tool 3] Code Tool(自定义逻辑)

新建工作流,搜索节点 "MCP Server Trigger"(在 Core Nodes → Trigger 下):

节点配置:
  Authentication: Bearer Token
  (系统自动生成 token,记下来)

激活工作流后,节点面板会显示两个 URL:

  • Test URL:工作流未激活时也可用,开发调试用
  • Production URL:格式 https://你的域名/mcp/工作流ID,必须激活工作流才生效

Cloud 用户的 Production URL 格式:https://<子域名>.app.n8n.cloud/mcp/<uuid>

Step 2:给工作流挂工具

以"查询课程信息"为例:

方案 A — Custom n8n Workflow Tool(推荐,可复用已有工作流):

Tool Name: get_course_info
Description: 查询 JR Academy 课程详情、开课时间和价格。
             当用户问课程相关问题时调用。
             参数:course_name(课程名称,如 Full Stack / Data Analytics)
Workflow: 选择已有的「课程查询 workflow」

方案 B — Code Tool(快速原型):

// Tool Name: list_available_courses
// Description: 列出所有可用课程名称和简介
const courses = [
  { name: "Full Stack", duration: "6个月", mode: "兼职" },
  { name: "Data Analytics", duration: "4个月", mode: "兼职" },
  { name: "AI Engineering", duration: "5个月", mode: "兼职" }
];
return courses;

关键:工具描述写好了,Claude 才会用对工具。描述要说清楚"什么情况下调用"和"参数含义",不然 AI 要么不调、要么传错参数。

Step 3:在 Claude Desktop 里连接

编辑 Claude Desktop 配置文件(Mac:~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "n8n-workflows": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--sse",
        "https://你的n8n域名/mcp/你的工作流ID",
        "--header",
        "Authorization: Bearer 你的bearer-token"
      ]
    }
  }
}

supergateway 是一个轻量代理,把 n8n 的 SSE 流转成 Claude Desktop 期望的 stdio 接口。

重启 Claude Desktop,在对话里输入"你有哪些工具?"——Claude 会列出所有从 n8n 暴露的工具。

Step 4:在 Claude Code 里连接

Claude Code 使用项目级 .claude/settings.json 或全局 ~/.claude/settings.json:

{
  "mcpServers": {
    "n8n": {
      "type": "sse",
      "url": "https://你的n8n域名/mcp/你的工作流ID",
      "headers": {
        "Authorization": "Bearer 你的bearer-token"
      }
    }
  }
}

配置好后,在 Claude Code 会话里可以直接调用 n8n 工作流——比如让 Claude Code 把代码部署结果推送到 Slack、或查询线上数据库做调试分析,全部通过自然语言触发。


方向二:在 n8n 工作流内调外部 MCP 服务器

除了对外暴露工具,n8n AI Agent 自身也能作为 MCP 客户端,调用外部 MCP 服务器的工具。

配置 MCP Client Tool 节点

在 AI Agent 的 Tool 插槽点击 +,选 "MCP Client Tool":

Transport: SSE(或 Streamable HTTP)
URL: https://mcp服务器地址/sse
Headers: Authorization: Bearer <token>(如果需要认证)

连好后,AI Agent 会自动发现该 MCP 服务器提供的所有工具,无需手动配置每个工具——工具列表由 MCP 服务器动态返回。

实际场景:让 n8n AI Agent 访问 GitHub MCP、Slack MCP、Notion MCP,实现跨平台的 AI 自动化,而不需要在 n8n 里配置每个平台的 Credential。


生产部署注意:Nginx 的 SSE 缓冲问题

MCP 协议基于 SSE(Server-Sent Events),SSE 是长连接,数据边产生边推送。Nginx 默认会把响应体缓冲到内存再一起发,这会导致 Claude 收不到流式数据,连接卡死。

必须在 Nginx 里对 /mcp/ 路径关闭缓冲:

location /mcp/ {
    proxy_pass http://127.0.0.1:5678;
    proxy_http_version 1.1;
    proxy_set_header Connection "";     # Keep-Alive,不升级到 WebSocket
    
    # 关键:关闭缓冲
    proxy_buffering off;
    proxy_cache off;
    
    # 关闭 gzip 压缩(压缩也会缓冲)
    gzip off;
    
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_read_timeout 3600s;           # SSE 长连接,超时设长
}

Cloudflare Tunnel 用户:在 Cloudflare 后台对 /mcp/* 路径开启 Disable Response Buffering 规则。


一个完整的实战例子

假设你是运营,想让 Claude 直接帮你管理内容发布:

n8n MCP Server 暴露 3 个工具:

Tool 1: check_pending_content
  描述:列出所有草稿状态的内容,包含标题、作者、创建时间
  实现:HTTP Request → 内容管理 API

Tool 2: publish_content
  描述:把指定内容从草稿发布到线上。需要 content_id 参数。
  实现:HTTP Request Tool(启用 Human Approval——发布前让人确认)

Tool 3: get_publish_stats
  描述:获取最近7天的发布数量、阅读量、互动数据
  实现:Code Tool(从数据库查询并格式化)

配好后,在 Claude Desktop 里说:

"帮我看看有哪些内容等待发布,把阅读量预期最高的两篇发出去。"

Claude 会先调 check_pending_content 看列表,分析后调 publish_content(触发人工审批),等你确认后执行,最后用 get_publish_stats 确认发布成功。

整个过程不需要打开 n8n 界面,也不需要登录内容管理后台。


两个方向的对比

n8n 作 MCP 服务端 n8n 作 MCP 客户端
目的 让 Claude / Cursor 调用 n8n 工作流 让 n8n Agent 使用外部 MCP 工具
关键节点 MCP Server Trigger MCP Client Tool
适合场景 运营工具化、AI 操控业务流程 Agent 需要跨平台工具集成
认证方式 Bearer Token(n8n 生成) 按各 MCP 服务器要求
Author
Share or copy the link

Related certifications

Start with a few sample questions or a free chapter. The exam guide covers what the exam tests; the question bank lets you practise by exam domain.

Foundational

Claude Certified Architect – Foundations

CCAR-F

Sample questionsExam guide
Foundational

Claude Certified Developer – Foundations

CCDV-F

Question bankExam guide
Associate

Claude Certified Associate – Foundations

CCAO-F

Question bankExam guide

Related learning resources

  • AI Engineer learning path
← Previous articlen8n 自动化工作流实战指南 — n8n AI Agent 深度实战:Claude + 记忆 + 工具 + RAG 知识库Next article →n8n 自动化工作流实战指南 — n8n 错误处理与生产监控:工作流永不静默失败

Related articles

🇦🇺测一下:袋鼠国码农能当FDE吗?

2026-12-01

Monash 研究:肠道酸度是膳食纤维降血压的关键;AI 搬运新闻冲击维州选举信息;MPAC 公布 2027 演出季

2026-12-01

Adelaide 物理学家获 $250,000 总理科学奖;全球葡萄酒消费六十年降四分之一;残障师范生实习障碍研究

2026-12-01

DVA-C03今日上线首发 · Google Cloud AI Agent认证完整解析 · AZ-401本月GA替代AZ-400

2026-12-01

Anthropic推迟下一代模型并调百人做安全,AWS推出AI办公三件套,Google让用户单独关掉AI训练

2026-12-01

GitHub Copilot 实战指南 — Copilot AI Code Review:30 秒让 AI 帮你审 PR,三档深度随需切换

2026-11-30
View all articles →

Done reading? Next steps

Not sure what to learn next? Tell us where you are

Tell us what you do now and where you want to go. See your gaps in skills, evidence, experience, expression and positioning, and what to work on first. No sign-in needed.

Compare with my situation
  • SkillAI Engineer Bootcamp13 weeks, 12 Theory + 13 Practice live classes. You build one Agent system across Context, RAG, Tools, Memory and production Evals. Built for Applied AI and Agent Engineer roles.See the program →
  • PositioningLearning roadmaps by roleFrontend, backend, data, AI and more, laid out stage by stage in the order to learn them.All roadmaps →
  • ExpressionTry an AI mock interviewPick a role and run a mock interview to practise explaining your experience and projects.Practise now →

Not sure what to do next?

Take this page's topic with you and see where your gaps are.

Compare with my situation
JR Academy
AI learning for the global Chinese community
BootcampsFree resourcesLearn AICareer coaching
精选推荐
AI Career Impact Map
Assess career exposure and explore transition paths and learning options
Popular tool
AI & Data Bootcamps
Build your skills through structured courses and hands-on projects
Popular courses
1:1 Career Coaching
Work with an experienced mentor on your resume and interview preparation
Career coaching
Custom Corporate Training
AI training tailored to your team
Business services
Popular tags
Vibe CodingAI codingCursorClaudeJob searchPromptFrontend developmentBackend development
Subscribe to updates

Receive AI learning resources, technical tutorials and career advice by email.

We respect your privacy and do not send spam.