# mcp-nuvem-fiscal

An MCP server that connects your agent to Nuvem Fiscal for issuing NF-e, NFS-e, NFC-e, CT-e and MDF-e, plus CNPJ and CEP lookups.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/fiscal/nuvem-fiscal
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-nuvem-fiscal

## What it does

The server talks to Nuvem Fiscal over OAuth2 client credentials and refreshes the token on its own. Your agent gets 24 tools, among them `create_nfe`, `get_nfe`, `cancel_nfe`, `create_nfse`, `get_nfse`, `cancel_nfse`, `create_nfce`, `cancel_nfce`, `create_cte`, `get_cte`, `cancel_cte`, `create_mdfe`, `get_mdfe`, `cancel_mdfe`, `close_mdfe`, `consult_cnpj`, `consult_cep`, `register_company`, `list_empresas`, `upload_certificate`, `get_nfe_events`, `get_nfe_batch`, `send_correction_letter_nfe` and `send_correction_letter_cte`. That covers issuing a document, cancelling it, filing a correction letter, or uploading an A1 certificate as base64 `.pfx`.

Both `NUVEM_FISCAL_CLIENT_ID` and `NUVEM_FISCAL_CLIENT_SECRET` are required. No credentials, no auth — you get them from the Nuvem Fiscal Developer Portal after registering an application. There is also `MCP_DEMO=true` (or the `--demo` flag): the server skips the API entirely and serves fixtures, which works for offline walkthroughs and integration smoke tests.

Nuvem Fiscal offers a homologation environment (`ambiente=2`), so you can emit documents for testing without touching the real tax system. The package ships under the MIT license.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NUVEM_FISCAL_CLIENT_SECRET` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-nuvem-fiscal -e NUVEM_FISCAL_CLIENT_SECRET=<NUVEM_FISCAL_CLIENT_SECRET> -- npx -y @codespar/mcp-nuvem-fiscal
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add nuvem-fiscal --env NUVEM_FISCAL_CLIENT_SECRET=<NUVEM_FISCAL_CLIENT_SECRET> -- npx -y @codespar/mcp-nuvem-fiscal
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "nuvem-fiscal": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-nuvem-fiscal"
            ],
            "env": {
                "NUVEM_FISCAL_CLIENT_SECRET": "<NUVEM_FISCAL_CLIENT_SECRET>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "nuvem-fiscal": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-nuvem-fiscal"
            ],
            "env": {
                "NUVEM_FISCAL_CLIENT_SECRET": "<NUVEM_FISCAL_CLIENT_SECRET>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NUVEM_FISCAL_CLIENT_SECRET=<NUVEM_FISCAL_CLIENT_SECRET> nuvem-fiscal npx -y @codespar/mcp-nuvem-fiscal
```
Replace <…> with your own values

## When to use it
- issue an NF-e from order data
- cancel an NFS-e that was already issued
- resolve a street address from a CEP
- look up a company by its CNPJ
- upload an A1 certificate for a company on the account

## Example prompts
- Issue an NF-e for this order and return the document ID
- Look up the address for CEP 01310-100
- Cancel the NFS-e with this ID and show me the status

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
