Skip to main content

Carrot MCP NFC Server - nfcscript wrapper

Project description

carrot-mcp-nfc

Carrot MCP NFC Server — wraps nfcscript for NFC reader communication via MCP.

Tools

Tool Description
version Get server version info
list_readers List available reader types and transports
connect Connect to NFC reader (port, reader_type, transport)
disconnect Disconnect from reader
find Find and activate an NFC card (returns uid, atq, sak)
transceive Raw frame exchange with bit-level control (InCommunicateThru)
exchange Data exchange with auto CRC (InDataExchange)
reqa ISO14443-A REQA (7-bit short frame)
wupa ISO14443-A WUPA (7-bit short frame)
halt ISO14443-A HALT
select ISO14443-A SELECT
anticoll ISO14443-A ANTICOLL (anti-collision)
field_on / field_off Control RF field
script Execute a sequence of NFC operations (see below)
trace_get Get trace log entries (supports level/layer filtering)
trace_clear Clear trace log buffer

Supported Readers

  • pn532 — PN532 HSU (default)
  • clrc663 — CLRC663 UART

Use list_readers to see all registered types at runtime.

Supported Transports

  • serial — Serial/UART (default)

Use list_readers to see all registered types at runtime.

Usage

uv run carrot-mcp nfc

Script Tool

script executes a sequence of NFC operations. Each step is a dict with an op field:

Op Params Description
transceive data (hex), tx_crc?, rx_crc?, last_tx_bits? Raw frame exchange
exchange data (hex) Auto-CRC data exchange
find low_level? (bool) Find and activate card
reqa REQA (7-bit short frame)
wupa WUPA (7-bit short frame)
halt HALT command
select cl_level (int), uid (hex) SELECT command
anticoll cl_level?, nvb?, uid_prefix? (hex) Anti-collision
field_on Turn on RF field
field_off Turn off RF field
wait ms (int) Wait for N milliseconds

Expect Matching

transceive and exchange steps support expect and on_mismatch:

[
  {"op": "transceive", "data": "6007", "expect": "AA55", "on_mismatch": "stop"}
]
  • expect (hex): Expected response data for matching.
  • on_mismatch: "stop" (default) aborts the script on mismatch; "continue" logs the mismatch but proceeds.

The script stops on the first error or on_mismatch: "stop".

Example MCP Call Sequence

list_readers()
connect(port="COM20", reader_type="pn532")
find()
transceive(data="6007", last_tx_bits=7, tx_crc=false, rx_crc=false)
exchange(data="6007")
reqa()
wupa()
select(cl_level=1, uid="04AABBCCDD77")
anticoll(cl_level=1)
halt()
field_off()
trace_get()
trace_clear()
disconnect()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carrot_mcp_nfc-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carrot_mcp_nfc-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file carrot_mcp_nfc-0.1.0.tar.gz.

File metadata

  • Download URL: carrot_mcp_nfc-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for carrot_mcp_nfc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5df0b85822cf0a127830348d53d4f7f790e48133df25927cc2fcfff2075d53d7
MD5 1da4a660da9b77a5f91972af46a93e73
BLAKE2b-256 b2b32cea199bf85633cb7a3a60298cb9e5441be78cd09fbd4f3757e64117c005

See more details on using hashes here.

File details

Details for the file carrot_mcp_nfc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: carrot_mcp_nfc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for carrot_mcp_nfc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c9b5ae8e56e8bc56a2fc62fdd1c2a98fcd29dfd19e0fd6b94af89f1f9b53c5d
MD5 cd8f6cdc733a033f741f532984aeac88
BLAKE2b-256 5ebd5b8d980d109fe72b2509a78f9cffc9621a77d45b2f1aadf76ae3c0e6b461

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page