Code Time Machine MCP Server
Enables AI assistants like Claude to navigate git repository history, providing insights into code evolution and helping understand legacy systems.
README
Code Time Machine MCP Server
A revolutionary MCP (Model Context Protocol) server that allows AI assistants like Claude to navigate through git repository history like a time machine, providing deep insights into code evolution and helping understand legacy systems.
Features
- Time Travel Navigation: Navigate to any point in repository history by date, commit, tag, or relative time
- Code Evolution Analysis: Track how files and functions evolved over time with detailed metrics
- Code Archaeology: Understand why code was written, who contributed, and how it changed
- Pattern Detection: Identify architectural shifts, refactoring patterns, and technical debt
- AI-Powered Insights: Get intelligent analysis of code changes and recommendations
- Visual Timeline: Generate visual representations of code evolution
- Ownership Tracking: See how code ownership evolved over time
Installation
Automated Setup (Recommended)
Windows:
# Run the automated setup script
./setup.bat
# OR
./manual-setup.bat
Manual Setup:
- Install dependencies:
cd C:\Ashlesha\code-time-machine-mcp
npm install
- Test the setup:
node test-setup.js
- Make sure Git is installed and accessible:
git --version
Configuration
For Claude Desktop
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"code-time-machine": {
"command": "node",
"args": ["C:/path/to/code-time-machine-mcp/src/index.js"],
"env": {
"DEFAULT_REPO_PATH": "C:/path/to/your/projects"
}
}
}
}
Usage
Once configured, you can use Claude to explore your code repositories through time:
Time Travel
- "Show me what this repository looked like 6 months ago"
- "Navigate to the commit where user authentication was added"
- "Take me to January 1st, 2023 in the codebase"
- "Go back 30 days in the repository history"
Code Evolution
- "How has the authentication module evolved over the past year?"
- "Show me all changes to the payment processing system"
- "Track the evolution of the UserController class"
- "When was error handling added to this function?"
Code Archaeology
- "Generate an archaeology report for the database layer"
- "Who has contributed most to this file?"
- "Why was this code written this way?"
- "What major architectural decisions were made?"
Pattern Analysis
- "Detect architectural shifts in the codebase"
- "Find all major refactorings in the last 6 months"
- "Identify technical debt accumulation areas"
- "Show me code ownership patterns"
Available Tools
- time_travel: Navigate to specific points in repository history
- analyze_evolution: Track how files or functions evolved over time
- find_code_introduction: Find when and why specific code was introduced
- compare_implementations: Compare code implementations across time periods
- archaeology_report: Generate comprehensive code archaeology reports
- visualize_code_ownership: Show code ownership evolution
- detect_architectural_shifts: Identify major architectural changes
Tool Examples
Time Travel
Input: {
"repo_path": "/path/to/repo",
"destination": {
"type": "date",
"date": "2023-06-15"
}
}
Analyze Evolution
Input: {
"repo_path": "/path/to/repo",
"file_path": "src/auth/UserController.js",
"time_range": {
"from": "2023-01-01",
"to": "2023-12-31"
}
}
Code Archaeology
Input: {
"repo_path": "/path/to/repo",
"target_path": "src/database/",
"depth": "deep",
"include_contributors": true
}
Advanced Features
Caching
The server includes intelligent caching to improve performance when analyzing large repositories.
Pattern Recognition
- Identifies common refactoring patterns
- Detects code smells and technical debt
- Recognizes architectural patterns
AI Integration
The server prepares data in a format optimized for AI analysis, allowing Claude to:
- Generate insights about code quality
- Suggest refactoring opportunities
- Explain complex code evolution
- Predict future maintenance needs
Development
Project Structure
code-time-machine-mcp/
├── src/
│ ├── index.js # Main server file
│ ├── tools/ # Individual tool implementations
│ ├── analyzers/ # Code analysis utilities
│ └── utils/ # Helper functions
├── cache/ # Analysis cache (gitignored)
├── .env # Environment variables (gitignored)
├── .gitignore # Git ignore file
├── package.json # Project dependencies
└── README.md # This file
Extending the Server
To add new analysis capabilities:
- Create a new tool in the
toolsobject - Implement the analysis logic
- Add appropriate caching if needed
- Update the documentation
Performance Considerations
- Large repositories may take time to analyze initially
- Caching significantly improves subsequent analyses
- Consider using shallow clones for very large repositories
- The server respects Git's performance optimizations
Troubleshooting
Common Issues
- "Git not found" error: Ensure Git is installed and in your PATH
- Permission errors: Make sure you have read access to the repositories
- Memory issues: For large repos, increase Node.js memory limit:
node --max-old-space-size=4096 src/index.js
Roadmap
- [ ] Support for multiple repository comparison
- [ ] Integration with code quality metrics
- [ ] Machine learning models for code prediction
- [ ] Support for other version control systems (SVN, Mercurial)
- [ ] Real-time repository monitoring
- [ ] Advanced visualization exports
- [ ] Integration with CI/CD insights
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with the Model Context Protocol SDK
- Powered by simple-git for Git operations
- Uses diff and parse-diff for code analysis
Support
For issues, questions, or suggestions, please open an issue on GitHub.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.