{
  "name": "wFirma SSE MCP Example",
  "description": "Przyk\u0142ad u\u017cycia n8n-nodes-mcp z wFirma SSE MCP Server",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:3000/initialize",
        "options": {
          "headers": {
            "Content-Type": "application/json",
            "x-wfirma-credentials": "={{ JSON.stringify({\n  \"accessKey\": $env.WFIRMA_ACCESS_KEY,\n  \"secretKey\": $env.WFIRMA_SECRET_KEY,\n  \"appKey\": $env.WFIRMA_APP_KEY,\n  \"companyId\": $env.WFIRMA_COMPANY_ID,\n  \"apiUrl\": \"https://api2.wfirma.pl\"\n}) }}"
          }
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": []
        }
      },
      "id": "initialize-mcp",
      "name": "Initialize MCP Server",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:3000/call",
        "options": {
          "headers": {
            "Content-Type": "application/json",
            "x-wfirma-credentials": "={{ JSON.stringify({\n  \"accessKey\": $env.WFIRMA_ACCESS_KEY,\n  \"secretKey\": $env.WFIRMA_SECRET_KEY,\n  \"appKey\": $env.WFIRMA_APP_KEY,\n  \"companyId\": $env.WFIRMA_COMPANY_ID,\n  \"apiUrl\": \"https://api2.wfirma.pl\"\n}) }}"
          }
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "tool",
              "value": "get_invoices"
            },
            {
              "name": "args",
              "value": "={{ {\n  \"limit\": 10,\n  \"date_from\": \"2024-01-01\",\n  \"date_to\": \"2024-12-31\"\n} }}"
            }
          ]
        }
      },
      "id": "call-tool",
      "name": "Call get_invoices",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "status",
              "value": "={{ $json.result ? 'success' : 'error' }}"
            },
            {
              "name": "invoices_count",
              "value": "={{ $json.result?.content?.[0]?.text ? JSON.parse($json.result.content[0].text).data?.length || 0 : 0 }}"
            },
            {
              "name": "raw_response",
              "value": "={{ $json }}"
            }
          ]
        },
        "options": {}
      },
      "id": "process-results",
      "name": "Process Results",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.3,
      "position": [
        1120,
        300
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Initialize MCP Server",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize MCP Server": {
      "main": [
        [
          {
            "node": "Call get_invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call get_invoices": {
      "main": [
        [
          {
            "node": "Process Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "wfirma",
    "mcp",
    "sse",
    "invoices"
  ],
  "triggerCount": 0,
  "updatedAt": "2024-10-07T13:40:00.000Z",
  "versionId": "1"
}