{
  "name": "Fakturownia HTTP Streamable MCP Example",
  "description": "Przyk\u0142ad u\u017cycia n8n-nodes-mcp z Fakturownia HTTP Streamable transport",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:3000/fakturownia/stream",
        "options": {
          "headers": {
            "Content-Type": "application/json",
            "x-fakturownia-credentials": "={{ JSON.stringify({\n  \"token\": $env.FAKTUROWNIA_TOKEN,\n  \"subdomain\": $env.FAKTUROWNIA_SUBDOMAIN,\n  \"subscriptionApiKey\": $env.SUBSCRIPTION_API_KEY\n}) }}"
          }
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "jsonrpc",
              "value": "2.0"
            },
            {
              "name": "id",
              "value": "1"
            },
            {
              "name": "method",
              "value": "initialize"
            },
            {
              "name": "params",
              "value": "={{ {\n  \"protocolVersion\": \"2024-11-05\",\n  \"capabilities\": {},\n  \"clientInfo\": { \"name\": \"n8n-http-streamable\", \"version\": \"1.0.0\" }\n} }}"
            }
          ]
        }
      },
      "id": "initialize-mcp",
      "name": "Initialize Fakturownia MCP",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:3000/fakturownia/stream",
        "options": {
          "headers": {
            "Content-Type": "application/json",
            "x-fakturownia-credentials": "={{ JSON.stringify({\n  \"token\": $env.FAKTUROWNIA_TOKEN,\n  \"subdomain\": $env.FAKTUROWNIA_SUBDOMAIN,\n  \"subscriptionApiKey\": $env.SUBSCRIPTION_API_KEY\n}) }}"
          }
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "jsonrpc",
              "value": "2.0"
            },
            {
              "name": "id",
              "value": "2"
            },
            {
              "name": "method",
              "value": "tools/call"
            },
            {
              "name": "params",
              "value": "={{ {\n  \"name\": \"fakturownia_get_invoices\",\n  \"arguments\": {\n    \"limit\": 10\n  }\n} }}"
            }
          ]
        }
      },
      "id": "call-tool",
      "name": "Get Invoices",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        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).length || 0 : 0 }}"
            },
            {
              "name": "raw_response",
              "value": "={{ $json }}"
            }
          ]
        },
        "options": {}
      },
      "id": "process-results",
      "name": "Process Results",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.3,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Initialize Fakturownia MCP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Fakturownia MCP": {
      "main": [
        [
          {
            "node": "Get Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Invoices": {
      "main": [
        [
          {
            "node": "Process Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "fakturownia",
    "mcp",
    "http-streamable",
    "invoices"
  ],
  "triggerCount": 0,
  "updatedAt": "2025-11-17T00:00:00.000Z",
  "versionId": "1"
}