Add bulk-data MCP tools and structured fault response models#7
Merged
Conversation
…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
62eea0b to
e3a9bab
Compare
There was a problem hiding this comment.
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. |
- 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
mfaferek93
reviewed
Feb 8, 2026
mfaferek93
approved these changes
Feb 9, 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
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:
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist
poetry run ruff check src/ tests/)poetry run ruff format --check src/ tests/)poetry run mypy src/)poetry run python run_tests.py)