Skip to content

Add bulk-data MCP tools and structured fault response models#7

Merged
bburda merged 3 commits intomainfrom
feat/snapshot-download
Feb 9, 2026
Merged

Add bulk-data MCP tools and structured fault response models#7
bburda merged 3 commits intomainfrom
feat/snapshot-download

Conversation

@bburda
Copy link
Contributor

@bburda bburda commented Feb 5, 2026

Pull Request

Summary

Extend server with richer fault/snapshot presentation and adds bulk-data (e.g., rosbag) discovery + download capabilities, enabling snapshot downloads tied to fault environment data.

Changes:

  • Added Pydantic models for fault responses, snapshots, and bulk-data entities/args.
  • Added MCP tools and formatting helpers for bulk-data category listing, item listing, metadata (HEAD), and downloads (including “download rosbags for fault”).
  • Added comprehensive unit tests for the new formatting and bulk-data behavior.

Issue

Link the related issue (required):


Type

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

Testing

How was this tested / how should reviewers verify it?


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 bburda self-assigned this Feb 5, 2026
@bburda bburda added the enhancement New feature or request label Feb 5, 2026
…atting

- Add FaultItem, FaultStatus, FreezeFrameSnapshot, RosbagSnapshot models
- Add ExtendedDataRecords, EnvironmentData, FaultResponse models
- Update fault tools to return formatted output instead of raw JSON
- Add format_fault_list, format_fault_response, format_snapshots_response
- Add comprehensive tests for models and formatting functions
Add five new MCP tools for bulk-data operations:
- sovd_bulkdata_categories: List bulk-data categories (rosbags, logs)
- sovd_bulkdata_list: List items in a category with sizes and dates
- sovd_bulkdata_info: Get metadata via HEAD request before download
- sovd_bulkdata_download: Download single bulk-data file to disk
- sovd_bulkdata_download_for_fault: Download all rosbags for a fault

Implementation:
- BulkDataItem, BulkDataCategoryResponse, BulkDataListResponse models
- SovdClient methods: list_bulk_data_categories, list_bulk_data,
  get_bulk_data_info, download_bulk_data (with 300s timeout)
- Human-readable formatting with file sizes and timestamps
- Creates output_dir if not exists, extracts filename from headers/URI

Tests:
- TestBulkDataModels: Pydantic model validation
- TestBulkDataArgModels: Argument model validation
- TestFormatFunctions: Formatting function coverage
- TestSaveBulkDataFile: File saving with temp directories
- TestClientBulkDataMethods: HTTP client with respx mocks
- TestDownloadRosbagsForFault: Multi-file download scenarios
@bburda bburda force-pushed the feat/snapshot-download branch from 62eea0b to e3a9bab Compare February 5, 2026 21:16
@bburda bburda marked this pull request as ready for review February 6, 2026 16:11
Copilot AI review requested due to automatic review settings February 6, 2026 16:11
Copy link

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

This PR extends the ROS2 MedKit MCP server with richer fault/snapshot presentation and adds bulk-data (e.g., rosbag) discovery + download capabilities, enabling snapshot downloads tied to fault environment data.

Changes:

  • Added Pydantic models for fault responses, snapshots, and bulk-data entities/args.
  • Added MCP tools and formatting helpers for bulk-data category listing, item listing, metadata (HEAD), and downloads (including “download rosbags for fault”).
  • Added comprehensive unit tests for the new formatting and bulk-data behavior.

Reviewed changes

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

Show a summary per file
File Description
src/ros2_medkit_mcp/models.py Adds new Pydantic models for faults/snapshots and bulk-data request/response structures.
src/ros2_medkit_mcp/client.py Adds bulk-data client methods (list categories/items, HEAD metadata, download).
src/ros2_medkit_mcp/mcp_app.py Adds formatting helpers, bulk-data tools, and switches fault/snapshot tools to formatted output.
tests/test_fault_formatting.py Adds tests for new fault/snapshot models and formatting functions.
tests/test_bulkdata_tools.py Adds tests for bulk-data models, formatting, client methods, and download helpers.

@bburda bburda changed the title Feat/snapshot download Add bulk-data MCP tools and structured fault response models Feb 6, 2026
- Add path traversal sanitization in save_bulk_data_file and download_rosbags_for_fault
- Add SSRF protection: reject absolute URLs in download_bulk_data
- Handle all non-2xx responses in get_bulk_data_info (not just 404)
- Remove unused BulkDataDescriptor model
@bburda bburda requested a review from mfaferek93 February 6, 2026 17:21
@bburda bburda merged commit ce5b825 into main Feb 9, 2026
3 checks passed
@bburda bburda deleted the feat/snapshot-download branch February 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bulk-data MCP tools and structured fault response models

2 participants