KSeF
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.
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
Maintainer
Works with
Installation
Manual Installation
npx ksefnikConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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/httpSet 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=testDownload 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.
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.
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.
KSeF Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to KSeF? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
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.
Set Up KSeF in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.