KSeF MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| KSEF_NIP | No | Your NIP (Polish tax ID) for KSeF. | |
| KSEF_TOKEN | No | KSeF API token for token-based authentication. | |
| KSEF_CERT_PATH | No | Path to PKCS#12 certificate file for certificate-based authentication. | |
| KSEF_CERT_PASSWORD | No | Password for the certificate file (if encrypted). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ksef_session_statusA | Report configured KSeF environment and auth state without exposing secrets. |
| ksef_test_connection_checkC | Authenticate to KSeF TEST and persist readiness before invoice XML generation. |
| ksef_get_capabilitiesA | Report supported, advisory, unsupported, and manual-smoke workflow capabilities. |
| ksef_list_invoicesB | Query KSeF invoice metadata for a date range and role. |
| ksef_get_invoiceB | Fetch a KSeF invoice by reference number. |
| ksef_download_upoC | Retrieve invoice or session UPO for a known KSeF session. |
| ksef_check_attachment_permissionA | Check whether the current KSeF context may issue invoices with FA(3) attachments. |
| ksef_validate_nipA | Validate a Polish NIP checksum. |
| ksef_validate_fa3_xmlB | Validate FA(3) XML against the vendored official XSD. |
| ksef_lookup_counterpartyB | Look up advisory counterparty data from MF, VIES, KRS, or GUS sources. |
| ksef_lookup_exchange_rateA | Fetch official NBP exchange-rate data; advisory and requires basis confirmation. |
| ksef_advise_exchange_rate_basisC | Suggest the advisory NBP average rate for a VAT exchange-rate basis date. |
| ksef_advise_vat_treatmentB | Suggest advisory VAT treatment candidates and missing facts; never mutates drafts. |
| ksef_add_source_documentB | Store a local source document and index it for advisory retrieval. |
| ksef_search_source_documentsB | Search local source documents; returned matches are advisory provenance only. |
| ksef_extract_invoice_sourceB | Use a local LLM to propose source-backed invoice fields without mutating drafts. |
| ksef_attach_field_provenanceB | Attach source-backed field provenance to a draft and require confirmation. |
| ksef_start_invoice_draftC | Create an invoice draft and return the missing-field checklist. |
| ksef_update_invoice_draftC | Update an invoice draft with user-provided facts or confirmations. |
| ksef_validate_invoice_draftB | Validate invoice draft completeness before XML preparation. |
| ksef_prepare_invoiceA | Build and validate invoice XML without sending; refuses until TEST readiness passes. |
| ksef_render_invoice_pdfB | Render a local KSeF-like PDF from prepared FA(3) XML without sending to KSeF. |
| ksef_submit_invoiceA | Irreversibly issues a legally binding invoice to KSeF. Requires a confirmation_token from ksef_prepare_invoice. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| first-use-setup | Guide the local TEST-first setup and first safe invoice flow. |
| issue-invoice | Guide an invoice draft through source gathering, validation, prepare, and submit. |
| monthly-review | Review KSeF invoices for a month using read-only tools. |
| explain-vat-treatment | Explain possible VAT treatment using advisory sources and ask for confirmation. |
| extract-invoice-source | Use local source search to propose draft fields with provenance. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| fa3-schema | Vendored FA(3) XSD schema used for local validation. |
| ksef-glossary | Short definitions for KSeF invoice workflow terms. |
| invoice-field-checklist | Current deterministic required and conditional fields for draft preparation. |
| capabilities | Machine-readable supported, advisory, and unsupported workflow surface. |
| seller-profile | Sanitized local seller profile, if configured. |
| knowledge-sources | Local source documents indexed for advisory retrieval. |
| first-use-checklist | TEST-first local and manual gates before the first invoice. |
TDQS
Scored across 23 tools
Most tools target distinct resources and actions, with clear workflow phases (drafting, validation, submission, retrieval). Minor overlap exists among source-document/provenance tools and between exchange-rate lookup/advice, but descriptions generally clarify boundaries.
All tools share a ksef_ prefix and mostly follow verb_noun conventions (validate_nip, list_invoices, submit_invoice). A few names deviate, like ksef_session_status (missing verb) and ksef_test_connection_check (awkward phrasing), but the pattern remains predictable.
23 tools fall in the heavy range for a single server, though the KSeF domain spans source documents, drafting, validation, and submission. The count is justifiable but leans high, with several advisory/provenance utilities that could potentially be consolidated.
The server covers a full invoice lifecycle: source ingestion, drafting, validation, XML preparation, submission, and retrieval/UPO download. Minor gaps exist (no source-document update/delete, no explicit draft retrieval/cancel), but agents can complete core workflows without dead ends.