Skip to content

feat: expose move through MCP - #2078

Closed
vitali87 wants to merge 2 commits into
pr-split/split-pr1549-source/pr-6from
pr-split/split-pr1549-source/pr-8
Closed

vitali87 wants to merge 2 commits into
pr-split/split-pr1549-source/pr-6from
pr-split/split-pr1549-source/pr-8

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Register the MCP move tool, schema, descriptions, and contract re-ingest path.

Files changed

  • codebase_rag/mcp/tools.py
  • codebase_rag/tools/tool_descriptions.py

Diff stats

+105 additions, -1 deletions (106 LOC)

Dependencies

This PR depends on: pr-6

Dependency graph

Merge in this order:

pr-1: feat: add move public API and constants
├── pr-2: feat: parse move spans and imports
│   └── pr-5: feat: retarget move imports safely
│       └── pr-6: feat: implement move refactoring operation
│           ├── pr-7: feat: expose move through CLI
│           │   └── pr-11: docs: document move operation
│           ├── pr-8: feat: expose move through MCP  <-- this PR
│           │   ├── pr-10: test: cover move MCP wiring
│           │   └── pr-11: docs: document move operation
│           └── pr-9: test: cover move operation behavior
│               └── pr-10: test: cover move MCP wiring
├── pr-3: feat: expose import graph sites for move
│   └── pr-5: feat: retarget move imports safely
│       └── pr-6: feat: implement move refactoring operation
│           ├── pr-7: feat: expose move through CLI
│           │   └── pr-11: docs: document move operation
│           ├── pr-8: feat: expose move through MCP  <-- this PR
│           │   ├── pr-10: test: cover move MCP wiring
│           │   └── pr-11: docs: document move operation
│           └── pr-9: test: cover move operation behavior
│               └── pr-10: test: cover move MCP wiring
└── pr-4: feat: detect move contract deltas
    └── pr-5: feat: retarget move imports safely
        └── pr-6: feat: implement move refactoring operation
            ├── pr-7: feat: expose move through CLI
            │   └── pr-11: docs: document move operation
            ├── pr-8: feat: expose move through MCP  <-- this PR
            │   ├── pr-10: test: cover move MCP wiring
            │   └── pr-11: docs: document move operation
            └── pr-9: test: cover move operation behavior
                └── pr-10: test: cover move MCP wiring

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^feat/.*
  • ^fix/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: vitali87/code-graph-rag/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: dbafc245-3ec5-4c38-ad0b-d28ad0deff71

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

Not safe to merge until move validates that the selected project's indexed root matches the server-local root before applying edits.

Findings

  1. P1 Validate the project root ▶

Summary

This PR exposes the existing move refactoring operation through MCP, including its schema, descriptions, refusal payload, contract re-ingestion, and partial-graph classification.

T-Rex validation blocked

The focused cross-project move reproduction could not run because the repository virtual environment's Python executable was unavailable. Completing dependency setup is also blocked because building pymgclient requires cmake or cmake3, neither of which is available.

The move handler still lacks the selected-project root validation used by the adjacent rename and change-signature handlers. This must be resolved before merging.

Reviews (1) · Last reviewed commit: "feat: expose move through MCP"

Comment thread codebase_rag/mcp/tools.py

try:
report = move(
Path(self.project_root),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Validate the project root

If project selects a known project indexed from another repository, this handler still passes self.project_root to move. The move operation resolves the selected graph's relative paths under the server-local root, so a non-dry-run request can modify unrelated local files that share those paths. Resolve and validate the selected project's stored source root before invoking move, as the rename and change-signature handlers already do.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A critical project-root scoping issue and a moderate dry-run contract mismatch remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Exposes the move refactoring operation through MCP, including schema metadata, descriptions, registration, and contract re-ingestion.

Changes:

  • Registers the MCP move tool and handler.
  • Adds move parameters and user-facing descriptions.
  • Connects execution to contract-aware re-ingestion.

Review findings:

  • Critical (3 votes): mcp/tools.py must validate the selected project's root before moving files.
  • Moderate (1 vote): The dry-run description promises a diff that the move planner does not currently provide.
File Summary
codebase_rag/​tools/​tool_descriptions.py Adds move tool and parameter descriptions.
codebase_rag/​mcp/​tools.py Registers and executes the MCP move operation with contract re-ingestion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread codebase_rag/mcp/tools.py
Comment on lines +2732 to +2738
try:
report = move(
Path(self.project_root),
self.ingestor.fetch_all,
project_name,
qualified_name,
target_module,

vitali87 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Closing as superseded: this is part of the split of #1549, which was closed without merging, and it targets the stale feat/change-signature branch rather than main. The change_signature base was rebuilt on main as #1912 (now stacked as #2161–#2169). The branch is kept, so the move-op work can be rebased onto main if it's picked up again.


Generated by Claude Code

@vitali87 vitali87 closed this Oct 9, 2026
@vitali87
vitali87 deleted the pr-split/split-pr1549-source/pr-8 branch October 30, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants