Skip to content

feat(core): add multi-tool MCP detection and extract filtering (#86) - #87

Merged
troylar merged 7 commits into
mainfrom
issue-86-extract-multi-tool-filtering
Feb 22, 2026
Merged

feat(core): add multi-tool MCP detection and extract filtering (#86)#87
troylar merged 7 commits into
mainfrom
issue-86-extract-multi-tool-filtering

Conversation

@troylar

@troylar troylar commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refactors ComponentDetector to use CAPABILITY_REGISTRY for MCP, hooks, commands, skills, workflows, and memory detection across all 23+ supported AI tools (previously Claude-centric)
  • Adds --tool, --component, and --scope filter options to devsync extract for selective extraction
  • Adds per-tool mcp_servers_json_key to handle VS Code/Copilot's "servers" key vs the standard "mcpServers"
  • Tracks source_tool on all detected components for accurate IDE support tagging

Changes

ai_tools

  • capability_registry.py — Added mcp_servers_json_key field to IDECapability (Copilot uses "servers")

core

  • component_detector.py — Major refactor: registry-driven detection for MCP/hooks/commands/skills/workflows/memory, source_tool tracking on all detected components, filter_detection_result() for post-detection filtering, scope validation with boundary checking on global paths
  • extractor.py — Pass-through for tool_filter, component_filter, scope to detector and filter

cli

  • main.py — Added --tool (repeatable), --component (repeatable), --scope options to extract command
  • extract.py — Validation of tool names, component names, scope; wiring filters to extractor

docs

  • CLAUDE.md — Updated architecture docs with new files and extract examples
  • VISION.md — Refined IDE-agnostic principle to cover extraction, added selective packaging to scope
  • docs/cli/extract.md — Added documentation for new --tool, --component, --scope options

tests

  • test_component_detector.py — 22 new tests: multi-tool MCP detection (Cursor, Roo, Copilot, Claude), tool filtering, component filtering, scope validation, filter_detection_result with instructions
  • test_extract.py — 6 new tests: CLI option validation for invalid/valid tool, component, scope values

Issue References

Closes #86

Test Plan

  • Unit tests pass: invoke test-unit (1616 passed, 4 skipped)
  • Lint passes: ruff check
  • Format passes: black --check
  • Type check passes: mypy
  • Multi-tool MCP detection with correct source_tool tagging
  • Tool filtering (--tool cursor) restricts extraction to specified tools
  • Component filtering (--component mcp) restricts to specified component types
  • Scope validation rejects invalid values
  • Global path boundary check prevents traversal outside home directory
  • No filters = identical behavior to previous version

Security Considerations

  • Global config paths (from ~-prefixed registry entries) are resolved and validated to stay under Path.home() before reading
  • scope parameter validated against allowlist (project, global, all) in ComponentDetector.__init__
  • Tool and component filter names validated at CLI boundary before passing to core logic

Vision Alignment

Directly supports IDE-agnostic principle (#2) — extraction now works across all 23+ tools instead of being Claude-centric. Supports selective packaging for teams that only want to share specific component types or tool configs.


Generated with Claude Code

Replace hardcoded Claude-only MCP/hooks/commands/skills/workflows/memory
detection with registry-driven paths from CAPABILITY_REGISTRY. Add --tool,
--component, --scope CLI options to devsync extract. Add mcp_servers_json_key
to IDECapability for per-tool JSON key handling (e.g. Copilot uses "servers").
Add source_tool tracking on all Detected* dataclasses and use it in
to_package_components for dynamic ide_support.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

📊 Code Quality Report

Linting Issues

All checks passed!

@github-actions

github-actions Bot commented Feb 22, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  devsync/ai_tools
  capability_registry.py
  devsync/cli
  extract.py
  main.py 32-47, 158
  tools.py 52
  devsync/core
  component_detector.py 438-439, 490-491, 499, 528-529, 554, 753, 773, 837, 900-901, 907, 909, 915, 935-936
  extractor.py 65
Project Total  

This report was generated by python-coverage-comment-action

@codecov

codecov Bot commented Feb 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.72549% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.92%. Comparing base (b81322e) to head (a23bdab).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
devsync/core/component_detector.py 91.42% 12 Missing ⚠️
devsync/cli/main.py 0.00% 2 Missing ⚠️
devsync/cli/tools.py 93.75% 1 Missing ⚠️
devsync/core/extractor.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   84.63%   84.92%   +0.29%     
==========================================
  Files          76       76              
  Lines        6403     6569     +166     
==========================================
+ Hits         5419     5579     +160     
- Misses        984      990       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

📊 Code Quality Report

Linting Issues

All checks passed!

…88)

- Add --dry-run flag to preview detected components without writing files
- Add --include-global flag replacing deprecated --scope option
- Display Rich table summarizing detected components before extraction
- Show zero-result warning with suggestions when filters match nothing
- Enhance extraction output with per-tool breakdown
- Add --verbose flag to devsync tools showing capabilities per tool
- Update docs/cli/extract.md with new flags and examples
@github-actions

Copy link
Copy Markdown

📊 Code Quality Report

Linting Issues

All checks passed!

@troylar
troylar merged commit 3244c72 into main Feb 22, 2026
23 of 25 checks passed
@troylar
troylar deleted the issue-86-extract-multi-tool-filtering branch February 22, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract command: add tool filtering, component filtering, and multi-tool MCP detection

1 participant