Fix: Robot Specifications Not Accessible After pip Install #171
+61
−21
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.
🐛 Fix: Robot Specifications Not Accessible After pip Install
Problem
When
ros-mcp
is installed via pip (pip install ros-mcp
), thelist_verified_robot_specifications
tool fails with the error:This occurs because the code was using relative paths from the current working directory (CWD) instead of resolving paths relative to the installed package location.
Changes Made
1. Moved
robot_specifications
to Root Levelutils/robot_specifications/
robot_specifications/
(standalone package at project root)2. Fixed Path Resolution in
utils/config_utils.py
parse_robot_config()
andget_robot_specifications()
to resolve paths relative to the module's location usingPath(__file__).parent.parent / "robot_specifications"
"utils/robot_specifications"
toNone
with dynamic resolutionstr | None
)3. Updated Package Configuration
pyproject.toml
:robot_specifications
to packages list[tool.setuptools.package-data]
section to include*.yaml
filesMANIFEST.in
:recursive-include robot_specifications *.yaml
to include YAML files in source distribution4. Type Hints Improvements
str | None
) instead ofOptional[str]
5. Updated inconsistent tool names
Files Changed
How It Works Now
specs_dir=None
(default), the functions resolve the path relative to the installed package locationspecs_dir
is provided, it uses the custom path (backward compatible)Testing
After installing via pip:
The MCP configuration works correctly for Ubuntu
For Mac:
And for WSL
And
list_verified_robot_specifications
successfully returns available robot specs regardless of the current working directory.Note:
Fixes: Issue with robot specifications not being accessible when installed via pip
#141 - Consistent naming of tools