Skip to content

refactor(integration): extract MCPIntegrator.install#1245

Open
abhinavgautam01 wants to merge 1 commit intomicrosoft:mainfrom
abhinavgautam01:refactor/1004-extract-mcp-integrator-install
Open

refactor(integration): extract MCPIntegrator.install#1245
abhinavgautam01 wants to merge 1 commit intomicrosoft:mainfrom
abhinavgautam01:refactor/1004-extract-mcp-integrator-install

Conversation

@abhinavgautam01
Copy link
Copy Markdown

Fixes #1004

Description

This PR applies strangler-fig stage 1 for MCP install orchestration: the implementation of MCPIntegrator.install is moved into run_mcp_install() in src/apm_cli/integration/mcp_integrator_install.py. MCPIntegrator.install remains a thin delegate so the public API and existing call sites stay the same.

Motivation: mcp_integrator.py is dominated by a very large install method; extracting it improves readability and makes later refactors safer without changing behavior.
Compatibility: Imports inside run_mcp_install() keep test patch targets working (e.g. apm_cli.integration.mcp_integrator._get_console, MCPIntegrator._install_for_runtime). _get_console stays imported on mcp_integrator with noqa so patches that target that module attribute keep working.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)
    After uv sync --extra dev:
uv run pytest tests/unit/integration/test_mcp_integrator.py \
  tests/unit/test_mcp_integrator_characterisation.py \
  tests/unit/test_global_mcp_scope.py \
  tests/unit/test_transitive_mcp.py \
  tests/unit/test_mcp_overlays.py -q

Result: 265 passed.

…r_install

  Strangler-fig stage 1: move install orchestration into run_mcp_install()
  while keeping MCPIntegrator.install as the public entrypoint.
Copilot AI review requested due to automatic review settings May 10, 2026 15:47
@abhinavgautam01
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Stage 1 strangler-fig -- extract mcp_integrator.py::install

2 participants