KSeF Faktury
EN
Join the start list

KSeF in ChatGPT and Claude: connect invoices over MCP

In short: KSeF Faktury has an MCP server, a "plug-in" for AI assistants. Once connected, you can ask Claude in plain language which October invoices did not reach KSeF (the Polish National e-Invoicing System), why KSeF rejected an invoice, or for a link to a PDF and UPO (the official KSeF receipt). All you need is an API key from the customer panel. It already works in Claude (claude.ai, Claude Desktop, Claude Code), Cursor and OpenAI Codex. The ChatGPT app does not support MCP servers with an API key yet, so you cannot connect it there for now.

What MCP is and what the assistant can do

MCP (Model Context Protocol) is an open standard that lets an AI assistant use outside services. Our server lives at https://app.ksefshop.pl/mcp and gives the assistant ten tools:

You ask about The assistant uses
plan, invoice allowance, whether KSeF is connected get_account
invoices of a month, by status, buyer NIP or order number list_invoices
the status of one invoice, its KSeF number, the UPO get_invoice
a link to the invoice PDF or the UPO get_invoice_pdf_link
a link to the invoice or UPO XML file get_invoice_xml
rejected and held invoices, and what to do about them list_problems
checking a NIP (checksum, VAT white list, VIES) check_nip
issuing an invoice, a correction for a refund, sending again create_invoice, create_correction, retry_invoice

The first seven tools only read. The last three change data, so they do nothing without explicit confirmation: first they return a summary (buyer, amount, KSeF environment), and only a second call with confirmation issues the document. Technical details are in the MCP server documentation.

Who it is for

The MCP server works for stores connected in the KSeF Faktury customer panel: the WooCommerce plugin, the PrestaShop module or your own API integration. Each API key is one store, so the assistant sees only that store's invoices. The Shopify app has no API keys, so Shopify stores cannot connect an assistant yet.

We are in early access: test mode on KSeF TEST works, and live mode will be enabled later. A test key shows only test invoices and issues them only in KSeF TEST, with no legal effect. That makes it a safe way to see how the assistant handles invoices.

Step 1: an API key in the customer panel

  1. Sign in to the customer panel: app.ksefshop.pl/panel.
  2. Pick the store at the top of the page and open Stores and API keys.
  3. Under API keys, click New key, give it a name (e.g. "Claude"), keep the mode Test (KSeF TEST) and click Create key.
  4. Copy the sk_test_... key right away. We show it only once; if you lose it, create a new one.

A separate key for the assistant is a good habit: you can revoke it with one click at any time without stopping the store plugin.

Step 2: Claude (claude.ai and Claude Desktop)

On a Pro or Max plan:

  1. Open Customize > Connectors.
  2. Click + Add, then Add custom connector.
  3. Name: KSeF Faktury. Server URL: https://app.ksefshop.pl/mcp.
  4. Under Authentication, choose No sign in.
  5. Under Request headers, add the header Authorization with the value Bearer sk_test_... (the word Bearer, a space and your key).
  6. Click Add. The connector works in the browser and in the Claude Desktop app on the same account.

On a Team or Enterprise plan, an organization owner adds the connector: Organization settings > Connectors > Add > Custom > Web. Note that the key header is then shared by all members of the organization, so everyone sees the same store.

Claude connects to the server from Anthropic's cloud, so you install nothing on your computer.

Claude Desktop without a connector (mcp-remote)

If you prefer a local setup, Claude Desktop can start the mcp-remote bridge (needs Node.js 18 or newer). Open Settings > Developer > Edit Config and put this in claude_desktop_config.json:

{
  "mcpServers": {
    "ksef-faktury": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://app.ksefshop.pl/mcp", "--transport", "http-only", "--header", "Authorization:${KSEF_AUTH}"],
      "env": { "KSEF_AUTH": "Bearer sk_test_..." }
    }
  }
}

Restart Claude Desktop. The same entry works in other programs that support only local MCP servers.

Claude Code

claude mcp add --transport http ksef-faktury https://app.ksefshop.pl/mcp --header "Authorization: Bearer sk_test_..."

ChatGPT: what works today

ChatGPT lets you add your own MCP server (Plugins > + > Add custom MCP server, on Plus, Pro, Business, Enterprise and Edu plans). According to OpenAI's documentation, though, that form supports only OAuth sign-in or servers without authentication, and has no field for a fixed API key (OpenAI, Add custom MCP server). The KSeF Faktury server needs a key, because without one anybody could read your invoices. So you cannot connect it in the ChatGPT app for now. When we add OAuth sign-in, we will describe it here.

OpenAI Codex (command line and editor extension) does work. Add this to ~/.codex/config.toml:

[mcp_servers.ksef-faktury]
url = "https://app.ksefshop.pl/mcp"
bearer_token_env_var = "KSEF_API_KEY"

and put your sk_test_... key in the KSEF_API_KEY environment variable.

Cursor and other programs

In Cursor, open ~/.cursor/mcp.json and add:

{
  "mcpServers": {
    "ksef-faktury": {
      "url": "https://app.ksefshop.pl/mcp",
      "headers": { "Authorization": "Bearer sk_test_..." }
    }
  }
}

Any other MCP client that lets you add a header to a remote server connects the same way. A client without remote server support connects through mcp-remote, as in the Claude Desktop example.

Example prompts

For store owners:

For accountants:

The assistant answers in the language you write in. It takes figures and numbers from KSeF Faktury, but check them before booking, as with any report.

Security

Frequently asked questions

Can the assistant issue an invoice on its own?

No. Without confirmation, write tools return only a summary. A good client such as Claude also asks for your consent before every tool that changes something.

Do I see invoices from all my stores?

One key is one store in one mode (test or live). If you run several stores, add a separate connector for each, with its own key.

Does this work with a Shopify store?

Not yet. The KSeF Faktury Shopify app does not issue API keys. The MCP server works for stores in the customer panel (WooCommerce, PrestaShop, API).

Why can't I connect it in ChatGPT?

ChatGPT's custom MCP server form supports only OAuth or no authentication. Our server needs an API key. Of OpenAI's tools, Codex works today.

How much does it cost?

The MCP server has no separate fee. Invoices issued by the assistant count against the plan allowance just like invoices from the plugin. The request limit is shared with the API: 100 per minute per key.

What does the assistant see?

The same as the API does for that key: seller data, invoices and corrections with KSeF numbers, buyer NIPs and names, amounts and KSeF errors. It never sees the KSeF certificate or token.

KSeF Faktury

Join the launch list

We will write once, on launch day in the Shopify App Store (December 2026), and help you set up.