KSeF

v1.0.0Finance & Fintechstable

KSeF SDK for TypeScript/Node.js — invoice reconciliation with bank statements (MT940, mBank, ING, PKO, Santander), production KSeF 2.0 HTTP client, MCP server for Claude and Cursor. Open-source, MIT.

bank-statementclaudee-fakturae-invoiceeinvoice
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is KSeF?

KSeF is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ksef sdk for typescript/node.js — invoice reconciliation with bank statements (mt940, mbank, ing, pko, santander), production ksef 2.0 http client, mcp server for claude and cursor. open-source, mit.

KSeF SDK for TypeScript/Node.js — invoice reconciliation with bank statements (MT940, mBank, ING, PKO, Santander), production KSeF 2.0 HTTP client, MCP server for Claude and Cursor. Open-source, MIT.

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • KSeF SDK for TypeScript/Node.js — invoice reconciliation wit

Use Cases

Reconcile invoices with bank statements (MT940, mBank, ING, PKO, Santander).
Automate e-invoice processing and validation.
CodeFormers-it

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ksefnik

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use KSeF

Ksefnik is a TypeScript/Node.js SDK and MCP server for the Polish National e-Invoice System (KSeF 2.0). It provides tools for fetching, validating, and sending invoices via the KSeF API, importing bank statements in MT940 and CSV formats from major Polish banks, and running automated reconciliation between invoices and transactions.

Prerequisites

  • Node.js 22 or later
  • pnpm 9 or later (or npm as an alternative)
  • A KSeF authentication token (obtained from the Polish Ministry of Finance KSeF portal)
  • Your company NIP (Polish tax identification number)
  • Bank statement files in MT940 or CSV format for reconciliation workflows
1

Install the Ksefnik packages

Install the core SDK and HTTP adapter packages from npm. The simulator package is optional and intended for testing against a local mock.

npm install @ksefnik/core @ksefnik/http
# or with pnpm
pnpm add @ksefnik/core @ksefnik/http
2

Set required environment variables

Configure your KSeF credentials and target environment. Use 'test' or 'demo' during initial setup to avoid affecting production data.

export KSEF_NIP=your_company_nip
export KSEF_TOKEN=your_ksef_auth_token
export KSEF_ENV=test
3

Download the KSeF public key

Download the official KSeF public key PEM file from the Ministry of Finance and place it in your project directory. This is required for encrypting the authentication session init.

4

Add the MCP server to Claude Desktop

Register the Ksefnik MCP server in your claude_desktop_config.json using npx to run the @ksefnik/mcp package directly without a local install.

5

Test the connection

Ask Claude to sync invoices for the current month to verify authentication and connectivity with the KSeF API.

KSeF Examples

Client configuration

Add this to your claude_desktop_config.json to enable the Ksefnik MCP server with your Polish KSeF credentials.

{
  "mcpServers": {
    "ksefnik": {
      "command": "npx",
      "args": ["-y", "@ksefnik/mcp"],
      "env": {
        "KSEF_NIP": "7010002137",
        "KSEF_TOKEN": "your-ksef-token",
        "KSEF_ENV": "test"
      }
    }
  }
}

Prompts to try

Prompts for invoice and bank reconciliation workflows.

- "Sync all invoices from KSeF for March 2026"
- "Import my mBank bank statement from /downloads/wyciag-march.mt940"
- "Reconcile the imported bank transactions against the fetched KSeF invoices and show unmatched items"
- "Validate the invoice XML at /invoices/faktura-001.xml and report any errors"
- "Send the prepared invoice to KSeF and return the UPO confirmation number"

Troubleshooting KSeF

Authentication fails with 401 Unauthorized

Verify KSEF_TOKEN and KSEF_NIP are correct and that the token has not expired. KSeF tokens are session-based and time-limited. Use KSEF_ENV=demo or KSEF_ENV=test for non-production testing to avoid issues with production token requirements.

Bank statement import fails to parse

Ksefnik supports MT940, mBank CSV, ING CSV, PKO BP CSV, and Santander CSV formats with automatic detection. Ensure your file uses the unmodified export format from your bank's online portal. Do not manually edit the file before importing.

npx @ksefnik/mcp not found or fails to install

Ensure Node.js 22+ is installed and accessible in your PATH. Run 'node --version' and 'npx --version' to verify. If behind a corporate proxy, configure npm proxy settings with 'npm config set proxy http://your-proxy:port'.

Frequently Asked Questions about KSeF

What is KSeF?

KSeF is a Model Context Protocol (MCP) server that ksef sdk for typescript/node.js — invoice reconciliation with bank statements (mt940, mbank, ing, pko, santander), production ksef 2.0 http client, mcp server for claude and cursor. open-source, mit. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install KSeF?

Follow the installation instructions on the KSeF GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with KSeF?

KSeF works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is KSeF free to use?

Yes, KSeF is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ksefnik": { "command": "npx", "args": ["-y", "ksefnik"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use KSeF?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides