# Focus Logística MCP

> Focus Logística manages Brazilian cargo transport paperwork using AI. It lets you issue CT-e and MDF-e documents, check their status, close manifests after delivery, and download required XML files—all through natural conversation with your agent.

## Overview
- **Category:** erp-operations
- **Price:** Free
- **Tags:** transport-invoicing, cargo-manifests, fiscal-compliance, brazil-tax, logistics-automation

## Description

Managing logistics documentation in Brazil is a nightmare of specific forms and deadlines. This MCP connects all that complexity to your AI client. You'll stop manually tracking down authorizations or switching between different government portals. Instead, you just ask your agent what needs to happen next. Need an invoice for freight? Just tell it the route, and it handles issuing the CT-e. Grouping multiple shipments together is simple; you can generate a full cargo manifest (MDF-e) in one go. If a delivery is finished, simply tell your agent to close the manifest record. It manages status checks, cancellations, and ensures you download the correct XML files for accounting compliance—all without you needing deep API knowledge or ever touching a complex web portal. This powerful toolset sits within the Vinkius catalog, giving your AI client access to industry-specific functions that used to require specialized software.

## Tools

### close_mdfe
Marks a Manifest of Cargo (MDF-e) as completed after delivery is confirmed.

### consult_cte
Checks the current operational status and authorization details for a specific CT-e document.

### consult_mdfe
Retrieves the current status of an entire Manifest of Cargo (MDF-e).

### download_xml
Downloads the required XML file for either a CT-e or MDF-e record.

### emit_cte
Creates and issues an official Conhecimento de Transporte (CT-e) document.

### emit_mdfe
Generates a Manifest of Cargo (MDF-e) that groups multiple transport invoices together.

### cancel_cte
Cancels an existing CT-e document, provided a valid reason is supplied.

## Prompt Examples

**Prompt:** 
```
Emit a CT-e for a freight of R$1,200.00 from SP to RJ.
```

**Response:** 
```
CT-e emitted successfully! Reference: CTE-001. Status: Authorized.
```

**Prompt:** 
```
Close the MDF-e reference MDF-001.
```

**Response:** 
```
MDF-e MDF-001 closed successfully.
```

**Prompt:** 
```
Download the XML for CT-e reference CTE-001.
```

**Response:** 
```
XML downloaded. Ready for accounting integration.
```

## Capabilities

### Generate transport invoices
The MCP creates official Conhecimento de Transporte (CT-e) documents for all types of freight movement.

### Create cargo manifests
It groups multiple CT-e records into a single, comprehensive Manifest of Cargo (MDF-e).

### Verify document status
You can check the current authorization and operational status of both CT-e and MDF-e documents.

### Finalize delivery records
The MCP marks a manifest as finished (encerrado) once all associated cargo is confirmed delivered.

### Cancel documentation
If a shipment changes or fails, it allows you to cancel the CT-e with the required justification.

### Prepare compliance files
It downloads the necessary XML records for immediate accounting and legal audits.

## Use Cases

### A shipment needs to be invoiced immediately.
The logistics manager asks their agent, 'Emit a CT-e for the freight from São Paulo to Rio.' The agent executes `emit_cte`, and the manager gets immediate confirmation of the reference number and status.

### Multiple shipments are ready for manifest creation.
The accounting specialist asks their agent to group four completed CT-e records. The agent uses `emit_mdfe` to create a single Manifest of Cargo, simplifying the entire compliance package.

### A delivery is confirmed and must be finalized.
The freight company employee instructs their agent: 'Close out manifest MDF-001.' The agent runs `close_mdfe`, marking the manifest as finished/encerrado in the system.

### Auditors require historical data.
An auditor requests compliance files for a specific cargo group. The specialist tells their agent to run `download_xml` on the relevant MDF-e, providing instant, ready-to-use documentation.

## Benefits

- You generate complex documents like CT-e and MDF-e in minutes, not hours. Instead of filling out forms on a dedicated web portal, you just tell your agent to emit the document, and it handles the entire process.
- Compliance is simplified. You can download the required XML files using the `download_xml` tool, ensuring everything needed for accounting or legal audits is immediately available without manual file retrieval.
- Tracking cargo manifests gets easy. Use `consult_mdfe` to check the status of a group shipment, and then use `close_mdfe` once delivery is confirmed—no more guessing if the paperwork is finished.
- The whole process runs through natural chat. You don't need to memorize API endpoints or navigate complex forms; you simply ask your agent, 'Cancel this CT-e,' and it executes the necessary cancellation using `cancel_cte`.
- You consolidate multiple steps into one conversation. By first emitting a CT-e and then immediately grouping it with other invoices via `emit_mdfe`, you keep all related documentation in one place.

## How It Works

The bottom line is you tell your agent what needs documenting, and it handles the complex sequence of API calls needed to get the job done.

1. First, subscribe to this MCP and input your specific Focus NFe API Token and Base URL into Vinkius.
2. Next, start by prompting your AI client with the desired action, like 'Emit a CT-e for São Paulo to Rio de Janeiro.'
3. The system executes the necessary documentation process and returns confirmation details or the required XML file.

## Frequently Asked Questions

**How do I use Focus Logística MCP to emit a new transport invoice?**
You initiate the process by asking your agent to 'Emit a CT-e.' The system will prompt you for the necessary details, like origin, destination, and freight value, before generating the document.

**Can Focus Logística MCP group multiple shipments?**
Yes. To combine several CT-e documents into one file, use the `emit_mdfe` tool. This creates a single Manifest of Cargo (MDF-e) for easier compliance tracking.

**What if I need to cancel an existing document?**
You run the `cancel_cte` tool, making sure you provide a valid justification reason. The agent handles the required protocol steps to successfully void the record.

**Where do I find the XML files for tax purposes?**
Use the `download_xml` tool. It retrieves the necessary XML records, ready for immediate integration into your accounting software or legal compliance reports.

**Does Focus Logística MCP work with different types of cargo? **
Yes. The system supports various modalities (road, air, rail, waterway), allowing you to manage transport invoices regardless of how the freight moves.