{"product_id":"n8n-mcp-server-connect-claude-chatgpt-to-wfirma-ksef-invoicing","title":"n8n MCP Server: Connect Claude\/ChatGPT to wFirma \u0026 KSeF Invoicing","description":"\u003ch3\u003eConnect Claude\/ChatGPT to Polish invoicing—directly from n8n\u003c\/h3\u003e\n\u003cp\u003eThis \u003cstrong\u003en8n MCP Server\u003c\/strong\u003e lets any MCP client (like \u003cstrong\u003eClaude\u003c\/strong\u003e or \u003cstrong\u003eChatGPT\u003c\/strong\u003e) safely access \u003cstrong\u003ewFirma\u003c\/strong\u003e invoicing and accounting tools. In plain terms: you can search, read, edit, and manage documents in wFirma through an MCP interface—while a built-in approval\/confirmation guard protects irreversible \u003cstrong\u003eKSeF\u003c\/strong\u003e actions.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003e\u003cstrong\u003e1) MCP Server Trigger + n8n User Auth (OAuth2)\u003c\/strong\u003e\u003cbr\u003e\nThe workflow exposes \u003cstrong\u003e9 MCP tools\u003c\/strong\u003e. Users sign in with their \u003cstrong\u003en8n account\u003c\/strong\u003e via OAuth2, and \u003cstrong\u003eonly authorized people\u003c\/strong\u003e can run the workflow.\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e2) One workflow import, routed requests\u003c\/strong\u003e\u003cbr\u003e\nEach tool call uses a gateway tied to \u003cstrong\u003e$workflow.id\u003c\/strong\u003e, so you import \u003cstrong\u003eone file\u003c\/strong\u003e. A \u003cem\u003ePlan\u003c\/em\u003e node builds the \u003cstrong\u003ewFirma API URL\u003c\/strong\u003e and checks whether the call needs approval; \u003cem\u003eRoute\u003c\/em\u003e sends it to the API, the approval guard, or the docs branch.\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e3) XML-to-API requests and clean JSON responses\u003c\/strong\u003e\u003cbr\u003e\nThe workflow uses an \u003cstrong\u003eXML\u003c\/strong\u003e node to convert requests into \u003cstrong\u003ewFirma XML\u003c\/strong\u003e, sends them via HTTP, then parses responses back into JSON (\u003cem\u003eok\u003c\/em\u003e, \u003cem\u003estatus\u003c\/em\u003e, \u003cem\u003erecords\u003c\/em\u003e, pagination).\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e4) Safe handling of irreversible KSeF operations\u003c\/strong\u003e\u003cbr\u003e\nDeleting records, emailing invoices, fiscalization, and final invoices sent to \u003cstrong\u003eKSeF\u003c\/strong\u003e require \u003cstrong\u003econfirmed=true\u003c\/strong\u003e. Otherwise the workflow returns \u003cstrong\u003eCONFIRMATION_REQUIRED\u003c\/strong\u003e, forcing the model to ask the user first.\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e5) Rate-limit resilience for reads\u003c\/strong\u003e\u003cbr\u003e\nIf wFirma rate-limits \u003cem\u003efind\/get\u003c\/em\u003e, the workflow waits \u003cstrong\u003e35 seconds\u003c\/strong\u003e and retries once. Writes are \u003cstrong\u003enot\u003c\/strong\u003e auto-retried.\u003c\/p\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAsk an MCP client to \u003cstrong\u003esearch and retrieve invoices\u003c\/strong\u003e from wFirma and return paginated results.\u003c\/li\u003e\n  \u003cli\u003eUse MCP to \u003cstrong\u003eedit invoice data\u003c\/strong\u003e, manage contractors, and handle payments\/expenses.\u003c\/li\u003e\n  \u003cli\u003eFetch \u003cstrong\u003ewFirma official API module docs\u003c\/strong\u003e on demand and get XML examples in Markdown (\u003cem\u003ewfirma_docs\u003c\/em\u003e).\u003c\/li\u003e\n  \u003cli\u003eGenerate workflows that prevent accidental irreversible actions—KSeF finalization requires explicit user confirmation.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMCP Server Trigger\u003c\/strong\u003e with \u003cstrong\u003en8n User Auth (OAuth2)\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003eTools: \u003cstrong\u003e9 tools\u003c\/strong\u003e covering ~\u003cstrong\u003e40 wFirma API modules\u003c\/strong\u003e (invoices, contractors, payments, expenses, and more)\u003c\/li\u003e\n  \u003cli\u003en8n nodes\/logic: \u003cstrong\u003eif, set, xml, wait, switch, markdown\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003eImplements an internal \u003cstrong\u003ePlan\/Route\u003c\/strong\u003e flow per \u003cstrong\u003e$workflow.id\u003c\/strong\u003e and parses XML responses into JSON\u003c\/li\u003e\n  \u003cli\u003eIncludes \u003cstrong\u003ewfira docs\u003c\/strong\u003e fetching of the official Postman collection content as \u003cstrong\u003eMarkdown\u003c\/strong\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46289245175987,"sku":"N8N-21577","price":54.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/iKjOfEOPYrCJZzY7QSre3_f6g21kg4.png?v=1793006653","url":"https:\/\/buyflowscripts.com\/products\/n8n-mcp-server-connect-claude-chatgpt-to-wfirma-ksef-invoicing","provider":"N8N Commerce","version":"1.0","type":"link"}