sef-mcp
sef-mcp is a local-first MCP server for drafting, reviewing, and safely sending Serbian e-invoices to SEF using a local company/customer profile and two-step approval.
Check setup, environment, safety switches, and profile summary.
Configure or update your company profile through preview-and-confirm steps.
Add or update customers locally, including PIB/MB, address, VAT status, payment terms, and defaults.
Test SEF API connectivity and credentials.
List local customers, official VAT exemption reasons, and accepted unit measures.
Draft UBL 2.1 invoices locally, calculate totals, store drafts, and return an approvalCode.
Read stored drafts, optionally including the full XML.
Send an approved draft to SEF only with its draftId and approvalCode; production writes require explicit safety switches.
Retrieve a sales invoice by SEF invoiceId and list invoice IDs by status/date range.
Cancel eligible invoices on SEF and storno sent/accepted/rejected invoices, after explicit approval.
Work safely by default in the demo environment, with secrets kept in environment/secret manager and local audit logging.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sef-mcp Draft an invoice to Petrović d.o.o. for 5 consulting hours at 8,000 RSD."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sef-mcp
EN: Local-first MCP server that lets an AI assistant (Claude Desktop, Claude Code, Cursor…) draft and send e-invoices to the Serbian SEF (Sistem elektronskih faktura). Safe by default: demo environment, two-step send with human approval, secrets only via a secret manager. Company-specific rules live in a local profile, not in code.
MCP server koji AI asistentu omogućava da pripremi i pošalje izlaznu e-fakturu na SEF — na tvom računaru, sa tvojim API ključem, bez posrednika.
Niste programer?
→ Uputstvo za korisnike: instalacija dvoklikom u Claude aplikaciji, bez terminala, bez Node.js-a i bez menadžera lozinki. Podaci o firmi i kupcima se unose kroz razgovor.
Ostatak ove stranice je za tehničke korisnike i developere.
Related MCP server: serbia-invoice-mcp
Zašto još jedan SEF MCP
Hostovani MCP servisi | sef-mcp | |
Gde ide tvoj API ključ | Kroz tuđi server | Ostaje na tvom računaru |
Ko vidi fakture | Treća strana | Samo ti i SEF |
Slanje | Jedan poziv | Nacrt → tvoje odobrenje → slanje |
Pravila firme (PDV status, kupci, numeracija) | U promptu | U lokalnom profilu, validirano |
Podrazumevano okruženje | Različito | demo (bez poreskog efekta) |
Šta ume (v0.1)
Alat | Šta radi | Menja stanje? |
| Okruženje, sigurnosni prekidači, profil | ne |
| Podešava firmu kroz razgovor (pregled → potvrda) | samo lokalno |
| Dodaje ili menja kupca (pregled → potvrda) | samo lokalno |
| Proverava ključ i vezu sa SEF-om | ne |
| Kupci iz profila | ne |
| Zvanične šifre izuzeća (npr. | ne |
| Zvanične jedinice mere (npr. | ne |
| Pravi UBL fakturu lokalno, vraća iznose i | samo lokalno |
| Čita nacrt (opciono sa XML-om) | ne |
| Šalje odobren nacrt na SEF (bez SEF validacije, kao portal — ta opcija na SEF-u još nije u funkciji) | da |
| Status i pregled poslatih faktura | ne |
| Otkazuje fakturu u statusu Nacrt / Nova / Greška pri slanju | da |
| Stornira fakturu u statusu Poslata / Prihvaćena / Odbijena | da |
Pored alata, postoje i gotovi upiti (mesecna-faktura, podesavanje-firme, status-fakture, storno-ili-otkazivanje) i referentne dokumente (sef-mcp://docs/greske, …/statusi, …/pravila) koji se prave iz istih podataka koje server koristi.
Brzi početak
git clone <repo> sef-mcp && cd sef-mcp
npm install && npm test
node dist/src/index.js init ~/.config/sef-mcp/profile.json # pa popuni podatke firmeZatim prati docs/setup.md: API ključ u 1Password-u (ili drugom secret manageru), povezivanje sa Claude Desktop / Claude Code / Cursor, prvi test na demo okruženju.
Bezbednost ukratko
Podrazumevano
SEF_ENV=demo. Produkcija traži dva prekidača:SEF_ENV=prodiSEF_MCP_ALLOW_PROD_WRITE=true.Slanje zahteva
draftId+approvalCode(prvih 8 znakova SHA-256 XML-a) — šalje se tačno verzija koju si video.Ključ se nikad ne loguje, ne vraća iz alata i ne čuva na disku. Prihvata se samo iz okruženja.
Klijent komunicira isključivo sa
efaktura.mfin.gov.rs/demoefaktura.mfin.gov.rs.Prilozi samo iz jednog dozvoljenog foldera, samo PDF, sa ograničenjem veličine.
Lokalni audit log (
audit.jsonl) svakog nacrta, slanja i otkazivanja.
Detalji: SECURITY.md i docs/technical-spec.md.
Status
v0.1 — rana faza. Usklađeno sa SEF 4.2.0 (pravila iz izdanja 3.14–4.2.0, vidi tehničku specifikaciju §11), API specifikacijom od 31.07.2026 i ITU od 01.10.2026. UBL generator reprodukuje strukturu koju SEF sam pravi za fakturu unetu u portal (golden test). Fakture se šalju bez SEF validacije, kao sa portala, jer ta opcija na SEF-u još nije u funkciji (podrška SEF-a, 05.11.2026). Vidi docs/roadmap.md.
Dokumentacija
Odricanje odgovornosti
Ovo nije zvaničan alat Ministarstva finansija. Odgovornost za sadržaj i poresku ispravnost faktura ostaje na izdavaocu. Poreske kategorije i šifre izuzeća potvrdi sa svojim knjigovođom.
Licenca
Available Tools
14 toolssef_add_customerAdd or update a customerB
Adds a customer to the local profile (or replaces the one with the same id). Same preview → confirm flow as sef_setup_company. Nothing is sent to SEF.
Inputs: id (required), pib (required), name (required), address (required), +10 more.
sef_cancel_invoiceCancel an invoice not yet deliveredADestructive
Cancels a sales invoice on SEF. SEF allows this only for status Draft, New or Sending error; for Sent/Accepted/Rejected use sef_storno_invoice. Only call after explicit user approval.
Inputs: comment (required), invoiceId (required).
sef_check_setupCheck sef-mcp setupARead-onlyIdempotent
Shows environment (demo/prod), safety switches and profile summary. Makes no network calls.
Inputs: no named parameters.
sef_draft_invoiceDraft an invoice (no sending)A
Builds a UBL 2.1 invoice locally from the profile and the given lines, stores it as a draft and returns totals plus an approvalCode. Nothing is sent to SEF. Always show the result to the user before sending.
Inputs: lines (required), number (required), customer (required), issueDate (required), +10 more.
sef_get_draftRead a draftBRead-onlyIdempotent
Returns a stored draft's summary, optionally with the full XML.
Inputs: draftId (required), includeXml.
sef_get_invoiceGet sales invoice from SEFARead-onlyIdempotent
Returns a sales invoice and its status from SEF by SEF invoiceId.
Inputs: invoiceId (required).
sef_list_customersList customersARead-onlyIdempotent
Lists customers defined in the local profile (id, name, PIB, defaults).
Inputs: no named parameters.
sef_list_invoice_idsList sales invoice idsARead-onlyIdempotent
Lists SEF sales invoice ids by status within a date range. For New, Draft and Mistake the range filters by creation date; for all other statuses by sending date (SEF 3.15.0).
Inputs: dateTo (required), status (required), dateFrom (required).
sef_list_unit_measuresList unit measuresARead-onlyIdempotent
Returns SEF's list of accepted unit codes (e.g. H87 piece, HUR hour, MON month).
Inputs: no named parameters.
sef_list_vat_exemption_reasonsList VAT exemption reasonsARead-onlyIdempotent
Returns SEF's official list of VAT exemption reason codes (e.g. PDV-RS-33).
Inputs: no named parameters.
sef_pingTest SEF connectionARead-onlyIdempotent
Calls a harmless read-only SEF endpoint to confirm the API key and environment work.
Inputs: no named parameters.
sef_send_invoiceSend an approved draft to SEFADestructiveIdempotent
Uploads a previously drafted invoice to SEF. Requires the draftId and the approvalCode the user approved. Only call after the user explicitly approved this exact draft. In prod it also requires SEF_MCP_ALLOW_PROD_WRITE=true. Sends without SEF's own validation by default, like the SEF portal (SEF support: the option is not in operation yet). Pass executeValidation=true only if the user explicitly asks for it. A draft that was already sent successfully is not uploaded again: the result has alreadySent=true and the earlier SEF response.
Inputs: draftId (required), approvalCode (required), executeValidation.
sef_setup_companySet up the company profileA
Creates or updates the seller (your company) in the local profile, so no JSON has to be edited by hand. Call without confirmCode to get a preview and a confirmCode; show the preview to the user; only after they confirm, call again with the same values plus confirmCode. Nothing is sent to SEF.
Inputs: mb (required), pib (required), name (required), address (required), +9 more.
sef_storno_invoiceStorno a sent invoiceADestructive
Reverses (storno) a sales invoice on SEF. SEF allows this only for status Sent, Accepted or Rejected. Only call after explicit user approval.
Inputs: comment (required), invoiceId (required), stornoNumber.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
The tools are mostly distinct: draft/send/get/list/cancel/storno each target a clear lifecycle stage, and cancel vs storno is explicitly disambiguated by invoice status. Minor overlap exists between sef_check_setup and sef_ping, and between sef_get_invoice and sef_get_draft, but the descriptions resolve these cases.
All tools use a consistent snake_case sef_ prefix, and nearly all follow a verb_noun pattern (list_invoice_ids, send_invoice, get_draft). The only slight deviation is sef_ping, which is a conventional diagnostic name and does not disrupt the pattern.
With 14 tools, the server sits well within the typical 3-15 range and each tool corresponds to a meaningful operation in the SEF invoice workflow. There is no obvious bloat or missing thin wrapper.
The surface covers the core invoice lifecycle: profile setup, customer management, reference data, drafting, sending, retrieval, listing, cancellation, and storno. Minor gaps remain around draft management (delete/update or list drafts) and customer deletion, but agents can work around these.
Maintenance
Related MCP Connectors
Serbia SEF eFaktura invoices for AI agents: build UBL 2.1 SRB-CIUS, upload to SEF, query, cancel.
Create EU-compliant invoices, manage clients and download PDFs from your AI assistant.
Create invoices from your AI assistant in 6 languages and 10 currencies, ready for WhatsApp.
Issue Brazilian service invoices (NFS-e Nacional) from your AI, with preview and confirmation.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to issue Poland structured e-invoices (faktura ustrukturyzowana) through KSeF 2.0, handling FA(3) XML building, encrypted session flow, and KSeF number retrieval.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to issue, query, and cancel Serbia SEF eFaktura electronic invoices (UBL 2.1 SRB-CIUS) into the national Ministry of Finance system, using the merchant's own API key.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to create and manage e-invoices through natural language, supporting EU compliance formats like ZUGFeRD and XRechnung, as well as US plain PDF invoices.7-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to locally parse, validate, audit, explain, generate, and convert XRechnung and ZUGFeRD/Factur-X e-invoices using official rule sets, fully offline with no API keys required.Apache 2.0