Skip to main content
Glama

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?

sef_check_setup

Okruženje, sigurnosni prekidači, profil

ne

sef_setup_company

Podešava firmu kroz razgovor (pregled → potvrda)

samo lokalno

sef_add_customer

Dodaje ili menja kupca (pregled → potvrda)

samo lokalno

sef_ping

Proverava ključ i vezu sa SEF-om

ne

sef_list_customers

Kupci iz profila

ne

sef_list_vat_exemption_reasons

Zvanične šifre izuzeća (npr. PDV-RS-33)

ne

sef_list_unit_measures

Zvanične jedinice mere (npr. MON, HUR, H87)

ne

sef_draft_invoice

Pravi UBL fakturu lokalno, vraća iznose i approvalCode

samo lokalno

sef_get_draft

Čita nacrt (opciono sa XML-om)

ne

sef_send_invoice

Šalje odobren nacrt na SEF (bez SEF validacije, kao portal — ta opcija na SEF-u još nije u funkciji)

da

sef_get_invoice / sef_list_invoice_ids

Status i pregled poslatih faktura

ne

sef_cancel_invoice

Otkazuje fakturu u statusu Nacrt / Nova / Greška pri slanju

da

sef_storno_invoice

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 firme

Zatim 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=prod i SEF_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

MIT

Available Tools

14 tools
sef_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 deliveredA
Destructive

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 setupA
Read-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 draftB
Read-onlyIdempotent

Returns a stored draft's summary, optionally with the full XML.

Inputs: draftId (required), includeXml.

sef_get_invoiceGet sales invoice from SEFA
Read-onlyIdempotent

Returns a sales invoice and its status from SEF by SEF invoiceId.

Inputs: invoiceId (required).

sef_list_customersList customersA
Read-onlyIdempotent

Lists customers defined in the local profile (id, name, PIB, defaults).

Inputs: no named parameters.

sef_list_invoice_idsList sales invoice idsA
Read-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 measuresA
Read-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 reasonsA
Read-onlyIdempotent

Returns SEF's official list of VAT exemption reason codes (e.g. PDV-RS-33).

Inputs: no named parameters.

sef_pingTest SEF connectionA
Read-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 SEFA
DestructiveIdempotent

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 invoiceA
Destructive

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

    A3.8/5.0

    Scored across 14 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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