• DATA
  • LOGS
  • SHEETS
  • HUMAN

How to extract NF-e metadata with your AI

Connect the NF-e Access Key Validator once. After that, your AI handles the heavy lifting of parsing raw access keys into usable business data.

Ask AI about this page

Short answer

How do I get CNPJ and state codes from an NF-e key?

Your AI uses the extract_key_metadata tool to pull specific identifiers like CNPJ and state codes from a raw access key string. This turns a long string of numbers into structured data. You'll see the breakdown of how this works below.

Where the data lands.

Structured business data.

The AI processes the key and routes the results to your preferred destination.

DATA

Clean identifiers

The AI isolates the CNPJ and state codes. You get specific business details instead of a raw string.

LOGS

Validation records

The AI confirms the key is valid and logs the extracted metadata. This creates a clear audit trail.

SHEETS

Spreadsheet updates

The AI can push the extracted identifiers into your existing tracking sheets. This keeps your records updated without manual typing.

HUMAN

Manual review

If a key is malformed or the metadata is missing, the AI flags it for you. You decide how to handle invalid entries.

The workflow

What your AI does when the key arrives.

The AI acts as a parser that turns unstructured strings into organized business intelligence.

  1. Identify the key

    Your AI scans your input to find the NF-e access key within the text or file.

    extract_key_metadata
  2. Parse identifiers

    The AI runs the key through the extraction tool to pull the CNPJ and state codes.

    extract_key_metadata
  3. Validate format

    The AI checks that the extracted metadata matches expected business patterns.

    extract_key_metadata
  4. Format output

    The AI organizes the CNPJ and state codes into a clean format for your next task.

    extract_key_metadata

Try it

Copy these to start.

Use these prompts to trigger the extraction immediately.

Starting points

Swap the bracketed text with your actual data, like a specific key or a file name.

NF-e Validator Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_IRwsYmnDubhWF6CADb8mHPMbLhjrqO48Mkm0iChQ/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — NF-e Validator capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "nf-e-access-key-validator-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_IRwsYmnDubhWF6CADb8mHPMbLhjrqO48Mkm0iChQ/mcp"
    }
  }
}
Copy into chat04
  • Extract the CNPJ and state code from this NF-e key: [paste key here]

  • Look at the list of keys in [file name] and pull the metadata for each.

  • Check if the CNPJ in this access key [paste key] is valid.

  • Summarize all the state codes found in the keys in this spreadsheet.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect NF-e Access Key Validator once, then ask.

Just click the link to connect the MCP to your client. Your credentials stay encrypted, and you can start parsing keys right away.

Connect NF-e Access Key Validator to your AI

FAQ

How this task behaves.

  • 01

    Can the AI change the data in the original NF-e?

    No. The AI only reads the access key to extract information. It cannot modify the original electronic invoice.

  • 02

    Does the AI validate the actual invoice content?

    No. It only extracts metadata from the access key string itself.

  • 03

    What happens if the access key is invalid?

    The AI will tell you it cannot find the required metadata in that string.

  • 04

    Can I use this with any AI client?

    Yes, as long as your client supports the Model Context Protocol (MCP).

  • 05

    Can the AI automatically send these details to the government?

    No. The AI only extracts and organizes the data for your use.

  • More questions about NF-e Access Key Validator? The Connector page answers them. See everything the NF-e Access Key Validator Connector can do

Connect NF-e Validator to Claude, Cursor, ChatGPT & more