Skip to content

feat: create devsync-mcp package — MCP server with AI-merge for team config sync #55

@troylar

Description

@troylar

Description

Create a separate devsync-mcp PyPI package that exposes DevSync's extraction, adaptation, and merge functionality as an MCP server. The headline feature is AI-powered merge of team configs with personal configs, usable from any MCP-capable IDE.

Context

DevSync v2 (0.12.0) shipped with PracticeExtractor and PracticeAdapter — the core engines for AI-powered extraction and intelligent merging. These are currently only accessible via the devsync CLI. Wrapping them as MCP tools lets AI coding assistants call them directly, enabling workflows like /sync-team from within Claude Code.

This is a separate repo (troylar/devsync-mcp) and separate PyPI package (pip install devsync-mcp), depending on devsync>=0.12.0 for core logic.

Architecture

devsync core dependencies (read-only, no changes needed)

  • devsync/core/extractor.pyPracticeExtractor (extraction engine)
  • devsync/core/adapter.pyPracticeAdapter (adaptation/merge engine)
  • devsync/core/practice.pyPracticeDeclaration, MCPDeclaration, CredentialSpec
  • devsync/llm/provider.pyLLMProvider, resolve_provider()
  • devsync/llm/response_models.pyExtractionResult, AdaptationPlan, AdaptationAction
  • devsync/storage/tracker.pyInstallationTracker
  • devsync/core/component_detector.py — existing config detection

New package structure

devsync-mcp/
├── devsync_mcp/
│   ├── __init__.py
│   ├── server.py              # FastMCP v2 server definition
│   ├── tools/
│   │   ├── extraction.py      # pull_team_profile, list_practices, detect_local_configs
│   │   ├── merging.py         # preview_merge, apply_merge
│   │   ├── backups.py         # backup_current_config, restore_config
│   │   └── sync.py            # get_merge_status, sync_all
│   └── models.py              # Response models for MCP tools
├── .claude/commands/sync-team.md  # Claude Code skill
├── pyproject.toml
├── tests/
└── README.md

Dependencies

dependencies = [
    "devsync>=0.12.0",
    "fastmcp>=2.0.0,<4.0.0",
]

MCP Tools (9)

Phase Tool Wraps Description
1 pull_team_profile PracticeExtractor.extract() Extract practices from a source repo/dir
1 list_available_practices ExtractionResult Browse extracted practices
1 detect_local_configs PracticeAdapter._detect_existing_rules() Scan project for existing rules
2 preview_merge PracticeAdapter.adapt() Show what AI-merge would do (install/merge/skip)
2 apply_merge File writes + tracker Execute the adaptation plan
2 backup_current_config New backup logic Snapshot existing rules before merge
2 restore_config Restore from backup Roll back to previous state
3 get_merge_status InstallationTracker Show what's installed/merged/skipped
3 sync_all Orchestration Pull + detect + preview + apply in one call

Acceptance Criteria

  • Separate repo troylar/devsync-mcp with CI (lint, test, publish)
  • pip install devsync-mcp installs cleanly alongside devsync
  • All 9 MCP tools registered and callable via FastMCP
  • pull_team_profile extracts practices from Git URL or local path
  • preview_merge returns AdaptationPlan as structured JSON
  • apply_merge writes files to correct tool-specific directories
  • Backup/restore round-trips cleanly (backup → merge → restore returns to original)
  • /sync-team Claude Code skill works end-to-end
  • Graceful degradation: works without LLM API key (file-copy mode)
  • No credentials stored in any output — credential safety maintained
  • Tests pass with mocked LLM responses
  • Published to PyPI as devsync-mcp

Vision Alignment

  • ✅ Zero-friction: pip install devsync-mcp, no other setup
  • ✅ IDE-agnostic: MCP works with any MCP-capable tool
  • ✅ Credential safety: no secrets in outputs
  • ⚠️ Tension: "Not a plugin framework" — this is a thin wrapper, not a runtime. The MCP server is plumbing that delegates to devsync core.
  • ⚠️ Tension: "Not an IDE" — the /sync-team skill is tool-specific. Keep it as an optional add-on, not a core feature.

Implementation Phases

  1. Foundation — repo setup, FastMCP server, tools 1-3 (extraction)
  2. Merge Core — tools 4-7 (preview, apply, backup, restore)
  3. Sync & Polish — tools 8-9 (status, sync_all), /sync-team skill
  4. Package & Publish — CI, PyPI, README, docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions