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
find 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
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
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

Data ops (transceive, find, reqa, wupa, select, anticoll) 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")
find()
transceive(data="6007", last_tx_bits=7, tx_crc=false, rx_crc=false)
reqa()
wupa()
select(cl_level=1, uid="04AABBCCDD77")
anticoll(cl_level=1)
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.0.tar.gz (6.1 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.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.0.tar.gz
  • Upload date:
  • Size: 6.1 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.0.tar.gz
Algorithm Hash digest
SHA256 fa474c855b96e1fec90cddb7d68c26e6b456ab15b12469a19d90eed57c498a5b
MD5 1f06d7e9e3bb0eaf7ed2fcd4c46c8412
BLAKE2b-256 9addafc3aa92b8e63e4da6e0aefc24621c875d8d8960afb013a259a75342be7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carrot_mcp_nfc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6fbe463aa7bad01840c4b3ce7f174c809fc5fa119a0c02a9c76fe2af03f8195
MD5 f32a7c36f0bdccc68a21f9bed37767dd
BLAKE2b-256 a7f2a0a2aa176db67a1e6a6554d5b94cef038fe0aae811c542af5e77fb9382f1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

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