{
  "name": "Monta MCP AI Agent Example",
  "nodes": [
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.text }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [416, 0],
      "id": "9401fc67-3d6d-4e90-a766-44bd3298fca3",
      "name": "AI Agent",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "endpointUrl": "https://partner-api-mcp.monta.app/sse",
        "serverTransport": "httpStreamable",
        "authentication": "headerAuth",
        "include": "selected",
        "includeTools": ["get-teams", "get-charge-points", "post-charges", "delete-charge"],
        "options": {
          "timeout": 60000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.1,
      "position": [608, 192],
      "id": "179a3778-1e80-4858-9a70-4e52fc83024d",
      "name": "MCP Client",
      "credentials": {
        "httpHeaderAuth": {
          "name": "Monta API Credentials"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [288, 208],
      "id": "b20bc4f4-2320-4523-9562-85dc81cc1b20",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "OpenAI API Credentials"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [432, 208],
      "id": "f743d2ab-d7a8-4df5-ae97-6770e806a0f4",
      "name": "Simple Memory"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0],
      "id": "3305ecba-f3bf-41b0-85d4-74e68c028f84",
      "name": "When clicking 'Execute workflow'",
      "alwaysOutputData": true
    }
  ],
  "pinData": {
    "When clicking 'Execute workflow'": [
      {
        "json": {
          "sessionId": 1,
          "text": "List all my teams"
        }
      }
    ]
  },
  "connections": {
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": true,
    "description": "This workflow demonstrates how to use the Monta Partner API with n8n's MCP Client Tool and AI Agent.\n\nSetup:\n1. Configure MCP Client credentials:\n   - Authentication: Header Auth\n   - Header Name: X-Monta-Auth\n   - Header Value: YOUR_CLIENT_ID:YOUR_CLIENT_SECRET\n\n2. Configure OpenAI credentials:\n   - Add your OpenAI API key in the OpenAI Chat Model node\n\n3. Select which Monta API tools to include:\n   - By default includes: get-teams, get-charge-points, post-charges, delete-charge\n   - You can change to 'all' to include all 185+ available tools\n\n4. Update the input text:\n   - Change the 'text' field in pinData to your desired prompt\n   - Examples: 'List all my teams', 'Show charge points', 'Start charging at point 123'\n\nThe AI Agent will automatically:\n- Understand your natural language request\n- Select the appropriate Monta API tool\n- Call the API with correct parameters\n- Return formatted results"
  },
  "tags": []
}
