pr-splitter-mcp

v1.0.1
pr-splitter-mcp Checked 17 hours ago Published 11 months ago

A MCP server that intelligently splits large PRs into multiple smaller PRs for better code review

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

analyze_code_structure Analyze Code Structure

Analyze the code structure of a directory.

ParameterTypeDescription
source_path *stringPath to the source directory to analyze
exclude_patternsOptional list of glob patterns to exclude
include_patternsOptional list of glob patterns to include (e.g., ["*.py", "*.js"])

generate_split_plan Generate Split Plan

Generate an intelligent split plan for dividing code into multiple PRs.

ParameterTypeDescription
source_path *stringPath to the source directory
base_branchstringBase branch name for the feature (default: "main")
branch_prefixstringPrefix for generated branch names (e.g., "user/name/feature")
strategystringSplit strategy - one of: - "by_module": Split by top-level modules/directories - "by_file": Split by individual files - "by_type": Split by file type (config, code, docs) - "balanced": Balance lines o…
target_pr_countintegerTarget number of PRs to create (default: 8)

execute_split Execute Split

Execute a split plan by creating branches, copying files, and pushing.

ParameterTypeDescription
plan *objectSplit plan from generate_split_plan (the "plan" field)
source_path *stringPath to source files
target_repo_path *stringPath to target git repository
dry_runbooleanIf True, preview changes without executing (default: True)

get_split_strategies Get Split Strategies

Get available split strategies and their descriptions.

generate_split_plan_from_pr Generate Split Plan From Pr

Generate a split plan directly from PR file data (from coding-flow.get_pr_content). This is the recommended tool to use with coding-flow MCP: 1. Call coding-flow.get_pr_content(prIdOrUrl) to get PR data 2. Pass the changedFiles to this tool 3. Use the generated plan to create branches and PRs

ParameterTypeDescription
pr_files *arrayList of PR files from coding-flow.get_pr_content() Each file should have: path, changeType (add/edit/delete), Optional: additions, deletions
base_branchstringBase branch for the split PRs
branch_prefixstringPrefix for generated branch names
pr_title_prefixstringPrefix for PR titles (e.g., "[Feature 1/5]")
strategystringSplit strategy - by_module, by_file, by_type, balanced
target_pr_countintegerTarget number of PRs to create (default: 5)

generate_pr_descriptions Generate Pr Descriptions

Generate detailed PR titles and descriptions for a split plan. This tool enhances a split plan with professional PR descriptions ready for use with coding-flow.create_draft_pr().

ParameterTypeDescription
plan *objectSplit plan from generate_split_plan_from_pr
include_dependenciesbooleanInclude dependency info in descriptions
project_namestringName of the project for PR titles

get_server_stats Get Server Stats

Get server statistics.

check_auth_status Check Auth Status

Check authentication and dependency status for PR creation. This tool verifies: - Azure DevOps: AzureCliCredential (from `az login`) - GitHub: Token from gh auth or GITHUB_TOKEN env var - Required Python packages

create_ado_pr Create Ado Pr

Create a Pull Request in Azure DevOps using native SDK. Authentication: Uses AzureCliCredential (from `az login`). Same authentication pattern as coding-flow - no manual token needed!

ParameterTypeDescription
org_url *stringAzure DevOps organization URL (e.g., https://dev.azure.com/your-org)
project *stringProject name
repo *stringRepository name
source_branch *stringSource branch name
target_branch *stringTarget branch name
title *stringPR title
descriptionstringPR description (optional)
draftbooleanCreate as draft PR (default: True)
work_item_idOptional ADO work item ID to link

create_github_pr Create Github Pr

Create a Pull Request in GitHub using native SDK. Authentication: Uses token from `gh auth login` or GITHUB_TOKEN env var. Same authentication pattern as coding-flow - no manual token needed!

ParameterTypeDescription
repo *stringRepository in format "owner/repo"
source_branch *stringSource branch name
bodystringPR body/description (optional)
draftbooleanCreate as draft PR (default: True)
target_branchstringTarget branch name (default: main)
titlestringPR title (default: branch name)

split_folder_to_plan Split Folder To Plan

Generate a split plan from a local folder (similar to generate_split_plan_from_pr). This tool analyzes a local folder and generates a split plan that can be used with execute_split or manual git operations.

ParameterTypeDescription
folder_path *stringPath to the folder containing code to split
base_branchstringBase branch for the split PRs
branch_prefixstringPrefix for generated branch names
exclude_patternsFile patterns to exclude (e.g., ["__pycache__/*"])
include_patternsFile patterns to include (e.g., ["*.py", "*.js"])
pr_title_prefixstringPrefix for PR titles
strategystringSplit strategy - by_module, by_file, by_type, balanced
target_pr_countintegerTarget number of PRs to create (default: 5)

split_and_push_folder Split And Push Folder

End-to-end: Analyze folder, create split plan, create branches, and push. This is the all-in-one tool for splitting a local folder into multiple PRs. After running this, you can use create_prs_from_plan() or coding-flow to create the actual PRs.

ParameterTypeDescription
source_folder *stringPath to the folder containing code to split
target_repo_path *stringPath to the target git repository
base_branchstringBase branch in target repo (will be created if not exists)
branch_prefixstringPrefix for generated branch names
dry_runbooleanIf True, preview without making changes (default: True)
exclude_patternsFile patterns to exclude
include_patternsFile patterns to include
pr_title_prefixstringPrefix for PR titles
pushbooleanIf True, push branches to remote (default: True)
relative_path_in_repostringWhere to put files in the target repo (e.g., "src/feature/")
strategystringSplit strategy - by_module, by_file, by_type, balanced
target_pr_countintegerTarget number of PRs to create (default: 5)

create_prs_from_plan Create Prs From Plan

Batch create PRs from a split plan. This tool takes a split plan (from generate_split_plan) and creates all the PRs automatically on the specified platform. Authentication: Uses system credentials (az login / gh auth login).

ParameterTypeDescription
plan *objectSplit plan from generate_split_plan (use the "plan" field)
platform *stringTarget platform - "ado" for Azure DevOps or "github" for GitHub
repo *stringRepository name - For GitHub: format "owner/repo" (e.g., "Polly2014/MyRepo") - For ADO: just repo name (e.g., "xpaytools")
draftbooleanCreate as draft PRs (default: True)
org_urlAzure DevOps org URL (required for ADO, e.g., https://msasg.visualstudio.com)
projectAzure DevOps project name (required for ADO, e.g., XPay)