webots-mcp-kit 0.8.0__tar.gz
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.
- webots_mcp_kit-0.8.0/LICENSE +21 -0
- webots_mcp_kit-0.8.0/PKG-INFO +244 -0
- webots_mcp_kit-0.8.0/README.md +212 -0
- webots_mcp_kit-0.8.0/pyproject.toml +63 -0
- webots_mcp_kit-0.8.0/setup.cfg +4 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/__init__.py +5 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/agent.py +175 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/benchmark.py +93 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/benchmarks.py +79 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/cli.py +143 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/client.py +35 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/controller_scaffold.py +33 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/controller_validation.py +234 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/daemon.py +603 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/diagnostics.py +56 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/doctor.py +78 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/environment.py +79 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/line-follower/controllers/line_follower_agent.py +88 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/line-follower/worlds/line_follower_benchmark.wbt +141 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/obstacle-avoidance/controllers/obstacle_avoidance_agent.py +80 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/obstacle-avoidance/worlds/obstacle_avoidance_benchmark.wbt +67 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/waypoint-nav/controllers/waypoint_nav_agent.py +69 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/examples/waypoint-nav/worlds/waypoint_nav_benchmark.wbt +37 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/launcher.py +218 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/mcp_server.py +134 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/models.py +101 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/protocol.py +32 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/runtime/__init__.py +1 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/runtime/supervisor_main.py +60 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/runtime_io.py +64 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/session_ops.py +36 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/session_store.py +155 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit/utils.py +22 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/PKG-INFO +244 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/SOURCES.txt +50 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/dependency_links.txt +1 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/entry_points.txt +2 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/requires.txt +6 -0
- webots_mcp_kit-0.8.0/src/webots_mcp_kit.egg-info/top_level.txt +1 -0
- webots_mcp_kit-0.8.0/tests/test_benchmark_report.py +33 -0
- webots_mcp_kit-0.8.0/tests/test_benchmarks_registry.py +15 -0
- webots_mcp_kit-0.8.0/tests/test_controller_scaffold.py +16 -0
- webots_mcp_kit-0.8.0/tests/test_controller_validation.py +80 -0
- webots_mcp_kit-0.8.0/tests/test_diagnostics.py +58 -0
- webots_mcp_kit-0.8.0/tests/test_launcher_timeout.py +18 -0
- webots_mcp_kit-0.8.0/tests/test_mcp_contracts.py +41 -0
- webots_mcp_kit-0.8.0/tests/test_packaged_examples.py +14 -0
- webots_mcp_kit-0.8.0/tests/test_protocol.py +11 -0
- webots_mcp_kit-0.8.0/tests/test_session_inspect.py +42 -0
- webots_mcp_kit-0.8.0/tests/test_session_store.py +33 -0
- webots_mcp_kit-0.8.0/tests/test_smoke_cli.py +86 -0
- webots_mcp_kit-0.8.0/tests/test_utils.py +11 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arda Karakaş
|
|
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.
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: webots-mcp-kit
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Windows-first Webots developer toolkit with CLI, MCP server, controller SDK, and bundled benchmarks.
|
|
5
|
+
Author: Arda Karakas
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/RdaKA12/webots-mcp-kit
|
|
8
|
+
Project-URL: Issues, https://github.com/RdaKA12/webots-mcp-kit/issues
|
|
9
|
+
Project-URL: Documentation, https://github.com/RdaKA12/webots-mcp-kit/tree/main/docs
|
|
10
|
+
Project-URL: Repository, https://github.com/RdaKA12/webots-mcp-kit
|
|
11
|
+
Project-URL: Changelog, https://github.com/RdaKA12/webots-mcp-kit/blob/main/CHANGELOG.md
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: mcp<2,>=1.12.4
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: twine>=6.1.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# webots-mcp-kit
|
|
34
|
+
|
|
35
|
+
`webots-mcp-kit` is a Windows-first developer toolkit for connecting LLM agents to Webots.
|
|
36
|
+
|
|
37
|
+
It combines:
|
|
38
|
+
|
|
39
|
+
- a pip-installable CLI
|
|
40
|
+
- an MCP server with Webots session tools
|
|
41
|
+
- a controller-side SDK for structured telemetry and manual overrides
|
|
42
|
+
- bundled example scenarios and benchmarks
|
|
43
|
+
|
|
44
|
+
The bundled line follower is not the product itself. It is the first reference example.
|
|
45
|
+
The toolkit is meant to be reusable across other Webots robots, controllers, and worlds.
|
|
46
|
+
|
|
47
|
+
## Current release
|
|
48
|
+
|
|
49
|
+
`v0.8.0`
|
|
50
|
+
|
|
51
|
+
Current focus:
|
|
52
|
+
|
|
53
|
+
- Windows-first local development
|
|
54
|
+
- Webots `R2025a`
|
|
55
|
+
- direct Webots integration without ROS2
|
|
56
|
+
- stable controller-side integration through `ControllerAgent`
|
|
57
|
+
- bundled scenarios plus registry-backed benchmark thresholds
|
|
58
|
+
- hosted-safe CI with separate self-hosted runtime smoke
|
|
59
|
+
- release pipeline for GitHub Release, TestPyPI, and PyPI
|
|
60
|
+
|
|
61
|
+
## Bundled scenarios
|
|
62
|
+
|
|
63
|
+
- `line-follower`
|
|
64
|
+
- camera-based line tracking
|
|
65
|
+
- example world: `examples/line-follower`
|
|
66
|
+
- `obstacle-avoidance`
|
|
67
|
+
- proximity-sensor obstacle avoidance
|
|
68
|
+
- example world: `examples/obstacle-avoidance`
|
|
69
|
+
- `waypoint-nav`
|
|
70
|
+
- fixed-waypoint navigation in an open arena
|
|
71
|
+
- example world: `examples/waypoint-nav`
|
|
72
|
+
|
|
73
|
+
## Install
|
|
74
|
+
|
|
75
|
+
Use an isolated virtual environment. The toolkit depends on `mcp`, which may pull shared web stack packages into your global Python install.
|
|
76
|
+
|
|
77
|
+
```powershell
|
|
78
|
+
python -m venv .venv
|
|
79
|
+
.venv\Scripts\Activate.ps1
|
|
80
|
+
pip install -e .[dev]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Planned package install path:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
pip install webots-mcp-kit
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Optional CI or slow-machine tuning:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
$env:WEBOTS_KIT_SESSION_START_TIMEOUT='90'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Quick start
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
webots-kit doctor
|
|
99
|
+
webots-kit benchmark list
|
|
100
|
+
webots-kit benchmark run line-follower --controller example --output .\report.json --duration-s 3
|
|
101
|
+
webots-kit benchmark report .\report.json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
For an interactive session:
|
|
105
|
+
|
|
106
|
+
```powershell
|
|
107
|
+
webots-kit session start --scenario line-follower --controller example --mode fast --render off
|
|
108
|
+
webots-kit session inspect --session <session-id>
|
|
109
|
+
webots-kit session logs --session <session-id>
|
|
110
|
+
webots-kit session stop --session <session-id>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For a custom controller scaffold:
|
|
114
|
+
|
|
115
|
+
```powershell
|
|
116
|
+
webots-kit controller scaffold .\controllers\my_agent.py --scenario line-follower
|
|
117
|
+
webots-kit controller validate .\controllers\my_agent.py --scenario line-follower --strict --json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
To expose the toolkit as an MCP server:
|
|
121
|
+
|
|
122
|
+
```powershell
|
|
123
|
+
webots-kit mcp serve
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## CLI surface
|
|
127
|
+
|
|
128
|
+
- `webots-kit doctor [--json]`
|
|
129
|
+
- `webots-kit session start --scenario <name> --world <path> --controller <path-or-id> [--robot-name <name>] [--robot-def <def>] [--mode fast|realtime|pause] [--render on|off]`
|
|
130
|
+
- `webots-kit session inspect --session <id>`
|
|
131
|
+
- `webots-kit session logs --session <id> [--name <file>] [--tail <n>]`
|
|
132
|
+
- `webots-kit session stop --session <id>`
|
|
133
|
+
- `webots-kit benchmark list`
|
|
134
|
+
- `webots-kit benchmark run <scenario> --controller <path-or-id> --output <report.json> [--duration-s <seconds>]`
|
|
135
|
+
- `webots-kit benchmark report <report.json>`
|
|
136
|
+
- `webots-kit controller validate <path> [--scenario <name>] [--strict] [--json]`
|
|
137
|
+
- `webots-kit controller scaffold <path> [--scenario <name>] [--force]`
|
|
138
|
+
- `webots-kit mcp serve`
|
|
139
|
+
|
|
140
|
+
## Controller integration
|
|
141
|
+
|
|
142
|
+
There are two supported usage paths:
|
|
143
|
+
|
|
144
|
+
- bundled example controllers under `examples/`
|
|
145
|
+
- user-supplied Python controllers that integrate with `ControllerAgent`
|
|
146
|
+
|
|
147
|
+
The public controller-side entrypoint is `ControllerAgent`.
|
|
148
|
+
The stable public contract is:
|
|
149
|
+
|
|
150
|
+
- `ControllerAgent.from_robot(...)`
|
|
151
|
+
- `begin_step()`
|
|
152
|
+
- `report_step(...)`
|
|
153
|
+
|
|
154
|
+
Minimal integration shape:
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
from controller import Robot
|
|
158
|
+
from webots_mcp_kit.agent import ControllerAgent
|
|
159
|
+
|
|
160
|
+
robot = Robot()
|
|
161
|
+
agent = ControllerAgent.from_robot(robot, default_camera="camera")
|
|
162
|
+
|
|
163
|
+
while robot.step(int(robot.getBasicTimeStep())) != -1:
|
|
164
|
+
override = agent.begin_step()
|
|
165
|
+
# apply your control logic, optionally overriding wheel commands
|
|
166
|
+
agent.report_step(
|
|
167
|
+
sensors={},
|
|
168
|
+
metrics={},
|
|
169
|
+
actuators={},
|
|
170
|
+
camera_frames=None,
|
|
171
|
+
)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Use `webots-kit controller validate <path>` to check whether a controller follows the expected integration pattern.
|
|
175
|
+
Use `webots-kit controller scaffold` when you want a working starter file based on a bundled scenario.
|
|
176
|
+
|
|
177
|
+
## MCP tools
|
|
178
|
+
|
|
179
|
+
- `webots_session_start`
|
|
180
|
+
- `webots_session_stop`
|
|
181
|
+
- `webots_list_robots`
|
|
182
|
+
- `webots_list_devices`
|
|
183
|
+
- `webots_get_state`
|
|
184
|
+
- `webots_get_sensors`
|
|
185
|
+
- `webots_capture_camera`
|
|
186
|
+
- `webots_set_motor_velocity`
|
|
187
|
+
- `webots_step`
|
|
188
|
+
- `webots_pause_resume`
|
|
189
|
+
- `webots_reset`
|
|
190
|
+
- `webots_run_benchmark`
|
|
191
|
+
|
|
192
|
+
Stable payload shapes:
|
|
193
|
+
|
|
194
|
+
- `webots_list_devices -> { robot, scenario, devices }`
|
|
195
|
+
- `webots_get_sensors -> { robot, scenario, state, sensors, metrics, actuators, meta }`
|
|
196
|
+
|
|
197
|
+
Reference docs:
|
|
198
|
+
|
|
199
|
+
- [MCP contracts](./docs/mcp-contracts.md)
|
|
200
|
+
- [Self-hosted runtime smoke](./docs/self-hosted-windows-runner.md)
|
|
201
|
+
- [Custom controller integration](./docs/custom-controller-integration.md)
|
|
202
|
+
- [Add a new scenario](./docs/new-scenario-guide.md)
|
|
203
|
+
- [Failed runtime smoke triage](./docs/failed-runtime-smoke-triage.md)
|
|
204
|
+
- [PyPI install and upgrade](./docs/pypi-install-and-upgrade.md)
|
|
205
|
+
- [Release checklist](./docs/release-checklist.md)
|
|
206
|
+
- [Runner maintenance](./docs/self-hosted-runner-maintenance.md)
|
|
207
|
+
- [Packaging verification](./docs/packaging-verification-checklist.md)
|
|
208
|
+
|
|
209
|
+
## Testing
|
|
210
|
+
|
|
211
|
+
Unit tests:
|
|
212
|
+
|
|
213
|
+
```powershell
|
|
214
|
+
python -m pytest -q
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Hosted-safe smoke tests:
|
|
218
|
+
|
|
219
|
+
```powershell
|
|
220
|
+
$env:WEBOTS_KIT_RUN_SMOKE='1'
|
|
221
|
+
python -m pytest -q -k mcp_tool_list_smoke
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Full runtime smoke tests with real Webots execution:
|
|
225
|
+
|
|
226
|
+
```powershell
|
|
227
|
+
$env:WEBOTS_KIT_RUN_RUNTIME_SMOKE='1'
|
|
228
|
+
python -m pytest -q -k "session_start_inspect_stop_smoke or benchmark_smoke"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The self-hosted GitHub workflow for runtime smoke expects a Windows runner labeled `webots`.
|
|
232
|
+
Packaging and release verification are handled by GitHub workflows:
|
|
233
|
+
|
|
234
|
+
- `Packaging CI`
|
|
235
|
+
- `Release`
|
|
236
|
+
|
|
237
|
+
## Troubleshooting
|
|
238
|
+
|
|
239
|
+
- If `doctor` fails, ensure `WEBOTS_HOME` is set or Webots is installed in `C:\Program Files\Webots`.
|
|
240
|
+
- If MCP or session startup closes immediately, inspect `session logs` for the session artifacts.
|
|
241
|
+
- If package installation changes global Python web dependencies, recreate a dedicated virtual environment and reinstall there.
|
|
242
|
+
- GitHub-hosted `windows-latest` runners are only used for unit tests, `doctor`, and MCP handshake smoke. Real Webots runtime smoke is exposed as a separate manual workflow for self-hosted Windows runners with Webots installed.
|
|
243
|
+
- `examples/` contains runnable demo assets; benchmark thresholds and pass/fail logic live in the benchmark registry inside the toolkit code.
|
|
244
|
+
- Wheel installs use bundled package-local scenario assets; source checkouts continue to use repo-local `examples/`.
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# webots-mcp-kit
|
|
2
|
+
|
|
3
|
+
`webots-mcp-kit` is a Windows-first developer toolkit for connecting LLM agents to Webots.
|
|
4
|
+
|
|
5
|
+
It combines:
|
|
6
|
+
|
|
7
|
+
- a pip-installable CLI
|
|
8
|
+
- an MCP server with Webots session tools
|
|
9
|
+
- a controller-side SDK for structured telemetry and manual overrides
|
|
10
|
+
- bundled example scenarios and benchmarks
|
|
11
|
+
|
|
12
|
+
The bundled line follower is not the product itself. It is the first reference example.
|
|
13
|
+
The toolkit is meant to be reusable across other Webots robots, controllers, and worlds.
|
|
14
|
+
|
|
15
|
+
## Current release
|
|
16
|
+
|
|
17
|
+
`v0.8.0`
|
|
18
|
+
|
|
19
|
+
Current focus:
|
|
20
|
+
|
|
21
|
+
- Windows-first local development
|
|
22
|
+
- Webots `R2025a`
|
|
23
|
+
- direct Webots integration without ROS2
|
|
24
|
+
- stable controller-side integration through `ControllerAgent`
|
|
25
|
+
- bundled scenarios plus registry-backed benchmark thresholds
|
|
26
|
+
- hosted-safe CI with separate self-hosted runtime smoke
|
|
27
|
+
- release pipeline for GitHub Release, TestPyPI, and PyPI
|
|
28
|
+
|
|
29
|
+
## Bundled scenarios
|
|
30
|
+
|
|
31
|
+
- `line-follower`
|
|
32
|
+
- camera-based line tracking
|
|
33
|
+
- example world: `examples/line-follower`
|
|
34
|
+
- `obstacle-avoidance`
|
|
35
|
+
- proximity-sensor obstacle avoidance
|
|
36
|
+
- example world: `examples/obstacle-avoidance`
|
|
37
|
+
- `waypoint-nav`
|
|
38
|
+
- fixed-waypoint navigation in an open arena
|
|
39
|
+
- example world: `examples/waypoint-nav`
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Use an isolated virtual environment. The toolkit depends on `mcp`, which may pull shared web stack packages into your global Python install.
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
python -m venv .venv
|
|
47
|
+
.venv\Scripts\Activate.ps1
|
|
48
|
+
pip install -e .[dev]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Planned package install path:
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
pip install webots-mcp-kit
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Optional CI or slow-machine tuning:
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
$env:WEBOTS_KIT_SESSION_START_TIMEOUT='90'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quick start
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
webots-kit doctor
|
|
67
|
+
webots-kit benchmark list
|
|
68
|
+
webots-kit benchmark run line-follower --controller example --output .\report.json --duration-s 3
|
|
69
|
+
webots-kit benchmark report .\report.json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For an interactive session:
|
|
73
|
+
|
|
74
|
+
```powershell
|
|
75
|
+
webots-kit session start --scenario line-follower --controller example --mode fast --render off
|
|
76
|
+
webots-kit session inspect --session <session-id>
|
|
77
|
+
webots-kit session logs --session <session-id>
|
|
78
|
+
webots-kit session stop --session <session-id>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For a custom controller scaffold:
|
|
82
|
+
|
|
83
|
+
```powershell
|
|
84
|
+
webots-kit controller scaffold .\controllers\my_agent.py --scenario line-follower
|
|
85
|
+
webots-kit controller validate .\controllers\my_agent.py --scenario line-follower --strict --json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
To expose the toolkit as an MCP server:
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
webots-kit mcp serve
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## CLI surface
|
|
95
|
+
|
|
96
|
+
- `webots-kit doctor [--json]`
|
|
97
|
+
- `webots-kit session start --scenario <name> --world <path> --controller <path-or-id> [--robot-name <name>] [--robot-def <def>] [--mode fast|realtime|pause] [--render on|off]`
|
|
98
|
+
- `webots-kit session inspect --session <id>`
|
|
99
|
+
- `webots-kit session logs --session <id> [--name <file>] [--tail <n>]`
|
|
100
|
+
- `webots-kit session stop --session <id>`
|
|
101
|
+
- `webots-kit benchmark list`
|
|
102
|
+
- `webots-kit benchmark run <scenario> --controller <path-or-id> --output <report.json> [--duration-s <seconds>]`
|
|
103
|
+
- `webots-kit benchmark report <report.json>`
|
|
104
|
+
- `webots-kit controller validate <path> [--scenario <name>] [--strict] [--json]`
|
|
105
|
+
- `webots-kit controller scaffold <path> [--scenario <name>] [--force]`
|
|
106
|
+
- `webots-kit mcp serve`
|
|
107
|
+
|
|
108
|
+
## Controller integration
|
|
109
|
+
|
|
110
|
+
There are two supported usage paths:
|
|
111
|
+
|
|
112
|
+
- bundled example controllers under `examples/`
|
|
113
|
+
- user-supplied Python controllers that integrate with `ControllerAgent`
|
|
114
|
+
|
|
115
|
+
The public controller-side entrypoint is `ControllerAgent`.
|
|
116
|
+
The stable public contract is:
|
|
117
|
+
|
|
118
|
+
- `ControllerAgent.from_robot(...)`
|
|
119
|
+
- `begin_step()`
|
|
120
|
+
- `report_step(...)`
|
|
121
|
+
|
|
122
|
+
Minimal integration shape:
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
from controller import Robot
|
|
126
|
+
from webots_mcp_kit.agent import ControllerAgent
|
|
127
|
+
|
|
128
|
+
robot = Robot()
|
|
129
|
+
agent = ControllerAgent.from_robot(robot, default_camera="camera")
|
|
130
|
+
|
|
131
|
+
while robot.step(int(robot.getBasicTimeStep())) != -1:
|
|
132
|
+
override = agent.begin_step()
|
|
133
|
+
# apply your control logic, optionally overriding wheel commands
|
|
134
|
+
agent.report_step(
|
|
135
|
+
sensors={},
|
|
136
|
+
metrics={},
|
|
137
|
+
actuators={},
|
|
138
|
+
camera_frames=None,
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `webots-kit controller validate <path>` to check whether a controller follows the expected integration pattern.
|
|
143
|
+
Use `webots-kit controller scaffold` when you want a working starter file based on a bundled scenario.
|
|
144
|
+
|
|
145
|
+
## MCP tools
|
|
146
|
+
|
|
147
|
+
- `webots_session_start`
|
|
148
|
+
- `webots_session_stop`
|
|
149
|
+
- `webots_list_robots`
|
|
150
|
+
- `webots_list_devices`
|
|
151
|
+
- `webots_get_state`
|
|
152
|
+
- `webots_get_sensors`
|
|
153
|
+
- `webots_capture_camera`
|
|
154
|
+
- `webots_set_motor_velocity`
|
|
155
|
+
- `webots_step`
|
|
156
|
+
- `webots_pause_resume`
|
|
157
|
+
- `webots_reset`
|
|
158
|
+
- `webots_run_benchmark`
|
|
159
|
+
|
|
160
|
+
Stable payload shapes:
|
|
161
|
+
|
|
162
|
+
- `webots_list_devices -> { robot, scenario, devices }`
|
|
163
|
+
- `webots_get_sensors -> { robot, scenario, state, sensors, metrics, actuators, meta }`
|
|
164
|
+
|
|
165
|
+
Reference docs:
|
|
166
|
+
|
|
167
|
+
- [MCP contracts](./docs/mcp-contracts.md)
|
|
168
|
+
- [Self-hosted runtime smoke](./docs/self-hosted-windows-runner.md)
|
|
169
|
+
- [Custom controller integration](./docs/custom-controller-integration.md)
|
|
170
|
+
- [Add a new scenario](./docs/new-scenario-guide.md)
|
|
171
|
+
- [Failed runtime smoke triage](./docs/failed-runtime-smoke-triage.md)
|
|
172
|
+
- [PyPI install and upgrade](./docs/pypi-install-and-upgrade.md)
|
|
173
|
+
- [Release checklist](./docs/release-checklist.md)
|
|
174
|
+
- [Runner maintenance](./docs/self-hosted-runner-maintenance.md)
|
|
175
|
+
- [Packaging verification](./docs/packaging-verification-checklist.md)
|
|
176
|
+
|
|
177
|
+
## Testing
|
|
178
|
+
|
|
179
|
+
Unit tests:
|
|
180
|
+
|
|
181
|
+
```powershell
|
|
182
|
+
python -m pytest -q
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Hosted-safe smoke tests:
|
|
186
|
+
|
|
187
|
+
```powershell
|
|
188
|
+
$env:WEBOTS_KIT_RUN_SMOKE='1'
|
|
189
|
+
python -m pytest -q -k mcp_tool_list_smoke
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Full runtime smoke tests with real Webots execution:
|
|
193
|
+
|
|
194
|
+
```powershell
|
|
195
|
+
$env:WEBOTS_KIT_RUN_RUNTIME_SMOKE='1'
|
|
196
|
+
python -m pytest -q -k "session_start_inspect_stop_smoke or benchmark_smoke"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
The self-hosted GitHub workflow for runtime smoke expects a Windows runner labeled `webots`.
|
|
200
|
+
Packaging and release verification are handled by GitHub workflows:
|
|
201
|
+
|
|
202
|
+
- `Packaging CI`
|
|
203
|
+
- `Release`
|
|
204
|
+
|
|
205
|
+
## Troubleshooting
|
|
206
|
+
|
|
207
|
+
- If `doctor` fails, ensure `WEBOTS_HOME` is set or Webots is installed in `C:\Program Files\Webots`.
|
|
208
|
+
- If MCP or session startup closes immediately, inspect `session logs` for the session artifacts.
|
|
209
|
+
- If package installation changes global Python web dependencies, recreate a dedicated virtual environment and reinstall there.
|
|
210
|
+
- GitHub-hosted `windows-latest` runners are only used for unit tests, `doctor`, and MCP handshake smoke. Real Webots runtime smoke is exposed as a separate manual workflow for self-hosted Windows runners with Webots installed.
|
|
211
|
+
- `examples/` contains runnable demo assets; benchmark thresholds and pass/fail logic live in the benchmark registry inside the toolkit code.
|
|
212
|
+
- Wheel installs use bundled package-local scenario assets; source checkouts continue to use repo-local `examples/`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "webots-mcp-kit"
|
|
7
|
+
version = "0.8.0"
|
|
8
|
+
description = "Windows-first Webots developer toolkit with CLI, MCP server, controller SDK, and bundled benchmarks."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Arda Karakas" }
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: Microsoft :: Windows",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Scientific/Engineering",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"mcp>=1.12.4,<2",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://github.com/RdaKA12/webots-mcp-kit"
|
|
34
|
+
Issues = "https://github.com/RdaKA12/webots-mcp-kit/issues"
|
|
35
|
+
Documentation = "https://github.com/RdaKA12/webots-mcp-kit/tree/main/docs"
|
|
36
|
+
Repository = "https://github.com/RdaKA12/webots-mcp-kit"
|
|
37
|
+
Changelog = "https://github.com/RdaKA12/webots-mcp-kit/blob/main/CHANGELOG.md"
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"build>=1.2.2",
|
|
42
|
+
"pytest>=8.0.0",
|
|
43
|
+
"twine>=6.1.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.scripts]
|
|
47
|
+
webots-kit = "webots_mcp_kit.cli:main"
|
|
48
|
+
|
|
49
|
+
[tool.setuptools]
|
|
50
|
+
package-dir = { "" = "src" }
|
|
51
|
+
include-package-data = true
|
|
52
|
+
|
|
53
|
+
[tool.setuptools.packages.find]
|
|
54
|
+
where = ["src"]
|
|
55
|
+
|
|
56
|
+
[tool.setuptools.package-data]
|
|
57
|
+
webots_mcp_kit = [
|
|
58
|
+
"examples/**/*.py",
|
|
59
|
+
"examples/**/*.wbt",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[tool.pytest.ini_options]
|
|
63
|
+
testpaths = ["tests"]
|