LabscoMCP early access ↗
SamuelMoraesFMCP SERVER

NFS-e Nacional

Pull the electronic service invoices (NFSe) issued in a date range, then take any access key from that list and fetch the full record, its XML or its DANFSe PDF.

by SamuelMoraesF ↗Accounting, Invoicing & BookkeepingCommunity

LABSCO SUMMARY

Invoice lookup that ends with the XML and the PDF already on disk.

The three tools chain in one direction: search a period, take an access key out of the result, then pull the full record or the DANFSe. Because nfse_detalhes and nfse_pdf write files and return paths, the model keeps a short answer while the artefacts land where the accounting work happens. Issuing or cancelling an invoice is not in the tool set — this side is retrieval only.

What it is

A retrieval server for Brazil's national NFSe service, where every invoice is addressed by its access key.

What you get

  • Search NFSe issued between a start and an end date, and get the date, recipient, value, status and access key of each one.
  • Open a single invoice from its access key: header, issuer, values and DPS, with the XML written to disk.
  • Download the DANFSe PDF for an invoice and receive the path of the saved file.

Requirements

A digital certificate (e-CNPJ or e-CPF) as a .pfx or .p12 file: its path goes in CERT_FILE and its password in CERT_PASSWORD. nfse_detalhes saves the XML and nfse_pdf saves the PDF locally, in ./storage unless STORAGE_PATH points elsewhere, and both hand back a path rather than the document itself.

Setup effort

One command plus credentials — CERT_FILE=<YOUR_CERT_FILE> CERT_PASSWORD=<YOUR_CERT_PASSWORD> npx -y mcp-nfse-nacional