Skip to main content

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
active Find and activate an NFC card (returns uid, atq, sak)
transceive Raw frame exchange with bit-level control (InCommunicateThru)
reqa ISO14443-A REQA (7-bit short frame)
wupa ISO14443-A WUPA (7-bit short frame)
halt ISO14443-A HALT
field_on / field_off Control RF field
script Execute a sequence of NFC operations (see below)
trace_get Get trace log entries (supports layer/direction 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
active low_level? (bool) Find and activate card
reqa REQA (7-bit short frame)
wupa WUPA (7-bit short frame)
halt HALT command
field_on Turn on RF field
field_off Turn off RF field
wait ms (int) Wait for N milliseconds

Expect Matching

Data ops (transceive, active, reqa, wupa) support expect, expect_bits, and on_mismatch:

[
  {"op": "transceive", "data": "26", "last_tx_bits": 7, "expect": "0A", "expect_bits": 4, "on_mismatch": "stop"}
]
  • expect (hex): Expected response data for matching (case-insensitive).
  • expect_bits: Number of valid bits in the last byte (1-8). Only the lower N bits of the last byte are compared; upper bits are treated as 0. Useful for 4-bit ACK/NAK responses.
  • 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")
active()
transceive(data="6007", last_tx_bits=7, tx_crc=false, rx_crc=false)
reqa()
wupa()
halt()
field_off()
trace_get()
trace_clear()
disconnect()

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.2.1.tar.gz (5.3 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.2.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.1.tar.gz
  • Upload date:
  • Size: 5.3 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.2.1.tar.gz
Algorithm Hash digest
SHA256 be1e1f41039d640e0622d2692be0312422272b3d98c4083ffd1dc8e25d6f239e
MD5 a5e930a5697de8c343ce361bbc866c68
BLAKE2b-256 e912dc3d19951edc288451324485aadec49867d65c666efaf88fec476e6a5b36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d12126682249db52ea0cd3407e73dd5118c3dd99312a19f1514e7501bf55f3d
MD5 c1858ee8d670155187808f0a84f4ed04
BLAKE2b-256 35ac65d5451b31f15741ec1ab1f5dbd54e5161a08b3aacdee1664b56315caf54

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page