Educational Python refactoring assistant that provides guided suggestions for AI assistants. Features: • Step-by-step refactoring instructions without modifying code • Comprehensive code analysis using professional tools (Rope, Radon, Vulture, Jedi, LibCST, Pyrefly) • Educational approach teaching refactoring patterns through guided practice • Support for both guide-only and apply-changes modes • Identifies long functions, high complexity, dead code, and type issues • Provides precise line numbers and specific refactoring instructions • Compatible with all AI assistants (Claude, GPT, Cursor, Continue, etc.) Perfect for developers learning refactoring patterns while maintaining full control over code changes. Acts as a refactoring mentor rather than an automated code modifier.
1.2K
9 Tools
Version 4.43 or later needs to be installed to add the server automatically
Use cases
About
Educational Python refactoring assistant that provides guided suggestions for AI assistants.
Features: • Step-by-step refactoring instructions without modifying code • Comprehensive code analysis using professional tools (Rope, Radon, Vulture, Jedi, LibCST, Pyrefly) • Educational approach teaching refactoring patterns through guided practice • Support for both guide-only and apply-changes modes • Identifies long functions, high complexity, dead code, and type issues • Provides precise line numbers and specific refactoring instructions • Compatible with all AI assistants (Claude, GPT, Cursor, Continue, etc.)
Perfect for developers learning refactoring patterns while maintaining full control over code changes. Acts as a refactoring mentor rather than an automated code modifier. .
Attribute | Details |
---|---|
Docker Image | mcp/mcp-python-refactoring |
Author | slamer59 |
Repository | https://github.com/slamer59/mcp-python-refactoring |
Dockerfile | https://github.com/slamer59/mcp-python-refactoring/blob/main/Dockerfile |
Docker Image built by | Docker Inc. |
Docker Scout Health Score | |
Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/mcp-python-refactoring --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
Licence | MIT License |
Tools provided by this Server | Short Description |
---|---|
analyze_python_file | Analyze Python file for refactoring opportunities with precise guidance |
analyze_python_package | Comprehensive package/folder analysis for refactoring opportunities |
analyze_security_and_patterns | Comprehensive security scanning and modern Python patterns analysis |
analyze_test_coverage | Analyze Python test coverage and suggest improvements |
find_long_functions | Find functions that are candidates for extraction |
find_package_issues | Identify package-level refactoring opportunities and structural issues |
get_extraction_guidance | Get detailed step-by-step guidance for extracting functions |
get_package_metrics | Get aggregated metrics for a Python package |
tdd_refactoring_guidance | Generate TDD-based refactoring guidance: test first, refactor, test again |
analyze_python_file
Analyze Python file for refactoring opportunities with precise guidance
Parameters | Type | Description |
---|---|---|
content | string | Python file content to analyze |
file_path | string optional | Path to Python file to analyze |
analyze_python_package
Comprehensive package/folder analysis for refactoring opportunities
Parameters | Type | Description |
---|---|---|
package_path | string | Path to Python package/folder to analyze |
package_name | string optional | Name of the package (optional, will be inferred from path) |
analyze_security_and_patterns
Comprehensive security scanning and modern Python patterns analysis
Parameters | Type | Description |
---|---|---|
content | string | Python file content to analyze |
file_path | string optional | Path to Python file to analyze |
include_dependency_scan | boolean optional | Include dependency vulnerability scanning (default: true) |
include_modernization | boolean optional | Include modern Python pattern suggestions (default: true) |
include_security_scan | boolean optional | Include code security vulnerability scanning (default: true) |
analyze_test_coverage
Analyze Python test coverage and suggest improvements
Parameters | Type | Description |
---|---|---|
source_path | string | Path to source code directory or file |
target_coverage | integer optional | Target coverage percentage (default: 80) |
test_path | string optional | Path to test directory (optional) |
find_long_functions
Find functions that are candidates for extraction
Parameters | Type | Description |
---|---|---|
content | string | Python file content to analyze |
line_threshold | integer optional | Minimum lines to consider a function long (default: 20) |
find_package_issues
Identify package-level refactoring opportunities and structural issues
Parameters | Type | Description |
---|---|---|
package_path | string | Path to Python package/folder |
issue_types | array optional | Specific types of issues to look for (optional): scattered_functionality, god_package, circular_dependency, etc. |
get_extraction_guidance
Get detailed step-by-step guidance for extracting functions
Parameters | Type | Description |
---|---|---|
content | string | Python file content |
file_path | string optional | Path to Python file |
function_name | string optional | Name of function to analyze for extraction |
get_package_metrics
Get aggregated metrics for a Python package
Parameters | Type | Description |
---|---|---|
package_path | string | Path to Python package/folder |
package_name | string optional | Name of the package (optional) |
tdd_refactoring_guidance
Generate TDD-based refactoring guidance: test first, refactor, test again
Parameters | Type | Description |
---|---|---|
content | string | Python code content to refactor |
function_name | string optional | Specific function/class to refactor (optional) |
test_path | string optional | Path to test directory (optional) |
{
"mcpServers": {
"mcp-python-refactoring": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/mcp-python-refactoring"
]
}
}
}
Manual installation
You can install the MCP server using:
Installation for