cmendezs avatar

Mcp Ksef Pl

cmendezs/mcp-ksef-pl

If you're building systems that need to work with Polish electronic invoicing, this connects your AI agent directly to the KSeF (Krajowy System e-Faktur) platform and Peppol network. It handles FA(2) and FA(3) XML generation, validation against Ministry of Finance schemas, NIP and REGON tax identifier verification with checksum algorithms, and the full KSeF submission cycle including status polling and invoice search. It also generates Peppol BIS 3.0 compliant UBL invoices for cross-border transactions. Authentication requires obtaining a KSeF session token externally since the server can't automate the qualified signature flow, but once configured it gives Claude the ability to generate, validate, submit, and query invoices through the official government API.

GitHub stars
3
tools
30
transport
STDIO
env vars
4
last updated
Sep 12, 2026

Tools

30 tools

Public tool metadata for what this MCP can expose to an agent.

generate_fa3_invoiceGenerates a KSeF-compliant FA(3) XML invoice (required for KSeF API v2 submissions)

Generates a KSeF-compliant FA(3) XML invoice (required for KSeF API v2 submissions)

No parameter schema in public metadata yet.

generate_fa2_invoiceGenerates a KSeF-compliant FA(2) XML invoice (legacy format, read-only use)

Generates a KSeF-compliant FA(2) XML invoice (legacy format, read-only use)

No parameter schema in public metadata yet.

validate_fa3_invoiceValidates FA(3) XML: XSD validation and FA(3)-specific business rules

Validates FA(3) XML: XSD validation and FA(3)-specific business rules

No parameter schema in public metadata yet.

validate_fa2_invoiceValidates FA(2) XML: XSD validation (if the schema is available) and business rules

Validates FA(2) XML: XSD validation (if the schema is available) and business rules

No parameter schema in public metadata yet.

parse_fa2_invoiceParses FA(2) XML into a structured dictionary

Parses FA(2) XML into a structured dictionary

No parameter schema in public metadata yet.

submit_invoice_to_ksefSubmits an FA(3) invoice to the KSeF platform and returns a reference number

Submits an FA(3) invoice to the KSeF platform and returns a reference number

No parameter schema in public metadata yet.

get_ksef_invoice_statusRetrieves the processing status of an invoice by its reference number

Retrieves the processing status of an invoice by its reference number

No parameter schema in public metadata yet.

search_ksef_invoicesSearches invoices in KSeF by date range and direction (seller/buyer)

Searches invoices in KSeF by date range and direction (seller/buyer)

No parameter schema in public metadata yet.

validate_polish_nipValidates a NIP (10-digit tax identification number) using a checksum algorithm

Validates a NIP (10-digit tax identification number) using a checksum algorithm

No parameter schema in public metadata yet.

validate_polish_regonValidates a REGON (9- or 14-digit registry number) using a checksum algorithm

Validates a REGON (9- or 14-digit registry number) using a checksum algorithm

No parameter schema in public metadata yet.

generate_peppol_invoiceGenerates a UBL 2.1 invoice compliant with Peppol BIS Billing 3.0 / EN 16931

Generates a UBL 2.1 invoice compliant with Peppol BIS Billing 3.0 / EN 16931

No parameter schema in public metadata yet.

validate_peppol_invoiceValidates a UBL 2.1 Peppol invoice against the CEN EN 16931 base Schematron rules (en16931-base-only scope — does not check the Peppol-specific overlay)

Validates a UBL 2.1 Peppol invoice against the CEN EN 16931 base Schematron rules (en16931-base-only scope — does not check the Peppol-specific overlay)

No parameter schema in public metadata yet.

peppol_lookup_participantCheck whether a business is registered on the Peppol network; returns registration status and supported document types

Check whether a business is registered on the Peppol network; returns registration status and supported document types

No parameter schema in public metadata yet.

peppol_get_service_endpointFetch the AS4 endpoint for a participant's document type

Fetch the AS4 endpoint for a participant's document type

No parameter schema in public metadata yet.

resolve_peppol_dnsDNS-only (SML) diagnostic, independent of SMP reachability

DNS-only (SML) diagnostic, independent of SMP reachability

No parameter schema in public metadata yet.

peppol_sendTransmit a UBL/CII invoice via AS4

Transmit a UBL/CII invoice via AS4

No parameter schema in public metadata yet.

peppol_directory_searchSearch the public Peppol Directory by participant, name, country, or document type

Search the public Peppol Directory by participant, name, country, or document type

No parameter schema in public metadata yet.

list_participant_id_schemesOpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

OpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

No parameter schema in public metadata yet.

list_document_type_idsOpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

OpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

No parameter schema in public metadata yet.

list_process_idsOpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

OpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

No parameter schema in public metadata yet.

list_spis_use_case_idsOpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

OpenPeppol eDEC codelist lookup (requires EINVOICING_PEPPOL_CODELIST_DIR)

No parameter schema in public metadata yet.

check_document_type_id_in_codelistOpenPeppol eDEC codelist check

OpenPeppol eDEC codelist check

No parameter schema in public metadata yet.

check_process_id_in_codelistOpenPeppol eDEC codelist check

OpenPeppol eDEC codelist check

No parameter schema in public metadata yet.

check_participant_id_scheme_in_codelistOpenPeppol eDEC codelist check

OpenPeppol eDEC codelist check

No parameter schema in public metadata yet.

get_peppol_codelist_versionReports the OpenPeppol eDEC codelist version

Reports the OpenPeppol eDEC codelist version

No parameter schema in public metadata yet.

validate_eusr_reportValidate an End User Statistics Report (XSD, then Schematron). Requires the [xslt2] extra.

Validate an End User Statistics Report (XSD, then Schematron). Requires the [xslt2] extra.

No parameter schema in public metadata yet.

validate_tsr_reportValidate a Transaction Statistics Report (XSD, then Schematron). Requires the [xslt2] extra.

Validate a Transaction Statistics Report (XSD, then Schematron). Requires the [xslt2] extra.

No parameter schema in public metadata yet.

validate_mls_messageValidate a Message Level Status document (UBL ApplicationResponse-2 subset). Requires the [xslt2] extra.

Validate a Message Level Status document (UBL ApplicationResponse-2 subset). Requires the [xslt2] extra.

No parameter schema in public metadata yet.

build_mls_messageBuild a document-level MLS response. Requires the [xslt2] extra.

Build a document-level MLS response. Requires the [xslt2] extra.

No parameter schema in public metadata yet.

get_en16931_codelist_versionEN 16931 semantic code list version reporting. Requires EINVOICING_EN16931_CODELIST_DIR.

EN 16931 semantic code list version reporting. Requires EINVOICING_EN16931_CODELIST_DIR.

No parameter schema in public metadata yet.

Sponsors

Configuration

KSEF_SESSION_TOKEN

KSeF v2 AccessToken obtained via the challenge/redeem auth flow. Required for submit_invoice_to_ksef.

KSEF_NIP

NIP (Polish tax identifier, 10 digits) of the entity submitting invoices.

KSEF_ENVIRONMENT

Target KSeF environment: 'production' or 'test' (default: test).

KSEF_TIMEOUT

HTTP request timeout in seconds (default: 30).

Readme

mcp-ksef-pl 🇵🇱

English | Polski

License PyPI version Python mcp-ksef-pl MCP server

A Python MCP server providing tools for Polish electronic invoicing compliant with KSeF (FA(2)) and Peppol BIS Billing 3.0 / EN 16931. It enables AI agents (Claude, IDEs) to generate, validate, and submit invoices to the Krajowy System e-Faktur (KSeF), as well as validate Polish tax identifiers (NIP and REGON).


Introduction

This package is built on mcp-einvoicing-core, the shared base library for European e-invoicing MCP servers. It provides an OAuth2 HTTP client, token cache, data models, logging utilities, and an exception hierarchy.


View the full README on GitHub

Details

Repository
github.com/cmendezs/mcp-ksef-pl
Category
Data & Analytics
Package
mcp-ksef-pl
Transport
STDIO
Registry
MCP registry, active

More from cmendezs

Related Data & Analytics MCP servers

View all
1iman avatarRisk Deskiman/agent-driven-risk-desk-and-skillsPortfolio risk from supplied data or a synthetic example: VaR, ES, stress, credit, FRTB.0stars
2thinkchainai avatarUK Air Quality MCP Server from MCPBundlesthinkchainai/mcpbundlesAccess UK air quality data, monitoring sites, and hourly pollutant measurements across regions3stars
3thinkchainai avatarUK Civic & Parliamentary Data MCP Server from MCPBundlesthinkchainai/mcpbundlesQuery UK Parliament, elections, crime stats, ONS census data, and national archives3stars
4thinkchainai avatarUK Environmental Intelligence MCP Server from MCPBundlesthinkchainai/mcpbundlesAccess UK flood warnings, river levels, water quality, Met Office forecasts, and carbon data3stars
5thinkchainai avatarUK Police MCP Server from MCPBundlesthinkchainai/mcpbundlesAccess street-level crime reports, stop and search data, and outcomes across UK police forces3stars
6thinkchainai avatarUK Property & Business Intelligence MCP Server from MCPBundlesthinkchainai/mcpbundlesSearch UK companies, land registry prices, charities, OS locations, and traffic data3stars