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.1.tar.gz (5.8 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.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 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.1.tar.gz
Algorithm Hash digest
SHA256 09079671e6dad00eb6d4c8645fe0eec0ef57a5063da5d95631e339e050462752
MD5 7c4b98837d2385f6d83510022c5d931e
BLAKE2b-256 7efac7d148431ada337552139c911e3e2d8498ee5aa5fb971b5c481f46cfa12c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b7154d31ca1d076bc8b5687dc4a42816dc4267e3428c41cd4bd5e2f8382de3c
MD5 b3a0ff28845c3d471290f904eb58ed2f
BLAKE2b-256 1c955ee1988cbc78627553831dec3d88e5389f2349ed93bfd0fe98e85ddcb360

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