← Back to directory
M

MCP Fiscal Brasil

Community
MCP server for Brazilian tax: CNPJ, NF-e, SPED, eSocial and the 2026 tax reform (IBS/CBS) — no signup, offline tables.
GitHub source repository ↗
★ 295 Stars Category · Other Very popular
67FMRS · C

MCP Fiscal Brasil is a focused Brazilian tax (fiscal) vertical MCP server with broad coverage: from CNPJ/CPF validation and Simples/MEI lookups to NF-e parsing, DANFE generation, XMLDSig signature checks, SPED/eSocial analysis, offline tax tables and 2026 reform (IBS/CBS) simulation, across roughly 44 tools plus a CLI, REST API and Python SDK. Its standout trait is that most functionality needs no account or API key, with much of the processing done locally and offline. Features that need live SEFAZ interaction require your own A1 certificate, which is opt-in and never leaves your machine. It suits Brazilian accounting, ERP and finance-automation teams; it is not for non-Brazilian tax scenarios and should not be treated as an official government project. Be mindful of third-party data source stability and the advisory nature of its tax outputs.

Reliability
11/20
Security and permissions
14/20
Maintenance
14/20
Documentation
13/20
Setup experience
15/20
Read the FMRS scoring method →

MCP Fiscal Brasil is a Brazilian tax (fiscal) vertical MCP server (Python, MIT license, run via uvx from the PyPI package mcp-fiscal-brasil, stdio transport, roughly 44 tools). It exposes CNPJ, CPF, Simples Nacional/MEI, NF-e, NFS-e, SPED, eSocial and tax-certificate lookups as composable tools for MCP clients such as Claude Desktop, Claude Code, Cursor and VS Code + Continue. Most tools work with no API key: CNPJ and Simples Nacional data come from BrasilAPI, while NF-e parsing, DANFE generation, XMLDSig signature validation, SPED/eSocial analysis and offline reference tables (NCM/CFOP/CST/CEST) run locally. A few tools (consultar_status_sefaz, baixar_nfe_distribuicao, manifestar_nfe) optionally require a local A1 digital certificate (.pfx/.p12) for SEFAZ mTLS traffic. Some tools only return government portal URLs or carry explicit limitations (for example, search CNPJ by name). Note: the server is maintained by DeHor-Labs and is not an official MCP or government project.

Tools

analyze_cnpj_compliance
Produce a consolidated tax-compliance report for one CNPJ (CNPJ + Simples/MEI + CNAE).
risk_score_supplier
Score a supplier 0-100 with risk level, contributing factors and a hiring recommendation.
consultar_empresas_lote
Query many CNPJs in one call, returning compliance data and a score per company plus per-item errors.
compare_tax_regimes
Compare MEI, Simples Nacional, Lucro Presumido and Lucro Real regimes for a given scenario.
validate_nfe_full
Validate a whole NF-e from its XML (XML, access key, issuer) and return structured issues.
summarize_sped
Turn a SPED file into an executive summary: period, company, blocks and inconsistencies.
consultar_cnpj
Look up full CNPJ data: legal name, partners, CNAE, address (via BrasilAPI).
consultar_simples_nacional
Check whether a company opts into Simples Nacional/MEI, with opt-in and opt-out dates (via BrasilAPI).
validar_chave_nfe
Offline check of a 44-digit NF-e access key checksum, extracting UF, CNPJ, date and number.
consultar_nfe
Query a full NF-e by its 44-digit access key (via BrasilAPI).
parse_nfe_xml
Parse raw NF-e/NFC-e XML offline and return structured data.
gerar_danfe
Generate an A4 DANFE PDF offline from NF-e (model 55) XML.
validar_assinatura_nfe
Validate the XMLDSig signature offline and extract certificate data.
consultar_status_sefaz
Check real-time SEFAZ web service status per state via NfeStatusServico4 (requires A1 certificate).
baixar_nfe_distribuicao
Download documents via NFeDistribuicaoDFe (requires a local A1 certificate).
manifestar_nfe
Submit recipient manifestation events for NF-e via NFeRecepcaoEvento (requires an A1 certificate).
validar_cpf
Offline CPF check-digit validation.
analisar_sped
Analyze an EFD/ECD/ECF file offline: period, company, errors.
listar_registros_sped
Filter SPED records by type (such as C100, E110).
listar_eventos_esocial
eSocial event catalog, filterable by group.
validar_evento_esocial
Basic structural validation of eSocial event XML.
consultar_nfse
Return the municipal NFS-e portal URL and the system in use (requires manual action on the portal).
consultar_certidao_federal
Return the e-CAC URL for issuing the federal CND.
consultar_certidao_fgts
Return the Caixa portal URL for checking the CRF.
listar_cnpjs_por_nome
Experimental: search CNPJ by name; the Brazilian Federal Revenue does not expose a public name-search API, so coverage is limited.

Setup

  1. Install uv if needed: curl -LsSf https://astral.sh/uv/install.sh | sh. 2. Easiest run: uvx mcp-fiscal-brasil; to stay current use uvx mcp-fiscal-brasil@latest or uvx --refresh mcp-fiscal-brasil (uvx caches versions). 3. Configure a client, e.g. Claude Desktop: edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) with {"mcpServers":{"fiscal-brasil":{"command":"uvx","args":["mcp-fiscal-brasil"]}}} and restart. 4. For Claude Code: claude mcp add fiscal-brasil -- uvx mcp-fiscal-brasil. 5. For Cursor write .cursor/mcp.json or a project-root .mcp.json; for VS Code + Continue add a continue.mcpServers entry in settings.json. 6. Alternatively use Docker (ghcr.io/dehor-labs/mcp-fiscal-brasil:latest, interactive -i) or pip install mcp-fiscal-brasil. All environment variables (MCP_FISCAL_LOG_LEVEL, BRASILAPI_BASE_URL, HTTP_TIMEOUT) are optional.
claude_desktop_config.json
{
  "mcpServers": {
    "fiscal-brasil": {
      "command": "uvx",
      "args": ["mcp-fiscal-brasil"]
    }
  }
}

Fit and risk

Best for

  • Accounting, ERP, CRM and finance-automation teams serving the Brazilian market.
  • Developers who want local, offline NF-e/SPED processing without uploading XML to third parties.
  • Users of MCP clients such as Claude or Cursor who want to query Brazilian tax data in natural language.
  • Anyone needing offline reference tables such as NCM/CFOP/CST/CEST/ICMS and BCB indexers.

Not for

  • Users needing US or other non-Brazilian tax capabilities.
  • Those expecting official government backing or an official MCP project (this server is maintained by DeHor-Labs, not officially).
  • Anyone wanting SEFAZ real-time status, distribution or manifestation without configuring an A1 certificate.
  • Large-scale CNPJ lookup by company name, which is experimental with limited coverage.

Required permissions

  • Runs locally as an MCP server over stdio; no account or API key required.
  • Network access: calls BrasilAPI (cnpj, nfe, and more) plus an optional ReceitaWS fallback.
  • Optional A1 digital certificate: requires reading a local .pfx/.p12 file and its password for SEFAZ mTLS and XMLDSig signing.
  • Optional environment variables: MCP_FISCAL_LOG_LEVEL, BRASILAPI_BASE_URL, HTTP_TIMEOUT, and NFE_CERTIFICADO_PATH, NFE_CERTIFICADO_SENHA, NFE_EMITENTE_CNPJ, NFE_AMBIENTE.

Risks and side effects

  • Third-party sources (BrasilAPI, ReceitaWS, SEFAZ) can be unstable or change, making results stale or failing.
  • With an A1 certificate enabled, the certificate file and password are sensitive local assets: inject them via a secrets manager as documented and never commit plaintext passwords.
  • Tool outputs and advice (such as risk scores or regime comparisons) are informative and do not replace a professional accountant or legal advice.
  • consultar_status_sefaz raises FiscalConfigurationError when no certificate is configured and the HTTP endpoint returns 503; distinguish this from an actual SEFAZ outage.
  • The experimental listar_cnpjs_por_nome tool has limited coverage and may return unexpected results.

Troubleshooting

  1. Tools missing in the client: confirm you restarted the MCP client and that the JSON config path and syntax are correct.
  2. Running an old version: uvx caches, so use uvx mcp-fiscal-brasil@latest or uvx --refresh mcp-fiscal-brasil.
  3. uvx not found: install uv first (curl -LsSf https://astral.sh/uv/install.sh | sh), or use pip install mcp-fiscal-brasil and set the command to mcp-fiscal-brasil.
  4. SEFAZ status query throws a configuration error or HTTP 503: no NFE_CERTIFICADO_PATH/NFE_CERTIFICADO_SENHA is set or the certificate is invalid; configure it and retry.
  5. Network-based lookups fail: check connectivity to BrasilAPI, the HTTP_TIMEOUT value, and optionally point BRASILAPI_BASE_URL at a custom environment.
  6. Deeper logs: set MCP_FISCAL_LOG_LEVEL to DEBUG.

Use cases

Supplier due diligence and batch screening with risk_score_supplier and consultar_empresas_lote.
CNPJ compliance checks via analyze_cnpj_compliance, combining company, Simples/MEI and CNAE data.
NF-e handling: parse XML offline, generate DANFE, validate XMLDSig signatures and access keys.
Offline analysis and structural validation of SPED and eSocial files.
Tax regime comparison with compare_tax_regimes across MEI, Simples, Lucro Presumido and Lucro Real.
Calling fiscal capabilities from application code via the Python SDK or the mcp-fiscal CLI.

Supported clients

Claude DesktopFull support
Claude CodeFull support
CursorFull support
VS Code + ContinueFull support