mcpField
M
mcp-nuvem-fiscal

mcp-nuvem-fiscal

Local
github.com/codesparFinance275Updated 4w ago

About mcp-nuvem-fiscal

mcp-nuvem-fiscal is an MCP server for Nuvem Fiscal, aimed at Brazilian businesses and developers who issue fiscal documents. It exposes tools for creating, querying and cancelling NF-e, NFS-e, NFC-e, CT-e and MDF-e documents, plus CNPJ and CEP lookups.

Key features

  1. 01NF-e, NFS-e and NFC-e creation and lookup
  2. 02CT-e and MDF-e transport document management
  3. 03CNPJ company data and CEP address lookup
  4. 04Correction letters and batch status queries
  5. 05Homologation environment and demo mode

Use cases

  1. 01Issuing or cancelling electronic invoices from an AI assistant
  2. 02Looking up company registration and address data
  3. 03Testing fiscal document workflows in a sandbox

MCP support

This is an MCP server that exposes 24 tools to MCP clients for performing fiscal document operations through the Nuvem Fiscal API.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-nuvem-fiscal": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-nuvem-fiscal"
],
"env": {
"NUVEM_FISCAL_CLIENT_SECRET": "<NUVEM_FISCAL_CLIENT_SECRET>"
}
}
}
}
Run commandnpx -y @codespar/mcp-nuvem-fiscal
Environment variables to set
NUVEM_FISCAL_CLIENT_SECRETSecretAPI key for nuvem-fiscal

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-nuvem-fiscal0.3.1

Tools

24

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
itensarrayYesArray of items (product, quantity, value, taxes)
ambienteenumYes1=Produção, 2=Homologação1 | 2
emitenteobjectYesIssuer data (CNPJ, IE, address, etc.)
pagamentoobjectYesPayment information
destinatarioobjectYesRecipient data (CPF/CNPJ, address, etc.)
natureza_operacaostringYesNature of the operation (e.g. 'Venda de mercadoria')

Details

From the project README

@codespar/mcp-nuvem-fiscal

MCP server for Nuvem Fiscal — NFe, NFSe, NFCe fiscal document emission and CNPJ/CEP lookup

npm License: MIT

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nuvem-fiscal": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-nuvem-fiscal"],
      "env": {
        "NUVEM_FISCAL_CLIENT_ID": "your-client-id",
        "NUVEM_FISCAL_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
Claude Code
claude mcp add nuvem-fiscal -- npx @codespar/mcp-nuvem-fiscal
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "nuvem-fiscal": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-nuvem-fiscal"],
      "env": {
        "NUVEM_FISCAL_CLIENT_ID": "your-client-id",
        "NUVEM_FISCAL_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Tools (24)

ToolPurpose
create_nfeCreate a NF-e (nota fiscal eletrônica)
get_nfeGet NF-e details by ID
cancel_nfeCancel a NF-e
create_nfseCreate a NFS-e (nota fiscal de serviço eletrônica)
get_nfseGet NFS-e details by ID
cancel_nfseCancel a NFS-e
create_nfceCreate a NFC-e (nota fiscal de consumidor eletrônica)
consult_cnpjConsult company data by CNPJ number
consult_cepConsult address by CEP (postal code)
register_companyRegister a company in Nuvem Fiscal
create_cteCreate a CT-e (conhecimento de transporte eletrônico)
get_cteGet CT-e details by ID
cancel_cteCancel a CT-e
create_mdfeCreate a MDF-e (manifesto de documentos fiscais eletrônico)
get_nfe_eventsGet events for a NF-e (cancellations, corrections, etc.)
cancel_nfceCancel a NFC-e (nota fiscal de consumidor eletrônica)
send_correction_letter_nfeSend a carta de correção eletrônica (CCe) for a NF-e.
send_correction_letter_cteSend a carta de correção for a CT-e.
get_nfe_batchGet NF-e batch (lote) status by batch ID.
get_mdfeGet MDF-e details by ID
cancel_mdfeCancel a MDF-e (manifesto)
close_mdfeClose (encerrar) a MDF-e at route end.
list_empresasList all companies (empresas) registered in the account.
upload_certificateUpload or update an A1 digital certificate (.pfx, base64) for an empresa.

Authentication

Nuvem Fiscal uses OAuth2 client credentials. The server automatically manages token refresh.

Sandbox / Testing

Nuvem Fiscal supports a homologation environment (ambiente=2) for testing fiscal document emission without affecting real tax systems.

Demo Mode

Set MCP_DEMO=true (or pass --demo) to run the server without contacting the Nuvem Fiscal API. In MCP_DEMO=true mode, create_nfse issues distinct fixture IDs per call within one process and echoes input servico.codigo, valor, and servico.descricao into the response. pdf_url is templated from the fixture id. Other demo tools return static fixtures and are useful for offline walkthroughs and integration smoke tests.

Get your credentials
  1. Go to Nuvem Fiscal Developer Portal
  2. Create an account
  3. Register an application to get OAuth2 credentials
  4. Set the environment variables

Environment Variables

VariableRequiredDescription
NUVEM_FISCAL_CLIENT_IDYesOAuth2 client ID
NUVEM_FISCAL_CLIENT_SECRETYesOAuth2 client secret

Roadmap

v0.2 (planned)
  • create_cte — Create a CT-e (electronic transport document)
  • get_cte — Get CT-e details by ID
  • cancel_cte — Cancel an issued CT-e
  • create_mdfe — Create an MDF-e (electronic freight manifest)
  • get_nfe_events — Get events for an NF-e (cancellation, correction, etc.)
v0.3 (planned)
  • batch_nfe — Create multiple NF-e in a single request
  • get_nfe_danfe — Get DANFE PDF for an NF-e
  • manifest_recipient — Manifest recipient awareness of an NF-e

Want to contribute? Open a PR or request a tool.

Links

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.