mcp-nfs-emissor
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-nfs-emissorEmit NFS-e for this month's Shopee affiliate CSV"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-nfs-emissor
Servidor MCP (Desktop Extension .mcpb) que emite NFS-e de comissão de afiliado da Shopee a partir do CSV mensal. Roda 100% local via stdio — o CSV, o certificado A1 e a emissão nunca saem da máquina.
Estado atual: scaffold. Estrutura, configs, servidor MCP e testes estão de pé; a tool
listar_saidasé funcional e as outras 6 são stubs (isError). A lógica de negócio (parse/agregação/emissão) e os providers reais chegam nas próximas fases — verdocs/plugin-claude-mvp/.
Requisitos
Node.js >= 18 (testado no 24)
pnpm
Related MCP server: mcp-nfse-nacional
Scripts
pnpm install # instala dependências
pnpm dev # roda o servidor em dev (tsx), stdio
pnpm build # compila para dist/ (entry_point do .mcpb = dist/server.js)
pnpm typecheck # checagem de tipos sem emitir
pnpm test # testes de integração (vitest, transporte in-memory)Tools (catálogo — fase-2 §5)
Tool | Estado |
| stub |
| stub |
| stub |
| stub |
| stub |
| stub |
| funcional |
Documentação
Fonte de verdade do plugin:
docs/plugin-claude-mvp/(fases 1–4 + decisões).Plano do scaffold:
docs/emissores-nf/plan-scaffold-mcp-01.md.Contexto fiscal e mapeamento do CSV:
docs/emissores-nf/.
Segurança
Segredos (token do provedor, senha do .pfx) chegam por user_config → env, guardados no Keychain/Credential Manager do SO. O .pfx fica fora do bundle (referenciado por caminho). Nada de segredo é versionado — ver .gitignore e .env.example.
Licença
MIT
Available Tools
7 toolscarregar_csvCarregar CSVARead-only
Lê um CSV mensal da Shopee (respeitando aspas no campo Endereço do Vendedor), filtra pedidos com Status válido {Pendente, Concluído} e comissão ≠ 0, e AGREGA por ID da Loja somando a comissão. Retorna a lista de vendedores (uma futura NFS-e por loja) e as contagens do funil. NÃO emite nada.
| Name | Required | Description | Default |
|---|---|---|---|
| competencia | No | Competência AAAA-MM (opcional). | |
| caminhoArquivo | Yes | Caminho do .csv em entradas/. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, and the description confirms no emission, adding that it respects quotes in the address field, filters by status and commission, and aggregates. This provides useful behavioral context beyond the annotations, though it does not cover error conditions or file format details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two sentences) and front-loaded with the main action. It packs essential details without wordiness. Minor improvement could be clearer separation of input/output, but overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity and the presence of full schema coverage and no output schema, the description covers the primary behavior, processing logic, and return values. It could mention error handling or format validation, but for a read-only data loading tool, it is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for both parameters. The tool description does not add significant meaning beyond the schema; it mentions the month concept but does not directly link to the 'competencia' parameter. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reads a monthly CSV from Shopee, applies specific filters (valid status and non-zero commission), aggregates by store ID, and returns the list of sellers and funnel counts. It explicitly distinguishes itself from siblings by emphasizing it does not emit anything, making its purpose clear and unique among the sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is used to load CSV data before emission, but it does not explicitly state when to use it versus alternatives, nor does it provide exclusions. The context from sibling tools helps, but the description itself lacks direct guidance on usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
configurar_prestadorConfigurar prestadorA
Grava os dados fixos do afiliado (prestador/emitente) em config/prestador.json para reutilizar nas emissões. Use antes da primeira emissão ou para corrigir CNPJ/IM/LC116/ISS. O emitente é exclusivamente PJ (CNPJ 14 dígitos; CPF é recusado). Nunca grava token nem senha.
| Name | Required | Description | Default |
|---|---|---|---|
| cnpj | Yes | CNPJ do prestador, 14 dígitos, sem máscara. SÓ CNPJ (PJ). | |
| aliquotaIss | No | Alíquota ISS (%). | |
| codigoLC116 | No | Código de serviço LC 116 (ex.: 17.06 — promoção de vendas). | 17.06 |
| razaoSocial | No | ||
| municipioIbge | Yes | Código IBGE (7 dígitos) do município de emissão do afiliado. | |
| regimeTributario | No | ||
| inscricaoMunicipal | Yes | Inscrição Municipal (cadastrar sem formatação; pode ter letras). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that the tool writes to a specific file, does not save tokens or passwords, and that the emitter must be a legal entity (CNPJ) with CPF rejected. These details go beyond the annotations (readOnlyHint=false) to add safety and constraint context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loading the purpose and usage. Every sentence adds distinct information without redundancy: first sentence states the action and location, second provides usage timing and limitations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a configuration tool with 7 parameters (3 required) and no output schema, the description covers main purpose, timing, and a critical safety note (no token/password). It lacks details on error handling or prerequisites but overall provides sufficient context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With schema coverage at 71%, the description adds value by reinforcing that CNPJ must be 14 digits and exclusively for legal entities, and that CPF is refused. This enriches the schema's parameter descriptions. Remaining parameters are adequately covered by the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool saves fixed data of the affiliate to config/prestador.json for reuse in emissions. It specifies the verb 'Grava' and the resource 'dados fixos do afiliado'. It distinguishes from siblings by its focus on configuration before emission.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises 'Use antes da primeira emissão ou para corrigir CNPJ/IM/LC116/ISS', providing clear context for when to use. It does not explicitly mention when not to use, but the sibling tools cover different operations, making it implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
consultar_statusConsultar statusBRead-only
Consulta no provedor o status atual das notas de uma competência (útil quando a emissão é assíncrona: processando → autorizada/rejeitada). Atualiza o resumo.csv.
| Name | Required | Description | Default |
|---|---|---|---|
| idLoja | No | Consulta apenas esta loja. | |
| protocolo | No | Consulta por protocolo específico. | |
| competencia | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description adds that it updates 'resumo.csv', which is a side effect beyond the readOnlyHint annotation. This provides useful behavioral context, but the contradiction with the annotation reduces confidence.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose, concise with no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Description states purpose and a side effect, but lacks explanation of output format or how to interpret results, which is expected for a query tool without output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 2 of 3 parameters with descriptions, but the required 'competencia' has only a pattern. Description mentions 'competência' but does not explain its meaning (e.g., month/year format) or elaborate on optional parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it queries the provider for current status of invoices for a competency, and gives context about async emission. It distinguishes from sibling tools implicitly by focusing on status checking, but does not explicitly differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description indicates usefulness when emission is asynchronous, providing state transition example. However, it does not specify when not to use or list alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
emitir_nfseEmitir NFS-eAIdempotent
Emite as NFS-e da competência (uma por loja) chamando o provedor. Exige confirmar: true. Respeita o modo (dry-run não envia; sandbox usa mock; producao emite de verdade e exige certificado A1, mas só via configuração do host). Idempotente por (idLoja + competência): não reemite quem já foi autorizada. Processa em BLOCOS e retorna progresso; salva PDFs/XMLs e atualiza o resumo.csv.
| Name | Required | Description | Default |
|---|---|---|---|
| modo | No | Sobrepõe NFS_MODO apenas para dry-run/sandbox. Produção NUNCA vem por argumento — só do host. | |
| offset | No | Retoma a partir do índice N. | |
| confirmar | Yes | Trava de segurança: precisa ser true para prosseguir. | |
| apenasLojas | No | Restringe a emissão a estes IDs de loja. | |
| competencia | Yes | ||
| tamanhoBloco | No | Notas por chamada (default ~100). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotated with openWorldHint and idempotentHint. Description adds significant context: confirmation requirement, mode effects (mock in sandbox, certificate in production), idempotency key, block processing, side effects (saves PDFs/XMLs, updates CSV). No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three dense sentences covering purpose, behavior, and key constraints. No redundancy; every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers emission, modes, idempotency, block processing, and side effects. Mentions return progress but lacks detailed output structure. Without output schema, this is a minor gap; overall sufficient for a complex tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 5 of 6 parameters (competencia missing description). Description adds meaning: confirmar as safety lock, modo override constraints, offset resume, apenasLojas restriction, tamanhoBloco default. Complements schema well.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the purpose: emit NFS-e for a given period (competência) per store. It differentiates from sibling tools like preview or status, and specifies the verb 'emite' and resource 'NFS-e'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides guidance on when to use (actual emission), required confirmation flag, mode behaviors (dry-run, sandbox, production), idempotency, and block processing. However, explicit contrast with preview tool could be stronger.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
listar_saidasListar saídasARead-only
Lista as competências (pastas AAAA-MM) já processadas em saidas/ e quantas notas cada uma tem. Read-only; use para ver o histórico antes de reprocessar.
| Name | Required | Description | Default |
|---|---|---|---|
| competencia | No | Filtra por competência AAAA-MM; vazio lista todas |
Output Schema
| Name | Required | Description |
|---|---|---|
| competencias | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true. The description adds behavioral details: it lists competências and note counts, mentions the directory 'saidas/', and implies no side effects. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first describes what the tool does, second gives usage guidance and safety. Efficient and front-loaded, every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (1 optional param, read-only, has output schema), the description fully covers purpose, usage, and behavior. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a clear pattern and description. The description adds context by mentioning 'processadas em saidas/' and the format 'AAAA-MM', which goes beyond the schema's description. It also implies 'vazio lista todas' without restating it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Lista' (lists), the resource 'competências (pastas AAAA-MM) já processadas em saidas/', and the result 'quantas notas cada uma tem'. It distinguishes itself from sibling tools by specifying its read-only nature and use case before reprocessing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'use para ver o histórico antes de reprocessar', providing clear when-to-use guidance. It also states 'Read-only' implying safe usage. While it doesn't explicitly list when not to use, the context is sufficient given the sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
previsualizar_emissaoPrevisualizar emissãoARead-only
DRY-RUN: monta a tabela do que SERÁ emitido (tomador, valor, discriminação, código de serviço) para a competência já carregada, sem enviar ao provedor. Use para o usuário conferir e confirmar antes de emitir.
| Name | Required | Description | Default |
|---|---|---|---|
| limite | No | Limita a quantidade de linhas retornadas. | |
| competencia | Yes | Competência AAAA-MM já carregada. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true. The description adds behavioral context: it only works for a competência that has been loaded ('já carregada'), and it does not send data to the provider. No contradictions found.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with 'DRY-RUN' for immediate clarity. Every sentence adds value: first states what it does, second states when to use it. No filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description lists key return fields (tomador, valor, discriminação, código de serviço). It mentions the prerequisite of an already loaded competência. The limite parameter is covered by the schema. Some may want pagination details, but overall sufficient for a preview tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both competencia and limite having descriptions. The description adds context that competencia must be 'já carregada', but this is implicit from the schema's description. No additional parameter details beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs a dry-run, assembling a table of what will be issued (tomador, valor, discriminação, código de serviço) for a given competência, without sending to the provider. This distinguishes it clearly from sibling tools like emitir_nfse (actual emission) and consultar_status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use para o usuário conferir e confirmar antes de emitir,' indicating the primary use case is before issuance. It also notes it's a dry-run without sending to provider. However, it does not explicitly state when not to use it or provide alternatives, so it's slightly below maximum.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reprocessar_falhasReprocessar falhasAIdempotent
Reemite APENAS as notas com status rejeitada/erro da competência, reaproveitando os dados já carregados. Exige confirmar: true. Também processa em blocos. Para rejeitada, corrija a causa (config/LC116/alíquota) antes.
| Name | Required | Description | Default |
|---|---|---|---|
| confirmar | Yes | Trava de segurança: precisa ser true para prosseguir. | |
| competencia | Yes | ||
| tamanhoBloco | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description adds behavioral context beyond annotations: requires confirm=true, processes in blocks, and suggests pre-correction for rejected notes. Annotations already indicate mutation (readOnlyHint=false) and idempotency (idempotentHint=true), which aligns. Minor gap: not stating what happens if confirmar is false.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with main purpose, uses emphasis appropriately. Every sentence adds value with no waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters and no output schema, the description covers basic operation but leaves gaps: não explica o parâmetro 'tamanhoBloco' nem o comportamento de 'processa em blocos' em detalhes. Could be more explicit about return or side effects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 33% (only confirmar has a description). The description adds that confirmar must be true and hints at block processing for tamanhoBloco, but does not clarify competencia or tamanhoBloco defaults/values. Marginal improvement over schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it reissues only notes with rejected/error status from the period, reusing loaded data. This is specific and differentiates from siblings like emitir_nfse (emission) or carregar_csv (loading).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says when to use: only for notes with rejected/error status, and advises to correct the cause for rejected notes before calling. It does not explicitly name alternatives but implies not to use for other statuses.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
carregar_csv - First observed
configurar_prestador - First observed
consultar_status - First observed
emitir_nfse - First observed
listar_saidas - First observed
previsualizar_emissao - First observed
reprocessar_falhas
TDQS
Scored across 7 tools
Each tool addresses a distinct step in the NFS-e emission workflow: configuration, CSV loading, dry-run preview, actual emission, status checking, reprocessing failures, and listing historical outputs. There is no functional overlap.
All tool names follow a consistent verb_noun pattern in Portuguese (e.g., configurar_prestador, carregar_csv), using lowercase with underscores throughout. No naming style conflicts are present.
With 7 tools, the server covers all essential phases of batch NFS-e generation from setup to post-processing. The count is neither sparse nor excessive for the domain.
The tool set covers the core workflow (config, load, preview, emit, check status, reprocess failures, list history). A minor gap is the lack of a tool for individual note viewing or manual adjustment, but the overall lifecycle is well-supported.
Maintenance
Related MCP Connectors
Brazilian SEFAZ e-invoices (NF-e, CT-e) issued against your company. A1 cert, DANFE PDF.
Issue and manage Brazilian fiscal documents: NF-e for goods, NFS-e for services.
Notas fiscais eletrônicas brasileiras: consulta, análise, manifestação e emissão de NFS-e.
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
Related MCP Servers
- AlicenseAqualityAmaintenanceModel Context Protocol (MCP) server for Brazilian Electronic Invoicing (NF-e / NFC-e, modelo 55/65, schema 4.00). Provides CPF/CNPJ validation tools, with NF-e/NFC-e generation and SEFAZ integration planned.22Apache 2.0
- AlicenseAqualityDmaintenanceMCP server for querying Brazilian electronic service invoices (NFSe) from the national portal. Allows AI agents to authenticate with digital certificates and search, detail, and download PDFs of issued NFSe.342 npm16ISC
- AlicenseNot gradedqualityCmaintenanceEnables consulting Brazilian electronic invoices (NFE) from official Receita Federal sources through a read-only MCP tool.MIT
- AlicenseNot gradedqualityCmaintenanceAllows consultation of NFS-e (electronic service invoices) from the Brazilian Federal Revenue official source, with a single read-only tool.MIT