feat: add MCP tools for gateway v0.2.0-v0.4.0 features#14
Merged
Conversation
Add 6 new MCP tools for script management on components and apps: sovd_list_scripts, sovd_get_script, sovd_upload_script, sovd_execute_script, sovd_get_script_execution, and sovd_control_script_execution. Includes delete_script client method.
Add 4 new tools: - sovd_data_categories: list data categories for an entity - sovd_data_groups: list data groups for an entity - sovd_bulkdata_upload: upload a file to entity bulk data storage - sovd_bulkdata_delete: delete a bulk data item (204 handling)
There was a problem hiding this comment.
Pull request overview
Adds a large set of new MCP tools to cover ros2_medkit gateway features introduced in v0.2.0–v0.4.0, expanding the MCP surface area (logs, triggers, scripts, locking, cyclic subscriptions, software updates, and data discovery/bulk data operations).
Changes:
- Added new SovdClient methods and entity dispatch mappings for logs, triggers, scripts, locking, cyclic subscriptions, software updates, and data discovery/bulk-data upload/delete.
- Added corresponding Pydantic argument models and registered the new tools + schemas in the MCP tool list/dispatcher.
- Added a dedicated test suite covering the new client methods with respx-mocked HTTP responses.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/ros2_medkit_mcp/client.py |
Adds new API wrappers + dispatch mappings for newly supported gateway endpoints (logs/triggers/scripts/locks/subscriptions/updates/data discovery/bulk upload-delete). |
src/ros2_medkit_mcp/models.py |
Introduces new Pydantic argument models for the added tool groups. |
src/ros2_medkit_mcp/mcp_app.py |
Registers new MCP tools (schemas + dispatcher branches) and wires them to SovdClient methods. |
tests/test_new_tools.py |
Adds new async tests validating the new SovdClient methods with mocked HTTP endpoints. |
…dation, warnings - Register sovd_delete_script tool (alias, Tool definition, dispatcher) - Add max_length constraints to UploadScriptArgs and BulkDataUploadArgs - Add WARNING to sovd_execute_update and sovd_automate_update descriptions - Add enum constraints to entity_type in all tool inputSchemas - Wrap base64.b64decode in try/except for sovd_bulkdata_upload - Move base64 import to module level - Refactor client.py with _call_void for void-returning endpoints
- Update wheel dependency to py-v0.1.1 - Lock endpoints now require x_client_id header (default: ros2_medkit_mcp) - AcquireLockRequest/ExtendLockRequest are now separate models (spec fix) - extend_lock returns 204, use _call_void - ScriptControlRequest uses 'action' field not 'command' - Fix test fixtures for new lock/script schemas
All 84 MCP tool names now use the ros2_medkit_ prefix as their canonical name. The old sovd_ names and dot-notation aliases (sovd.version, etc.) are preserved in TOOL_ALIASES for backwards compatibility. Tool descriptions updated to reference new names.
mfaferek93
reviewed
Apr 1, 2026
mfaferek93
reviewed
Apr 1, 2026
- Fix stale field examples in models.py: lock uses lock_expiration (not duration), script control uses action (not command), cyclic sub uses duration+interval+resource (not period) - Fix list_data_categories return type annotation (list[Any] not list[dict]) - Fix extend_lock tool description to use lock_expiration - Add 7 dispatch smoke tests (one per tool group) - Add optional client_id field to lock arg models (default ros2_medkit_mcp)
mfaferek93
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Add 37 new MCP tools covering all gateway features from v0.2.0 through v0.4.0. Total tool count: 84. Rename all tools from
sovd_*toros2_medkit_*prefix (old names kept as aliases).New tool groups:
Additional fixes:
sovd_*->ros2_medkit_*(legacy aliases preserved)_call_void()helper for 204/202 responses with GenericError detectionextend_lockuses_call_voidfor 204 No Contentx_client_idheaderIssue
Type
Testing
Checklist
poetry run ruff check src/ tests/)poetry run ruff format --check src/ tests/)poetry run mypy src/)poetry run python run_tests.py)