ftc-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2026 Jack Lau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,224 @@
1
+ # ftc-mcp
2
+
3
+ MCP server that gives AI coding assistants deep knowledge of the FTC Robot Controller ecosystem. Enables teams to "vibe code" their robots through natural language while producing correct, optimized, competition-ready Java code.
4
+
5
+ **The problem:** AI assistants hallucinate wrong Pedro Pathing APIs (training data is outdated), don't know the `@Config` + `public static` dashboard pattern, use wrong import paths, and can't see your project structure.
6
+
7
+ **The fix:** This MCP server injects 9,500+ lines of verified FTC documentation, API references, and working code examples directly into your AI assistant's context.
8
+
9
+ ## One-Click Install
10
+
11
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=ftc&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImZ0Yy1tY3AiXX0%3D)
12
+
13
+ ### Claude Code
14
+ ```bash
15
+ claude mcp add ftc -- npx ftc-mcp
16
+ ```
17
+
18
+ ### Cursor (Manual)
19
+
20
+ > Or use the one-click button above.
21
+
22
+ Add to `~/.cursor/mcp.json`:
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "ftc": {
27
+ "command": "npx",
28
+ "args": ["-y", "ftc-mcp"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### VS Code (Copilot)
35
+
36
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP_Server-007ACC?logo=visual-studio-code&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22ftc%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22ftc-mcp%22%5D%7D)
37
+
38
+ Or add to `.vscode/mcp.json`:
39
+ ```json
40
+ {
41
+ "servers": {
42
+ "ftc": {
43
+ "command": "npx",
44
+ "args": ["-y", "ftc-mcp"]
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### Windsurf
51
+ Add to your Windsurf MCP config:
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "ftc": {
56
+ "command": "npx",
57
+ "args": ["-y", "ftc-mcp"]
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Any MCP Client (`.mcp.json`)
64
+ Drop this file in your project root:
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "ftc": {
69
+ "command": "npx",
70
+ "args": ["-y", "ftc-mcp"]
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### From Source
77
+ ```bash
78
+ git clone https://github.com/jackulau/ftcMCP.git
79
+ cd ftcMCP
80
+ npm install
81
+ npm run build
82
+
83
+ # Then add to your AI client:
84
+ claude mcp add ftc -- node /path/to/ftcMCP/build/index.js
85
+ ```
86
+
87
+ ## What It Provides
88
+
89
+ ### 49 Resources (Documentation)
90
+
91
+ Contextual docs the AI pulls in when writing FTC code:
92
+
93
+ | Category | Resources | Coverage |
94
+ |----------|-----------|----------|
95
+ | **Pedro Pathing 2.0** | 6 | Complete API (Follower, PathBuilder, PathChain, BezierLine/Curve), Constants builder pattern, coordinate system [0,144], auto FSM structure, TeleOp drive, callbacks |
96
+ | **FTC Dashboard** | 6 | `@Config` + `public static` pattern, copy semantics pitfall, MultipleTelemetry, TelemetryPacket, Canvas field overlay API, camera streaming, setup |
97
+ | **Panels (by Lazar)** | 8 | Overview & comparison with FTC Dashboard, setup & Gradle config, `@Configurable` live tuning, `PanelsTelemetry`, `PanelsField` canvas drawing, Limelight proxy, plugin architecture, gamepad support |
98
+ | **Gradle** | 5 | Project file structure, adding libraries step-by-step, exact Maven coordinates for every library, common issues (compileSdk 34 for Pedro), build process |
99
+ | **Hardware** | 17 | DcMotor/DcMotorEx full API, RunModes, motor specs (every goBILDA/REV CPR), servos, IMU, distance/color/touch sensors, encoders (port 0+3 vs 1+2), GoBilda Pinpoint, SparkFun OTOS, REV Hub internals, bulk reads, CachingHardware, custom wrapper patterns, VisionPortal + Limelight |
100
+ | **Core SDK** | 5 | OpMode lifecycle (iterative vs linear), hardwareMap patterns, gamepad API, best practices |
101
+ | **Road Runner** | 1 | Actions API, TrajectoryActionBuilder |
102
+ | **FTCLib** | 1 | Command-based framework, GamepadEx, triggers |
103
+
104
+ ### 6 Tools
105
+
106
+ | Tool | What It Does |
107
+ |------|-------------|
108
+ | `scan_ftc_project` | Reads your TeamCode directory -- detects SDK version, installed libraries, existing OpModes, hardware config, Pedro Constants. Call at the start of every session. |
109
+ | `scan_hardware_config` | Parses all `hardwareMap.get()` calls to extract every hardware device name and type in your project. |
110
+ | `search_ftc_docs` | Full-text search across the entire knowledge base. Filter by category: `pedro`, `dashboard`, `gradle`, `hardware`, `sdk`, etc. |
111
+ | `get_ftc_example` | Returns a complete, compilable Java file for any of 10 topics (see below). |
112
+ | `get_hardware_reference` | Deep API reference for any device: `DcMotorEx`, `Pinpoint`, `OTOS`, `bulk-reads`, `caching-hardware`, etc. |
113
+ | `validate_ftc_code` | Checks code for common FTC mistakes: missing `follower.update()`, `@Config` with `final`, Thread.sleep in iterative OpMode, wrong Pedro v1 imports, copy semantics bugs. |
114
+
115
+ ### 10 Complete Code Examples
116
+
117
+ Every example is a full, compilable Java file with package declaration, all imports, and working code:
118
+
119
+ | Topic | Description |
120
+ |-------|-------------|
121
+ | `pedro-auto` | Pedro Pathing autonomous with FSM state machine, path callbacks, @Config tunable poses, field overlay |
122
+ | `pedro-teleop` | Pedro TeleOp with `setTeleOpDrive()`, slow mode, bulk reads, loop timer |
123
+ | `pedro-constants` | Complete Constants.java with FollowerConstants, MecanumConstants, PinpointConstants builders |
124
+ | `dashboard-config` | @Config demonstration with correct/wrong copy semantics examples |
125
+ | `bulk-reads` | Optimized OpMode with LynxModule MANUAL + CachingHardware |
126
+ | `subsystem` | Hardware subsystem class with @Config positions, state methods |
127
+ | `pid-tuning` | Live PID tuning with dashboard-graphed error/output |
128
+ | `vision-pipeline` | VisionPortal + AprilTag processor with dashboard camera stream |
129
+ | `custom-pid-drive` | Encoder-based autonomous with IMU heading PID (no pathing library) |
130
+ | `field-centric-drive` | Field-centric mecanum TeleOp using IMU |
131
+
132
+ ### 8 Workflow Prompts
133
+
134
+ Structured instructions that guide the AI through complex FTC tasks:
135
+
136
+ | Prompt | Description |
137
+ |--------|-------------|
138
+ | `setup-ftc-project` | Guided project init: choose pathing lib, configure Gradle, add dashboard |
139
+ | `create-autonomous` | Full auto creation: poses, paths, FSM, callbacks, dashboard telemetry |
140
+ | `create-teleop` | TeleOp: drive type, subsystems, gamepad bindings, slow mode |
141
+ | `create-subsystem` | Hardware subsystem with @Config tuning, state methods |
142
+ | `tune-pid` | PID tuning with dashboard live graphing |
143
+ | `optimize-performance` | Bulk reads, CachingHardware, loop timer, I2C reduction |
144
+ | `add-dashboard-tuning` | Add @Config live-tunable variables to existing code |
145
+ | `setup-gradle` | Configure Gradle deps for any combination of FTC libraries |
146
+
147
+ ## Supported Libraries
148
+
149
+ | Library | Version | Knowledge Depth |
150
+ |---------|---------|-----------------|
151
+ | [FTC SDK](https://github.com/FIRST-Tech-Challenge/FtcRobotController) | 11.1.0 | Full hardware API, OpMode lifecycle, gamepad, telemetry |
152
+ | [Pedro Pathing](https://pedropathing.com/) | 2.0.6 | Complete v2.0 API with builder patterns (NOT the outdated v1.x) |
153
+ | [FTC Dashboard](https://github.com/acmerobotics/ftc-dashboard) | 0.5.1 | @Config, MultipleTelemetry, Canvas, camera streaming |
154
+ | [Panels](https://panels.bylazar.com) | 1.0.12 | @Configurable, PanelsTelemetry, PanelsField, Limelight proxy, plugin architecture, gamepads, capture/replay |
155
+ | [Road Runner](https://rr.brott.dev/) | 1.0.x | Actions API, TrajectoryActionBuilder |
156
+ | [CachingHardware](https://github.com/Dairy-Foundation/CachingHardware) | 1.0.0 | Write caching algorithm, drop-in wrappers |
157
+ | [FTCLib](https://docs.ftclib.org/) | 2.1.1 | Command-based framework, GamepadEx |
158
+
159
+ ## Supported Hardware
160
+
161
+ Full API documentation and initialization patterns for:
162
+
163
+ - **Motors:** DcMotor, DcMotorEx, all RunModes, PIDF coefficients, every goBILDA/REV/NeveRest motor with exact CPR
164
+ - **Servos:** Servo, ServoImplEx (PWM range), CRServo, power pairing rules
165
+ - **Sensors:** REV IMU, Color Sensor V3, 2m Distance Sensor, Touch Sensor, Through Bore Encoder
166
+ - **Localizers:** goBILDA Pinpoint (full driver API, offsets, status enum), SparkFun OTOS (scalars, calibration)
167
+ - **Vision:** VisionPortal, AprilTagProcessor, Limelight 3A
168
+ - **REV Hub:** LynxModule bulk reads (OFF/AUTO/MANUAL), I2C timing, encoder port hardware vs software decoding
169
+
170
+ ## Example Vibe Coding Sessions
171
+
172
+ **"Set up my project with Pedro Pathing and Dashboard"**
173
+ > AI calls `scan_ftc_project` -> reads `ftc://gradle/all-library-coords` -> edits `build.dependencies.gradle` with exact repos and versions -> changes `compileSdk` to 34 -> creates Constants.java with builder pattern
174
+
175
+ **"Create an autonomous that scores 3 samples"**
176
+ > AI reads `ftc://pedro/api-reference` + `ftc://pedro/auto-structure` -> generates complete OpMode with @Config tunable poses, FSM state machine, path callbacks, MultipleTelemetry, field overlay
177
+
178
+ **"My loop times are slow"**
179
+ > AI reads `ftc://hardware/bulk-reads` + `ftc://hardware/caching-hardware` -> adds LynxModule MANUAL + CachingDcMotorEx + loop timer telemetry
180
+
181
+ **"Add a dashboard variable so I can tune arm position"**
182
+ > AI reads `ftc://dashboard/config-pattern` -> adds `@Config` class with `public static double ARM_POSITION = 0.5;` -> warns about reading it fresh each loop (copy semantics)
183
+
184
+ ## Project Structure
185
+
186
+ ```
187
+ ftc-mcp/
188
+ ├── src/
189
+ │ ├── index.ts # Entry point (stdio transport)
190
+ │ ├── server.ts # McpServer setup
191
+ │ ├── knowledge/
192
+ │ │ ├── pedro.ts # Pedro Pathing 2.0 (1,550 lines)
193
+ │ │ ├── hardware.ts # Full hardware stack (1,479 lines)
194
+ │ │ ├── examples.ts # 10 complete code examples (1,396 lines)
195
+ │ │ ├── ftc-sdk.ts # SDK patterns (881 lines)
196
+ │ │ ├── dashboard.ts # FTC Dashboard (845 lines)
197
+ │ │ ├── panels.ts # Panels by Lazar — all-in-one dashboard
198
+ │ │ ├── ftclib.ts # FTCLib framework (636 lines)
199
+ │ │ ├── gradle.ts # Gradle build system (584 lines)
200
+ │ │ └── roadrunner.ts # Road Runner (478 lines)
201
+ │ ├── resources/registry.ts # 41 resource URI registrations
202
+ │ ├── tools/registry.ts # 6 tool implementations
203
+ │ └── prompts/registry.ts # 8 workflow prompts
204
+ ├── package.json
205
+ └── tsconfig.json
206
+ ```
207
+
208
+ ## Development
209
+
210
+ ```bash
211
+ npm install
212
+ npm run build # Compile TypeScript
213
+ npm run dev # Watch mode
214
+ npm start # Run the server
215
+ ```
216
+
217
+ ## Requirements
218
+
219
+ - Node.js >= 18
220
+ - An MCP-compatible AI client (Claude Code, Cursor, VS Code Copilot, etc.)
221
+
222
+ ## License
223
+
224
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/build/index.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const server_js_1 = require("./server.js");
5
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
6
+ async function main() {
7
+ const server = (0, server_js_1.createServer)();
8
+ const transport = new stdio_js_1.StdioServerTransport();
9
+ await server.connect(transport);
10
+ console.error("FTC MCP Server running on stdio");
11
+ }
12
+ main().catch((error) => {
13
+ console.error("Fatal error:", error);
14
+ process.exit(1);
15
+ });
@@ -0,0 +1,8 @@
1
+ export declare const DASHBOARD_KNOWLEDGE: {
2
+ configPattern: string;
3
+ telemetry: string;
4
+ canvas: string;
5
+ camera: string;
6
+ setup: string;
7
+ api: string;
8
+ };