Skip to main content
Glama
FTC Toolchain

FTC Toolchain

by Sanjit-K

FTC Toolchain

An MCP server that lets AI agents (Codex, Claude Code, Claude Desktop, or any MCP client) work on FTC robots: search official SDK samples and Pedro Pathing docs, scaffold OpModes, build TeamCode with Gradle, deploy to a REV Control Hub over WiFi, and read robot logs — the full code → robot → debug loop.

Install

Requirements: Node 18+, git, adb (Android platform-tools), and the Android SDK + JDK 17+ if you want to build (an Android Studio install provides both).

Codex

# Register the server (available in every project)
codex mcp add ftc-toolchain -- npx -y ftc-toolchain

# Fetch the reference material the knowledge tools read (one time)
npx ftc-toolchain setup

Start a new Codex task and ask it to “list the FTC sample OpModes” to confirm the server is live.

Claude Code

# Register the server (available in every project)
claude mcp add ftc-toolchain -- npx -y ftc-toolchain

# Fetch the reference material the knowledge tools read (one time)
npx ftc-toolchain setup

Start a new Claude session and ask it to “list the FTC sample OpModes” to confirm it is live.

Claude Desktop / other MCP clients

{
  "mcpServers": {
    "ftc-toolchain": {
      "command": "npx",
      "args": ["-y", "ftc-toolchain"],
      "env": { "FTC_TOOLCHAIN_PROJECT_DIR": "/path/to/your/FtcRobotController" }
    }
  }
}

Then run npx ftc-toolchain setup once so the knowledge tools have their reference data.

From source (development)

git clone https://github.com/Sanjit-K/ftc-toolchain && cd ftc-toolchain
npm install && npm run build
npm run setup      # clones FTC samples + Pedro docs into refs/

Opening this directory in Claude Code picks up .mcp.json automatically.

Reference material: the knowledge tools (list_samples, search_docs, …) read the official FtcRobotController samples and Pedro Pathing docs. ftc-toolchain setup clones them into ~/.ftc-toolchain/refs (override with FTC_TOOLCHAIN_REFS). The project/robot tools work without this step.

Related MCP server: ftc-mcp

Choose how to deploy

Use deploy_robot as the normal high-level deployment tool. It supports two connection methods.

Option 1: direct USB-C

Use this when the programming computer is near the robot. Connect the Control Hub or Robot Controller phone by USB, approve any device prompt, and verify it appears in adb_devices. Then ask:

deploy_robot(connection: "usb")

ftc-toolchain builds a fresh APK, installs it on the attached ADB device, and restarts Robot Controller. If more than one Android device is attached, pass the serial shown by adb_devices. Internet stays connected throughout the deployment.

Option 2: automatic Wi-Fi switching

No phone tether or extra router is required. ftc-toolchain can build while the computer is on internet Wi-Fi, return a job ID to Codex or Claude, then run the network-sensitive part as a local background job:

  1. Switch to the saved Control Hub Wi-Fi.

  2. Connect to 192.168.43.1:5555 with ADB.

  3. Install the freshly built APK and restart Robot Controller.

  4. Restore the original internet Wi-Fi even when deployment fails.

  5. Let the AI read the saved result after it reconnects.

Before the first automatic deployment, manually join the Control Hub once so macOS or Windows saves its SSID and password. Return to internet Wi-Fi, then ask the AI to call:

deploy_robot(connection: "wifi-switch", robotSsid: "YOUR-CONTROL-HUB-SSID")

The tool builds before disconnecting and waits 10 seconds before changing networks, giving the MCP response time to reach the AI. The AI connection may pause for roughly 20–60 seconds. Once it returns, call wifi_deploy_status with the returned job ID—or omit the ID to read the latest job.

Use dryRun: true to preview every path and network involved without building, switching Wi-Fi, or deploying. Both macOS and Windows are supported. On Windows, the Control Hub must appear as a saved netsh wlan profile. On macOS, it must be a remembered Wi-Fi network available to networksetup.

This is for development and pits only. Disconnect programming computers before a match and follow the current FTC competition manual.

Tools

Start a new session with inspect_project. It reports which FTC project is selected, Git changes, OpModes, documented subsystems, Pedro readiness, hardware-name collisions, the latest APK, reference data, and Android SDK setup—plus the next concrete actions.

Knowledge

Tool

What it does

list_samples

List the 66 official FTC sample OpModes (drive, sensors, AprilTag vision, ...)

get_sample

Full Java source of a sample

search_docs

Keyword search across Pedro Pathing docs + SDK samples

get_doc

Fetch a Pedro Pathing doc page as markdown

reference_status

Show local reference counts, commits, branches, dates, and cache location

update_references

Fast-forward clean FTC SDK and Pedro documentation checkouts

Project

Tool

What it does

inspect_project

One-shot readiness check for project path, SDK, Git, OpModes, subsystem docs, Pedro, hardware names, APK, references, and Android tooling

check_project_hygiene

Read-only pre-competition audit for duplicate names, orphaned files, broken docs, stale builds, TODOs, and Git state

create_project

Clone a fresh FtcRobotController SDK project

list_opmodes

List @TeleOp/@Autonomous classes in TeamCode

list_generated_files

Inventory files scaffolded by ftc-toolchain, grouped by artifact type

list_backups

Browse project-scoped recovery snapshots made before overwrites

restore_backup

Preview or restore selected backup files; confirmed restores back up current versions first

create_opmode

Scaffold an OpMode: linear-teleop, mecanum-teleop, linear-auto, pedro-auto, pedro-teleop

install_pedro

Add Pedro Pathing to a project (Gradle deps, compileSdk 34, Constants.java scaffold)

Subsystems — the recommended way to structure robot code: one plain class per mechanism, with a living markdown knowledge base the LLM reads and updates.

All code generators support dryRun: true. This performs the same validation and returns the exact target paths and generated source without touching the filesystem. Use it to review a proposed OpMode, subsystem, calculation helper, or TeleOp before creation or overwrite.

When overwrite: true replaces an existing generated target, ftc-toolchain first copies the old version to ~/.ftc-toolchain/backups (or $FTC_TOOLCHAIN_HOME/backups). The backup stays outside the robot repository. list_generated_files inventories marked scaffolds, but the marker only records origin—team edits are expected and must be preserved.

Use list_backups to find a snapshot and restore_backup to inspect it. Restore is preview-only unless confirm: true; before a confirmed rollback, the files currently in the project are backed up again, so recovery is reversible.

Tool

What it does

create_subsystem

Scaffold a subsystem class (hardcoded config-name constants, action methods, stop()) with optional injected subsystem dependencies and dashboard-tunable constants, + a bench-test TeleOp + a markdown doc

document_subsystem

Write/update a subsystem's knowledge-base doc (functions, tuning, config names, quirks)

list_subsystems / get_subsystem

Read the robot's architecture from docs/

create_teleop

Generate a TeleOp plus a separate <Name>Controls.java holding only the button bindings, wiring drive + subsystem actions + automations

create_calculation

Scaffold a stateless helper class (e.g. live trajectory math)

hardware_manifest

Aggregate every config name across subsystems and flag duplicates/typos vs. the Driver Station config

validate_hardware

Pre-flight config check for incompatible device types, shared names, and unresolved constants

Robot

Tool

What it does

deploy_robot

Preferred deployment tool: choose direct USB for an attached ADB device or automatic Wi-Fi switching for a saved Control Hub network

wifi_deploy_start

Lower-level Wi-Fi path: build while online, then launch a local macOS/Windows job that switches networks, deploys, and restores the original Wi-Fi

wifi_deploy_status

Read the latest or selected background deployment state and its complete switch/deploy/recovery timeline after internet reconnects

adb_devices / adb_connect

Find / connect to the robot (Control Hub default: 192.168.43.1:5555)

robot_status

Read device identity, Android/RC app versions, battery service, and storage health

restart_robot_controller

Restart the RC app without rebuilding or reinstalling code

build

Gradle build with optional clean/timeout/stacktrace controls, contextual errors, and verified APK metadata

deploy

Install the APK and restart the Robot Controller app

build_and_deploy

Build first (optionally clean), verify the APK, then install only that successful artifact

clear_robot_logs

Clear logcat before reproducing a problem for a clean debugging capture

robot_logs

Filtered logcat from the robot (crashes, OpMode exceptions, SDK events)

Typical agent session

  1. search_docs("mecanum field centric") / get_sample(...) → find reference code

  2. create_opmode(className: "CompTeleOp", template: "mecanum-teleop")

  3. deploy_robot(connection: "usb") nearby, or deploy_robot(connection: "wifi-switch", robotSsid: "YOUR-CONTROL-HUB-SSID") wirelessly

  4. Fix any compiler errors returned before a background Wi-Fi switch begins

  5. Driver tests the OpMode → reconnect with adb_connect when needed, then use robot_logs(filter: "CompTeleOp")

Subsystem workflow

The intended way to build a robot: describe each mechanism to the LLM and let it scaffold subsystems + maintain their docs.

  1. "We have a rolling intake — one motor, spins in, spits out." → create_subsystem(name: "RollingIntake", group: "intake", motors: [{name: "intakeMotor", config: "intake"}], methods: ["spinIn", "spitOut"]) → writes RollingIntake.java, TestRollingIntake.java (bench test), and docs/subsystems/RollingIntake.md.

  2. Fill in the method bodies (the LLM can, using get_sample/search_docs for reference).

  3. document_subsystem to record tuning values, sensor thresholds, and quirks as you dial them in.

  4. hardware_manifest before a competition to confirm every config name in code matches the Driver Station configuration — and that two subsystems aren't fighting over one name.

  5. A future session runs list_subsystems / get_subsystem and instantly knows the robot.

Sub-subsystems live under a shared group, e.g. group: "shooting.turret" → teamcode/shooting/turret/. Calculation-heavy logic goes in create_calculation helpers so it stays out of the subsystem and OpMode files.

Subsystem composition & tuning. A subsystem can depend on other subsystems — dependencies: [{type: "ColorSensor"}, {type: "IntakeFlap"}] injects them into the constructor (config names stay hardcoded, so the constructor only receives siblings). Declare constants (PID gains, servo positions, RPM setpoints) and the tunable ones become live-editable dashboard fields: the class is annotated @Configurable (Panels, from install_pedro) with public static fields, so you tune them while the robot runs. Pass dashboard: "ftcdashboard" for FTC Dashboard's @Config, or "none".

Building a TeleOp

Describe how driving should feel and what should be automated; create_teleop writes two files:

  • <Name>Controls.java — nothing but the bindings (intakeIn → driver.right_bumper). A driver can open this and remap buttons without reading any robot logic or touching an LLM.

  • <Name>.java — the TeleOp: constructs the subsystems, wires the drivetrain, applies each binding, and stubs out the automations you described.

"Mecanum drive, hold right bumper to intake / left bumper to outtake, operator Y toggles the shooter, left trigger is slow mode, and auto-sort balls by color." becomes one create_teleop call. Bindings are hold (while held), press (rising edge), or toggle. Competing actions on one mechanism (intake in vs. out) share an exclusiveGroup so they compile to a single if/else-if/else with one idle call — no fighting over the motor. Automations (multi-step or sensor-driven) come out as clearly-marked stub methods to fill in.

Configuration

Env var

Meaning

FTC_TOOLCHAIN_PROJECT_DIR

Default FTC SDK project used by project/robot tools

FTC_TOOLCHAIN_PROJECT_DIR

Default FtcRobotController project location

FTC_TOOLCHAIN_REFS

Location of the reference clones (default: ./refs)

FTC_TOOLCHAIN_HOME

Toolchain cache, backups, jobs, and workspace root (default: ~/.ftc-toolchain)

ADB_PATH

Explicit path to adb if not on PATH

Notes

  • Pedro Pathing constants must be tuned. install_pedro scaffolds Constants.java with placeholder values for a mecanum drivetrain + goBILDA Pinpoint localizer; run the tuning OpModes (see search_docs "tuning") before trusting any path.

  • The Control Hub's WiFi password and SSID are shown on the Driver Station under Program & Manage.

  • Deploying replaces the Robot Controller app's code but keeps robot configurations. If adb install reports a signature mismatch, one adb uninstall com.qualcomm.ftcrobotcontroller is needed (this clears configs).

Development

npm test            # build + MCP smoke test (no robot needed)
npx ftc-toolchain doctor [projectPath] # diagnose local project/tooling readiness
npx ftc-toolchain setup --update       # refresh cached FTC samples and Pedro docs
node scripts/test-build.mjs [projectPath]           # real Gradle build through the build tool
node scripts/test-pedro-build.mjs [projectPath]     # install_pedro + all templates + full build
node scripts/test-subsystem-build.mjs [projectPath] # scaffold intake/spindexer/turret subsystems + a full TeleOp + build

Website and docs

The open-source marketing site and documentation live in website/. It is a Next.js/vinext app with the landing page at / and quickstart documentation at /docs.

cd website
npm install
npm run dev

The website content brief is versioned in website.md.

Contributing and community

Contributions from FTC students, mentors, alumni, and developers are welcome. Read CONTRIBUTING.md before opening a pull request, use the repository's guided issue forms for bugs and proposals, and see SUPPORT.md for setup help. Robot-facing pull requests must follow the real robot test policy before merge; automated or mock-only testing is not sufficient.

Please follow the Code of Conduct. Report suspected vulnerabilities privately according to SECURITY.md, never in a public issue.

Available Tools

35 tools
adb_connectConnect to robot over WiFiA

Connect adb to a REV Control Hub or RC phone over WiFi. Default target is 192.168.43.1:5555 (the Control Hub when the laptop is joined to the robot's WiFi network).

Inputs: host, port.

adb_devicesList connected robot devicesA

List Android devices visible to adb (Control Hub / Robot Controller phone).

Inputs: no named parameters.

buildBuild robot codeA

Compile the TeamCode module with Gradle (assembleDebug). Returns the APK path on success, or the extracted compiler errors on failure. First build can take several minutes.

Inputs: clean, stacktrace, projectPath, timeoutSeconds.

build_and_deployBuild and deploy fresh robot codeA

Safest competition-day deployment path: build TeamCode first and only install the APK if that build succeeds, then restart the Robot Controller app. This prevents accidentally deploying a stale APK.

Inputs: clean, serial, stacktrace, projectPath, +1 more.

check_project_hygieneCheck FTC project hygieneA

Read-only pre-competition audit for duplicate Driver Station names, orphaned generated file pairs, broken subsystem-doc links, incompatible hardware types, stale or missing APKs, disabled OpModes, TODOs, and uncommitted Git changes.

Inputs: projectPath.

clear_robot_logsClear robot logsA

Clear the connected robot's logcat buffer before reproducing a crash or bad behavior. Call robot_logs afterward for a clean signal.

Inputs: serial.

create_calculationCreate a calculation helperA

Scaffold a stateless static-only helper class (e.g. live trajectory math) that any OpMode or subsystem can call. Keeps math out of subsystem/OpMode files.

Inputs: name (required), group, dryRun, overwrite, +2 more.

create_opmodeCreate OpMode from templateA

Scaffold a new Java OpMode in TeamCode. Templates:

  • linear-teleop: Minimal LinearOpMode TeleOp skeleton (hardware mapping left to you)

  • mecanum-teleop: Complete 4-motor mecanum/omni TeleOp with POV drive (based on BasicOmniOpMode). Hardware names: left_front_drive, left_back_drive, right_front_drive, right_back_drive

  • linear-auto: Minimal LinearOpMode Autonomous skeleton with elapsed-time guard

  • pedro-auto: Pedro Pathing autonomous using a finite state machine over PathChains. Requires install_pedro first; tune poses for your season

  • pedro-teleop: Pedro Pathing TeleOp: manual mecanum drive with on-demand automated path following and slow mode. Requires install_pedro first

Inputs: template (required), className (required), group, dryRun, +4 more.

create_projectCreate FTC SDK projectA

Clone a fresh FtcRobotController SDK project (the standard FTC season starting point) into the workspace. Skip this if the team already has a project — pass its path to the other tools instead.

Inputs: dest.

create_subsystemCreate a subsystemA

Scaffold a plain FTC subsystem class (constructor takes HardwareMap; hardware fields, config-name constants, action methods, and a safety stop()). Also writes a bench-test TeleOp and a markdown doc in docs/. This is the recommended way to structure robot code — one class per mechanism (intake, spindexer, turret...).

Inputs: name (required), group, dryRun, motors, +11 more.

create_teleopCreate a TeleOp with a separate bindings fileA

Generate a TeleOp OpMode PLUS a separate Controls.java that holds only the controller bindings, so a driver can remap buttons without touching robot logic or an LLM. Describe the drivetrain, which subsystems to use, button actions (hold/press/toggle → subsystem calls), an optional slow mode, and named automations (multi-step or sensor-driven behaviors, which are scaffolded as stub methods to fill in).

Inputs: className (required), drive, group, dryRun, +8 more.

deployDeploy code to robotA

Install the built TeamCode APK on the connected robot (adb install) and restart the Robot Controller app. Run build first, and adb_connect/adb_devices to make sure a device is attached.

Inputs: serial, projectPath.

deploy_robotDeploy by USB or automatic Wi-FiA

Preferred high-level deployment entry point. With connection usb, build TeamCode and install it on a Control Hub or Robot Controller already visible to adb over a physical USB cable. With connection wifi-switch, build while online, then queue the local saved-network switch, ADB install, Robot Controller restart, and original-Wi-Fi restoration workflow.

Inputs: connection (required), clean, dryRun, serial, +8 more.

document_subsystemDocument a subsystemA

Write or update the markdown knowledge-base doc for a subsystem (docs/subsystems/.md) and refresh the docs/ROBOT.md index. Use this to record what each function does, tuning values, config names, and quirks as the team describes them — so future sessions understand the robot without reading all the code.

Inputs: name (required), content (required), projectPath.

get_docGet Pedro Pathing doc pageA

Return a full Pedro Pathing documentation page as markdown, by id from search_docs (e.g. 'pathing/examples/auto').

Inputs: id (required).

get_sampleGet FTC sample OpMode sourceA

Return the full Java source of an official FTC sample OpMode by name (from list_samples).

Inputs: name (required).

get_subsystemGet subsystem docB

Return a subsystem's knowledge-base doc (hardware, config names, functions, tuning, quirks), optionally with its Java source.

Inputs: name (required), projectPath, includeSource.

hardware_manifestHardware config manifestA

Scan TeamCode for every robot-configuration name (from hardwareMap.get and subsystem constructors) and list them, flagging any name used in multiple files. Use to cross-check code against the Driver Station configuration and catch typos/collisions.

Inputs: projectPath.

inspect_projectInspect FTC project readinessA

Start here when entering a robot project or debugging setup. Summarizes the resolved project path, SDK, Git state, OpModes, subsystem docs, Pedro setup, hardware-name collisions, latest APK, reference library, and Android SDK, then gives next actions.

Inputs: projectPath.

install_pedroInstall Pedro PathingA

Install the Pedro Pathing library into an FTC SDK project: adds the Gradle maven repo + dependencies, raises compileSdk to 34, and scaffolds pedroPathing/Constants.java (mecanum + Pinpoint by default). The constants MUST be tuned afterwards — see search_docs 'tuning'.

Inputs: version, projectPath.

list_backupsList generated-file backupsA

List project-scoped recovery snapshots created automatically before ftc-toolchain overwrites files, including each backup ID and contained relative paths.

Inputs: projectPath.

list_generated_filesList ftc-toolchain scaffolded filesA

Inventory Java and robot-doc files marked as scaffolded by ftc-toolchain, grouped by kind. Markers identify origin only—team edits are expected and must be preserved.

Inputs: projectPath.

list_opmodesList team OpModesA

List all @TeleOp/@Autonomous OpModes in the project's TeamCode module.

Inputs: projectPath.

list_samplesList FTC sample OpModesA

List the official FtcRobotController sample OpModes (drive code, sensors, AprilTag vision, gamepad, telemetry...). Start here to find working reference code for any FTC hardware or SDK feature.

Inputs: category.

list_subsystemsList documented subsystemsA

List the robot's subsystems from the docs/ knowledge base. Start here to learn the robot's architecture.

Inputs: projectPath.

reference_statusCheck reference library statusA

Report local FTC sample and Pedro documentation counts, Git branches, commits, dates, and cache location without using the network.

Inputs: no named parameters.

restart_robot_controllerRestart Robot Controller appA

Force-stop and restart the Robot Controller app without rebuilding or reinstalling the APK. Useful when the Driver Station is stale or an OpMode left the app unhealthy.

Inputs: serial.

restore_backupPreview or restore a backupA

Preview restoration from an ftc-toolchain backup, optionally selecting relative file paths. No files change unless confirm is true; a confirmed restore backs up current versions first and never deletes files.

Inputs: backupId (required), files, confirm, projectPath.

robot_logsRead robot logsA

Dump recent logcat from the robot. Use after deploying or when an OpMode crashes/misbehaves. Useful filters: 'RobotCore' (SDK events), your OpMode class name, 'Exception'.

Inputs: lines, filter, serial, errorsOnly.

robot_statusInspect connected robot statusA

Read-only connected-device snapshot: selected adb serial, model, Android version, Robot Controller app version, battery service, and data storage. Requires an explicit serial when multiple devices are attached.

Inputs: serial.

search_docsSearch FTC + Pedro Pathing knowledgeA

Keyword search across the Pedro Pathing documentation and the official FTC sample OpModes. Use for questions about path following, tuning, localization, coordinates, and SDK features.

Inputs: query (required), limit.

update_referencesUpdate FTC and Pedro referencesA

Fast-forward the local official FTC SDK samples and Pedro docs checkouts. Refuses to touch a reference checkout with local changes.

Inputs: no named parameters.

validate_hardwareValidate hardware configuration namesA

Pre-flight check for robot configuration mistakes. Flags one Driver Station name requested as incompatible device types, cross-file sharing, and unresolved constants, then tells the team whether it is safe to continue.

Inputs: projectPath.

wifi_deploy_startBuild, switch Wi-Fi, and deployA

Build TeamCode while internet is available, start a local background job that switches macOS or Windows to a saved Control Hub Wi-Fi profile, connects ADB, installs the APK, restarts Robot Controller, and restores the original Wi-Fi even after failure. Returns before the network switch so the AI can receive the job ID.

Inputs: robotSsid (required), clean, dryRun, homeSsid, +7 more.

wifi_deploy_statusRead Wi-Fi deployment resultA

Read the latest or specified background Wi-Fi deployment job after the computer reconnects to internet. Reports queued, switching, deploying, returning, succeeded, or failed state plus the complete local build/deploy/recovery timeline.

Inputs: jobId.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 35 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, from ADB operations to project scaffolding, building, deployment, and documentation. Overlapping areas like deployment are handled by separate tools with specific workflows (e.g., build_and_deploy vs. wifi_deploy_start), avoiding ambiguity.

    Naming Consistency5/5

    All tool names consistently use snake_case with a verb_noun pattern (e.g., create_opmode, list_subsystems, deploy_robot). There are no mixed conventions or vague verbs, making the naming predictable and easy to navigate.

    Tool Count2/5

    35 tools is excessive for the typical MCP server scope, far exceeding the recommended 3-15 range. While many tools are specialized for FTC development, the count is high enough to overwhelm an agent, indicating poor scoping.

    Completeness4/5

    The tool surface covers the full FTC development lifecycle: setup, coding, building, deployment, debugging, and documentation. Minor gaps exist, such as lack of dedicated tools for sensor configuration or simulation, but core workflows are well-supported.

    Related MCP Connectors

    Related MCP Servers