pr-splitter-mcp
v1.0.1A 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.
| Parameter | Type | Description |
|---|---|---|
source_path * | string | Path to the source directory to analyze |
exclude_patterns | Optional list of glob patterns to exclude | |
include_patterns | Optional 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.
| Parameter | Type | Description |
|---|---|---|
source_path * | string | Path to the source directory |
base_branch | string | Base branch name for the feature (default: "main") |
branch_prefix | string | Prefix for generated branch names (e.g., "user/name/feature") |
strategy | string | Split 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_count | integer | Target number of PRs to create (default: 8) |
execute_split Execute Split
Execute a split plan by creating branches, copying files, and pushing.
| Parameter | Type | Description |
|---|---|---|
plan * | object | Split plan from generate_split_plan (the "plan" field) |
source_path * | string | Path to source files |
target_repo_path * | string | Path to target git repository |
dry_run | boolean | If 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
| Parameter | Type | Description |
|---|---|---|
pr_files * | array | List of PR files from coding-flow.get_pr_content() Each file should have: path, changeType (add/edit/delete), Optional: additions, deletions |
base_branch | string | Base branch for the split PRs |
branch_prefix | string | Prefix for generated branch names |
pr_title_prefix | string | Prefix for PR titles (e.g., "[Feature 1/5]") |
strategy | string | Split strategy - by_module, by_file, by_type, balanced |
target_pr_count | integer | Target 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().
| Parameter | Type | Description |
|---|---|---|
plan * | object | Split plan from generate_split_plan_from_pr |
include_dependencies | boolean | Include dependency info in descriptions |
project_name | string | Name 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!
| Parameter | Type | Description |
|---|---|---|
org_url * | string | Azure DevOps organization URL (e.g., https://dev.azure.com/your-org) |
project * | string | Project name |
repo * | string | Repository name |
source_branch * | string | Source branch name |
target_branch * | string | Target branch name |
title * | string | PR title |
description | string | PR description (optional) |
draft | boolean | Create as draft PR (default: True) |
work_item_id | Optional 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!
| Parameter | Type | Description |
|---|---|---|
repo * | string | Repository in format "owner/repo" |
source_branch * | string | Source branch name |
body | string | PR body/description (optional) |
draft | boolean | Create as draft PR (default: True) |
target_branch | string | Target branch name (default: main) |
title | string | PR 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.
| Parameter | Type | Description |
|---|---|---|
folder_path * | string | Path to the folder containing code to split |
base_branch | string | Base branch for the split PRs |
branch_prefix | string | Prefix for generated branch names |
exclude_patterns | File patterns to exclude (e.g., ["__pycache__/*"]) | |
include_patterns | File patterns to include (e.g., ["*.py", "*.js"]) | |
pr_title_prefix | string | Prefix for PR titles |
strategy | string | Split strategy - by_module, by_file, by_type, balanced |
target_pr_count | integer | Target 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.
| Parameter | Type | Description |
|---|---|---|
source_folder * | string | Path to the folder containing code to split |
target_repo_path * | string | Path to the target git repository |
base_branch | string | Base branch in target repo (will be created if not exists) |
branch_prefix | string | Prefix for generated branch names |
dry_run | boolean | If True, preview without making changes (default: True) |
exclude_patterns | File patterns to exclude | |
include_patterns | File patterns to include | |
pr_title_prefix | string | Prefix for PR titles |
push | boolean | If True, push branches to remote (default: True) |
relative_path_in_repo | string | Where to put files in the target repo (e.g., "src/feature/") |
strategy | string | Split strategy - by_module, by_file, by_type, balanced |
target_pr_count | integer | Target 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).
| Parameter | Type | Description |
|---|---|---|
plan * | object | Split plan from generate_split_plan (use the "plan" field) |
platform * | string | Target platform - "ado" for Azure DevOps or "github" for GitHub |
repo * | string | Repository name - For GitHub: format "owner/repo" (e.g., "Polly2014/MyRepo") - For ADO: just repo name (e.g., "xpaytools") |
draft | boolean | Create as draft PRs (default: True) |
org_url | Azure DevOps org URL (required for ADO, e.g., https://msasg.visualstudio.com) | |
project | Azure DevOps project name (required for ADO, e.g., XPay) |