akv2011/MCP_server_for_Automated_Refactoring
If you are the rightful owner of MCP_server_for_Automated_Refactoring and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
TaskMaster is a Model Context Protocol (MCP) server designed to automate code refactoring, ensuring code quality and maintainability across various programming languages.
TaskMaster MCP Server
🚀 Intelligent Automated Code Refactoring for AI Assistants
TaskMaster is a Model Context Protocol (MCP) server that provides automated code refactoring capabilities. It monitors codebases, identifies files exceeding complexity thresholds (e.g., 1500+ lines), and performs intelligent refactoring operations to maintain code quality and maintainability.
🎯 Key Features
- 🔍 Automated Detection: Identifies files exceeding configurable thresholds (lines, complexity, functions)
- 🤖 AI-Powered Suggestions: Generates intelligent refactoring strategies using GPT-4/Claude
- 🛡️ Safe Execution: Automatic backups, test validation, and rollback support
- 🗄️ Database Refactoring: Specialized handling for migrations, SQL files, and ORM models
- 🌐 Multi-Language Support: Python, JavaScript, TypeScript, Java, C#, SQL
- ⚡ Real-time Analysis: Fast code analysis with tree-sitter parsing
📋 Project Status
Current Phase: Development - Task 1 Complete ✅
See for the complete Product Requirements Document.
🏗️ Project Structure
MCP server weather data/
├── .github/ # GitHub workflows and instructions
├── .taskmaster/ # TaskMaster configuration and tasks
├── .vscode/ # VS Code configuration (mcp.json)
├── taskmaster-server/ # Main TaskMaster MCP server
│ ├── taskmaster/ # Core package
│ ├── tests/ # Test suite
│ ├── taskmaster.py # Server entry point
│ ├── pyproject.toml # Dependencies
│ └── README.md # Server documentation
├── TASKMASTER_PRD.md # Product Requirements Document
└── README.md # This file
🚀 Quick Start
Prerequisites
- Python 3.10+
- Conda or similar package manager
- OpenAI API key (for GPT-4 suggestions)
- Anthropic API key (for Claude suggestions)
Installation
# Navigate to server directory
cd taskmaster-server
# Activate your Python environment
conda activate base
# Install dependencies
pip install -e .
# Run tests
python -m pytest tests/ -v
Configure MCP
Add TaskMaster to your .vscode/mcp.json:
{
"servers": {
"taskmaster": {
"command": "python",
"args": [
"/path/to/taskmaster-server/taskmaster.py"
],
"type": "stdio",
"env": {
"OPENAI_API_KEY": "your-openai-key",
"ANTHROPIC_API_KEY": "your-anthropic-key"
}
}
}
}
🛠️ Development Progress
Completed Tasks ✅
- Project Setup and Core Dependency Installation
- Created project structure
- Configured pyproject.toml with all dependencies
- Set up testing framework
- All tests passing (4/4)
In Progress 🚧
- Configuration Management System - Next up
- File Scanner and Directory Walker
- Multi-Language Parser (Tree-sitter)
- Code Metrics Calculation Engine
See .taskmaster/tasks/tasks.json for the complete task list.
🔧 Available MCP Tools (Coming Soon)
analyze_codebase- Scan and identify files requiring refactoringsuggest_refactoring- Generate AI-powered refactoring strategiesexecute_refactoring- Apply approved refactoring safelyrefactor_database- Specialized database migration handlingget_refactoring_status- Track ongoing operationsrollback_refactoring- Undo changes if needed
📊 Configuration
TaskMaster uses .taskmaster.json for project-specific configuration:
{
"thresholds": {
"maxLines": 1500,
"maxFunctions": 50,
"maxComplexity": 15,
"maxClassSize": 500
},
"languages": ["python", "javascript", "typescript"],
"excludePatterns": ["**/test/**", "**/vendor/**"],
"safety": {
"requireTests": true,
"createBackups": true,
"dryRunFirst": true
}
}
🧪 Testing
# Run all tests
python -m pytest tests/ -v
# Run with coverage
python -m pytest tests/ --cov=taskmaster --cov-report=html
# Run specific test
python -m pytest tests/test_basic.py -v
📚 Documentation
- - Complete PRD with features, architecture, and roadmap
- - Detailed server documentation
- - TaskMaster workflow guide
🤝 Contributing
This project uses TaskMaster AI for task management. To contribute:
- Review tasks:
npx task-master-ai list - Get next task:
npx task-master-ai next - Implement the task
- Run tests:
python -m pytest - Update task status:
npx task-master-ai set-status --id=<id> --status=done
📄 License
MIT License
👤 Author
Arun Kumar
Built with FastMCP 🚀 | Powered by TaskMaster AI 🤖