mcp

v2.0.0
@ntcore-ts/mcp Checked 16 hours ago Published 10 days ago

Model Context Protocol server for NetworkTables, built on @ntcore-ts/client

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

nt_guide NetworkTables MCP guide

Call this first if unfamiliar. Explains workflow, tool choice (nt_get vs nt_get_decoded vs nt_subscribe), write-gate status, and safety rules. Read-only.

nt_connect Connect to NetworkTables

Connect to an NT4 server. Provide either team (mDNS/team IP) OR host (e.g. localhost for sim). Default port 5810. Starts topic inventory. Prefer this before list/get/subscribe.

ParameterTypeDescription
hoststringHostname or IP (e.g. localhost, 127.0.0.1). Mutually exclusive with team
platformstringAddress resolution when using team (default roborio)
portintegerNT4 port (default 5810)
teamintegerFRC team number (mutually exclusive with host)
timeout_msintegerConnection wait timeout in ms (default 10000)

nt_disconnect Disconnect from NetworkTables

Close the NT connection and clear the topic inventory cache.

nt_connection_info Connection info

Return connected/connecting flags, endpoint, RTT, and write-gate status. Read-only.

nt_list_topics List NetworkTables topics

List announced topics from the inventory cache (name, type, properties). Filter with prefix (e.g. /MyTable/). Call nt_connect first. Prefer over guessing topic names. Read-only.

ParameterTypeDescription
limitintegerMax topics to return (default 500)
prefixstringOnly topics starting with this prefix

nt_get Get topic value

Read one topic value. Best for scalars/arrays/json. For struct:/proto: topics prefer nt_get_decoded. Topic must be known via nt_list_topics. Read-only.

ParameterTypeDescription
topic *stringFull topic name, e.g. /MyTable/Gyro

nt_get_multiple Get multiple topic values

Batch nt_get for up to 50 topics. Read-only.

ParameterTypeDescription
topics *arrayTopic names to read

nt_get_decoded Get decoded struct/protobuf topic

Decode a struct: or proto: topic into a JSON object using @ntcore-ts/client. Prefer this over nt_get for Pose2d and other structured types. Optional type_hint like struct:Pose2d. Read-only.

ParameterTypeDescription
topic *stringFull topic name
type_hintstringOverride wire type, e.g. struct:Pose2d or proto:Pose2d

nt_list_struct_types List struct types

List built-in WPILib geometry struct types and any discovered from /.schema/struct:* or live topics. Read-only.

nt_subscribe Timed subscribe / sample

Sample topic updates under prefixes for duration_seconds. Use format=summary for min/max/mean/last/rate (preferred evidence). format=samples returns capped point lists. Prefer over repeated nt_get for dynamics. Read-only.

ParameterTypeDescription
prefixes *arrayTopic prefixes to sample (e.g. ["/MyTable/"])
change_epsilonnumberEpsilon for change_only numerics (default 1e-9)
change_onlybooleanSkip numeric changes at or below change_epsilon
duration_secondsnumberHow long to sample (default 2, max 30)
formatstringsummary (default) or samples
sample_interval_msnumberMin ms between stored samples per topic (0 = every change)

nt_set_write_mode Enable or disable NT writes

Session write gate. Enabling REQUIRES confirm=true. Also enabled when NT_ALLOW_WRITES=1 at process start. Does not bypass path allowlist. Destructive.

ParameterTypeDescription
enabled *booleantrue to allow nt_set / nt_set_multiple
confirmbooleanMust be true when enabling writes

nt_set Set / publish a topic value

Publish a value to one topic. Fails if write gate is off, topic is outside NT_WRITE_ALLOWLIST, or types mismatch. Prefer expected_type when known. Destructive — can affect robot behavior if code is listening. Cannot enable/disable via FMS/DS.

ParameterTypeDescription
topic *stringFull topic name
value *Value to publish (JSON-compatible for scalars/structs)
expected_typestringNT type string, e.g. double or struct:Pose2d

nt_set_multiple Set / publish multiple topics

Batch nt_set. Same write-gate and allowlist rules. Destructive.

ParameterTypeDescription
updates *array