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.2.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.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for carrot_mcp_nfc-0.2.2.tar.gz
Algorithm Hash digest
SHA256 37524f14980a32d0c7a645ac7c275a81e643994827b0d328723df89de42e7289
MD5 7397ffe11899622485026601d3002e52
BLAKE2b-256 2120d5c09005c9d35acbbc8120fdd39b074c77b4dcde6e4c57860602dfbd59c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for carrot_mcp_nfc-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df2e77b703ef60058c8166af6df23a6ce07970e703592ca7d71720ec84ef85e6
MD5 e7f0126e782a2ba6683418c6f97ce0c0
BLAKE2b-256 655ceeba04ec5e71e4ca1dd8b8924ddb53052973b353ef0c8a80bce833bd1fe9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 files

0.2.1

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