{
  "name": "Documentation Lookup AI Agent using Context7 and Gemini",
  "nodes": [
    {
      "id": "a42ae423-a348-460e-888c-f3df2b82021d",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        440,
        380
      ]
    },
    {
      "id": "22f3e783-4310-4d15-a875-cbb400a82c1b",
      "name": "context7-resolve-library-id",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1280,
        480
      ]
    },
    {
      "id": "526eab1c-7a08-45eb-8169-7e8d4578c117",
      "name": "context7-get-library-docs",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1840,
        480
      ]
    },
    {
      "id": "5cafb0d4-19ac-4589-88d8-34b88404e0f1",
      "name": "Context7 MCP Server Trigger",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        120,
        -860
      ]
    },
    {
      "id": "945d8818-c346-44ba-b4c1-56d166a4f381",
      "name": "Context7 AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        880,
        -20
      ]
    },
    {
      "id": "1b0cd3cc-8566-4cb5-932c-005149a2467b",
      "name": "Context7 Workflow Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        100,
        -20
      ]
    },
    {
      "id": "e955aa60-2b80-45d5-885b-24b7fe56a426",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        700,
        520
      ]
    },
    {
      "id": "4927c593-5762-4a26-87eb-8a7e0a4b3d32",
      "name": "call_context7_ai_agent",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        280,
        -460
      ]
    },
    {
      "id": "d72a2661-5622-4bfa-9d42-8c96b5fef877",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        -40
      ],
      "parameters": {
        "width": 680,
        "height": 320,
        "content": "## MCP JSON for Roo Code etc\n\nTo use this in Roo Code, Cline etc use\n\n\"n8n-context7\": {\n      \"url\": \"https://n8n.coolify.au/mcp/dafd56e8-ea19-43b7-b337-a5881c3bc541/sse\",\n      \"alwaysAllow\": [\n     "
      }
    },
    {
      "id": "c0dc815b-3d0f-49e2-8da0-08d2f45d0991",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        -1140
      ],
      "parameters": {
        "width": 580,
        "height": 420,
        "content": "This node is the public entry point for the Context7 AI Agent service.\nIt exposes an MCP (Multi-Agent Collaboration Protocol) SSE (Server-Sent Events) endpoint.\n\n- Path: The long, random path (e.g., /"
      }
    },
    {
      "id": "adc54a99-b04d-40be-a9a4-25f837453c14",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        -680
      ],
      "parameters": {
        "width": 580,
        "height": 340,
        "content": "This node represents the tool that external clients call via the MCP Server Trigger.\nWhen triggered, it executes the separate \"Context7 Smithery AI Agent MCP Server\" sub-workflow (ID: vqujIu65SFbZUz0n"
      }
    },
    {
      "id": "5cc037d1-4155-49dc-86f5-7af9976149bf",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        -660
      ],
      "parameters": {
        "width": 680,
        "height": 600,
        "content": "## Main MCP Server Workflow Overview\n\nThis workflow acts as the public gateway for the Context7 AI Documentation Agent.\n\n1.  **`Context7 MCP Server Trigger`**:\n    *   Receives requests from external "
      }
    },
    {
      "id": "79bf63c1-b325-4a3c-950e-30df5aef15e4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -200
      ],
      "parameters": {
        "width": 360,
        "height": 200,
        "content": "This is the entry point for the AI Agent sub-workflow.\n- Receives:\n    - 'query': The user's natural language question from the main workflow.\n- Passes data to: The IF node (for API key check, if impl"
      }
    },
    {
      "id": "2486cacc-b06a-4e30-b363-456930cf0ea5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -280
      ],
      "parameters": {
        "width": 560,
        "height": 440,
        "content": "The core AI logic unit.\n- Model: Uses Google Gemini.\n- System Prompt: Instructs the AI on how to use the Context7 tools.\n- Tools: Has access to 'context7-resolve-library-id' and 'context7-get-library-"
      }
    },
    {
      "id": "f5f12aa6-d90a-419c-9baa-2c7c451a71d1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        640
      ],
      "parameters": {
        "width": 360,
        "height": 200,
        "content": "Provides conversational memory for the AI Agent.\n- Type: Window Buffer Memory (keeps a sliding window of recent messages).\n- Session Key: Uses `{{ $execution.id }}`. This ensures that memory is unique"
      }
    },
    {
      "id": "d2598e8e-3931-436f-a480-b4bef659bccb",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        640
      ],
      "parameters": {
        "width": 480,
        "height": 500,
        "content": "This node allows the AI Agent to use the external 'resolve-library-id' Context7 MCP tool.\n\n- Connection: Uses the 'smithery_context7' credential to communicate with the Context7 MCP service.\n- Action:"
      }
    },
    {
      "id": "7bebd852-75e5-427e-a3ee-781cd85f20e6",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        640
      ],
      "parameters": {
        "width": 520,
        "height": 500,
        "content": "This node allows the AI Agent to use the external 'get-library-docs' Context7 MCP tool.\n\n- Connection: Uses the 'smithery_context7' credential to communicate with the Context7 MCP service.\n- Action: W"
      }
    },
    {
      "id": "f4749f9a-6f9e-45c5-b6a9-a89d4dc77dec",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -1380
      ],
      "parameters": {
        "width": 1140,
        "height": 1040,
        "content": "## n8n AI Agent as an MCP Service (Context7 Docs Example)\n\n**What This Workflow Does:**\nThis n8n setup transforms a complex AI agent into a single, callable tool exposed over an MCP (Multi-Agent Colla"
      }
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Context7 AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "call_context7_ai_agent": {
      "ai_tool": [
        [
          {
            "node": "Context7 MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Context7 Workflow Start": {
      "main": [
        [
          {
            "node": "Context7 AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Context7 AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "context7-get-library-docs": {
      "ai_tool": [
        [
          {
            "node": "Context7 AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "context7-resolve-library-id": {
      "ai_tool": [
        [
          {
            "node": "Context7 AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}