{
  "name": "Chat with YouTube (AI agent + MCP)",
  "nodes": [
    {
      "parameters": {
        "content": "## Chat with YouTube\nAn AI agent you can ask about any video or channel. It uses the hosted YouTube MCP server, so it picks the right tool itself.\n\n**YouTubeTranscriptAPI key (once):** Credentials → New → Header Auth. Name: `Authorization`. Value: `Bearer tk_live_…` (your key from youtubetranscriptapi.com/dashboard/keys). Call it *YouTubeTranscriptAPI key* and pick it in every YouTube node. Pick it in *YouTube MCP* (Authentication: Header Auth).\n\n**Also:** add your OpenAI key. Needs n8n 1.104 or later. Open the chat from the *Chat* button.\n\n**Cost:** 1 credit per transcript, 4 per search; checking a channel's new videos is free.",
        "width": 440,
        "height": 400,
        "color": 5
      },
      "id": "7bf7c06d-e91a-4839-806f-e8afff5e377a",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        -60
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "e91e8b89-3ca9-40be-8f1d-48eaf3e9b415",
      "name": "Chat",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        0,
        0
      ],
      "webhookId": "7c3c7871-b0f5-455c-84c9-7f896d173e8c"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You answer questions about YouTube videos and channels with the YouTube tools. Read a video's transcript before answering questions about what it says, and keep reading parts until the end of long videos. Quote with [m:ss] timestamps when asked. If a video has no captions, say so."
        }
      },
      "id": "09ffa43b-77a2-476d-8485-f03f4854aded",
      "name": "YouTube agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        260,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "id": "3f154934-da86-452a-8be7-57276f134f48",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        180,
        240
      ]
    },
    {
      "parameters": {},
      "id": "b9733dc8-001f-4314-8569-59bc2ec245b3",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        340,
        240
      ]
    },
    {
      "parameters": {
        "endpointUrl": "https://youtubetranscriptapi.com/mcp",
        "authentication": "headerAuth",
        "include": "all",
        "options": {}
      },
      "id": "559e7a5a-12aa-41be-8491-76ae7f94a89b",
      "name": "YouTube MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.2,
      "position": [
        500,
        240
      ]
    }
  ],
  "connections": {
    "Chat": {
      "main": [
        [
          {
            "node": "YouTube agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "YouTube agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "YouTube agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "YouTube MCP": {
      "ai_tool": [
        [
          {
            "node": "YouTube agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}