Skip to content

feat: add MCP tools for gateway v0.2.0-v0.4.0 features#14

Merged
bburda merged 14 commits intomainfrom
feat/new-tools-v020-v040
Apr 1, 2026
Merged

feat: add MCP tools for gateway v0.2.0-v0.4.0 features#14
bburda merged 14 commits intomainfrom
feat/new-tools-v020-v040

Conversation

@bburda
Copy link
Copy Markdown
Contributor

@bburda bburda commented Mar 31, 2026

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_* to ros2_medkit_* prefix (old names kept as aliases).

New tool groups:

  • Logs (3): list_logs, get/set_log_configuration
  • Triggers (5): create, list, get, update, delete triggers
  • Scripts (7): list, get, upload, delete, execute, get/control execution
  • Locking (5): acquire, list, get, extend, release locks
  • Cyclic Subscriptions (5): create, list, get, update, delete
  • Software Updates (8): register, list, get, get_status, prepare, execute, automate, delete
  • Data Discovery + Bulk Data (4): data categories, data groups, bulk upload, bulk delete

Additional fixes:

  • Tool prefix renamed sovd_* -> ros2_medkit_* (legacy aliases preserved)
  • _call_void() helper for 204/202 responses with GenericError detection
  • extend_lock uses _call_void for 204 No Content
  • Lock endpoints pass x_client_id header
  • Input validation: upload size limits, entity_type enums, required field schemas
  • Destructive update tool warnings

Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

Testing

  • 155 tests pass (111 existing + 44 new)
  • Ruff lint and format clean
  • Deep review performed (5 parallel agents), all findings addressed

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Linting passes (poetry run ruff check src/ tests/)
  • Formatting passes (poetry run ruff format --check src/ tests/)
  • Type checking passes (poetry run mypy src/)
  • Tests pass (poetry run python run_tests.py)
  • Docs were updated if behavior or public API changed

bburda added 7 commits March 31, 2026 08:35
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)
Copilot AI review requested due to automatic review settings March 31, 2026 07:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

bburda added 2 commits March 31, 2026 15:41
- 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
Copilot AI review requested due to automatic review settings March 31, 2026 18:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

bburda added 2 commits March 31, 2026 20:34
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.
Copilot AI review requested due to automatic review settings March 31, 2026 19:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 8 changed files in this pull request and generated 8 comments.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

bburda added 2 commits April 1, 2026 10:07
- 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 mfaferek93 self-requested a review April 1, 2026 08:29
@bburda bburda merged commit b1889eb into main Apr 1, 2026
3 checks passed
@bburda bburda deleted the feat/new-tools-v020-v040 branch April 1, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] extend_lock client method fails on 204 No Content response Add new MCP tools for gateway v0.2.0-v0.4.0 features

3 participants