# Cte Mdfe MCP

> Cte Mdfe MCP is an open-source MCP server for freight and logistics. Issue and query Brazilian CT-e and MDF-e transport tax documents via Focus NFe. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/faviosenger/cte-mdfe-mcp
- **MCP Registry name:** io.github.FAVIOSENGER/cte-mdfe-mcp
- **Categories:** [freight and logistics](https://ai-powered.com/categories/freight-and-logistics), [legal and government](https://ai-powered.com/categories/legal-and-government)
- **Listing updated:** 2026-11-18

## About

This server targets Brazilian freight paperwork. CT-e is the electronic transport knowledge document and MDF-e the electronic manifest of fiscal documents. It issues and queries them through the Focus NFe service, so an assistant can handle the document lifecycle from chat.

Six tools cover it: emitir_cte, consultar_cte and cancelar_cte for CT-e, and emitir_mdfe, consultar_mdfe and encerrar_mdfe for MDF-e, including closing an authorized manifest. A Focus NFe account token is required, and an environment variable selects homologacao (testing, the default) or producao. A mock provider can be enabled with no credentials for testing.

It installs with npx for Claude Desktop, is documented in Portuguese and is MIT licensed.

## Features

- **CT-e issuing:** Emit a CT-e electronic transport document.
- **CT-e lookup:** Check status and downloads of a CT-e.
- **CT-e cancellation:** Cancel an authorized CT-e.
- **MDF-e issuing and closing:** Emit a manifest and close an authorized one.
- **Test environment default:** Defaults to the homologacao environment.
- **Mock mode:** Try the server with PROVIDER=mock and no credentials.

## Good for

- Issue a CT-e for a freight shipment from an assistant
- Check the status of a transport document
- Close a manifest after a trip ends
- Test the integration in the Focus NFe sandbox

## Install

### Claude Code (Terminal)

```sh
claude mcp add cte-mdfe-mcp --env FOCUS_NFE_TOKEN='<FOCUS_NFE_TOKEN>' -- npx -y cte-mdfe-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "cte-mdfe-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cte-mdfe-mcp"
      ],
      "env": {
        "FOCUS_NFE_TOKEN": "<FOCUS_NFE_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "cte-mdfe-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cte-mdfe-mcp"
      ],
      "env": {
        "FOCUS_NFE_TOKEN": "<FOCUS_NFE_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "cte-mdfe-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cte-mdfe-mcp"
      ],
      "env": {
        "FOCUS_NFE_TOKEN": "<FOCUS_NFE_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "cte-mdfe-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cte-mdfe-mcp"
      ],
      "env": {
        "FOCUS_NFE_TOKEN": "<FOCUS_NFE_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "cte-mdfe-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cte-mdfe-mcp"
      ],
      "env": {
        "FOCUS_NFE_TOKEN": "<FOCUS_NFE_TOKEN>"
      }
    }
  }
}
```

## Tools

- `emitir_cte`: Issues a CT-e electronic transport knowledge document
- `consultar_cte`: Queries status and downloads of a CT-e
- `cancelar_cte`: Cancels an authorized CT-e
- `emitir_mdfe`: Issues an MDF-e electronic manifest
- `consultar_mdfe`: Queries status and downloads of an MDF-e
- `encerrar_mdfe`: Closes an authorized MDF-e

## FAQ

### What do I need?

A Focus NFe account token in FOCUS_NFE_TOKEN.

### Is production the default?

No. It defaults to homologacao; set FOCUS_NFE_AMBIENTE to producao for real documents.

### Can I try it without credentials?

Yes, with PROVIDER set to mock.

### What licence is it under?

MIT.

### Is Cte Mdfe MCP free?

Yes. Cte Mdfe MCP is open source, so you can use and self-host it for free.

### How do I add Cte Mdfe MCP to Claude Code?

Run this command in your terminal: claude mcp add cte-mdfe-mcp --env FOCUS_NFE_TOKEN='<FOCUS_NFE_TOKEN>' -- npx -y cte-mdfe-mcp

### What are the best alternatives to Cte Mdfe MCP?

The closest alternatives to Cte Mdfe MCP are Datos Gob Es, Data Europa, Data Cityofchicago, Data Govt Nz and Datos Cl.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Datos Gob Es](https://ai-powered.com/mcp/datos-gob-es): Datos Gob Es is a freemium MCP server for legal and government.
- [Data Europa](https://ai-powered.com/mcp/data-europa): Data Europa is a freemium MCP server for legal and government.
- [Data Cityofchicago](https://ai-powered.com/mcp/data-cityofchicago): Data Cityofchicago is a freemium MCP server for legal and government.
- [Data Govt Nz](https://ai-powered.com/mcp/data-govt-nz): Data Govt Nz is a freemium MCP server for legal and government.
- [Datos Cl](https://ai-powered.com/mcp/datos-cl): Datos Cl is a freemium MCP server for legal and government.
- [Cipo](https://ai-powered.com/mcp/cipo): Cipo is a freemium MCP server for legal and government.
- [Data Ny](https://ai-powered.com/mcp/data-ny): Data Ny is a freemium MCP server for legal and government.
- [Scb Se](https://ai-powered.com/mcp/scb-se): Scb Se is a freemium MCP server for legal and government.

---
Source: https://ai-powered.com/mcp/cte-mdfe-mcp
