Context Control MCP
README.md
# <CC/> Context Control MCP
> **Git-powered context management for AI sessions**
[](https://www.npmjs.com/package/@context-control/mcp)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
**Context Control MCP** reduces AI session context from **200k tokens** to **3k tokens** using intelligent Git integration, smart resume capabilities, and automated roadmap tracking.
---
## π― **Problem Solved**
Traditional AI sessions lose context when hitting token limits (~200k), requiring manual re-explanation of complex projects. **Context Control MCP** bridges sessions intelligently with automated context preservation.
## β‘ **Key Features**
### π **Smart Session Management**
- **`smart_resume`** - Ultra-compact briefing for instant session recovery
- **`iniciar_sesion`** - Auto-loads project context from meta-context.md
- **`guardar_progreso`** - Logs session progress automatically
### π **Intelligent Dashboards**
- **`metrics_dashboard`** - Complete project metrics + ROI tracking
- **`roadmap_status`** - Visual progress tracking across project phases
- **Token optimization stats** - 93% reduction achieved
### π§ **Git Integration**
- **Smart git hooks** - Auto-detect project phases from file patterns
- **`document_changes`** - Analyzes Git changes + suggests commit types
- **Pattern recognition** - `[FASE-X]`, `feat:`, `fix #XXX`, `todo:` detection
### πΊοΈ **Interactive Roadmaps**
- **Auto-updating roadmaps** based on commit patterns
- **Phase detection** from modified files (`src/auth/*` β Auth phase)
- **Progress estimation** with velocity tracking
---
## π **Quick Start**
### Installation
```bash
npm install @context-control/mcp
```
### Basic Setup
```bash
# Initialize Context Control MCP
npm run ccmcp:hooks # Install git hooks
npm run ccmcp:start # Start MCP server
```
### CLI Commands
```bash
npm run ccmcp:resume # Smart resume briefing
npm run ccmcp:dashboard # View metrics dashboard
npm run ccmcp:status # Check roadmap progress
```
---
## π **Available Commands**
| Command | Description |
|---------|-------------|
| `iniciar_sesion` | Load project context automatically |
| `smart_resume` | Generate ultra-compact session briefing |
| `guardar_progreso` | Log current session progress |
| `document_changes` | Analyze Git changes + suggest commits |
| `metrics_dashboard` | Complete project metrics + ROI |
| `roadmap_status` | Visual roadmap with phase progress |
| `setup_hooks` | Install Git hooks automatically |
| `crear_commit` | Generate descriptive Git commits |
| `generar_reporte` | Create project status reports |
---
## π― **Automatic Pattern Detection**
### File-Based Phase Detection
```
src/components/auth/* β Authentication Phase
src/components/projects/* β CRUD Projects Phase
src/components/voting/* β Voting System Phase
tests/* β Testing Phase
docs/* β Documentation Phase
.claude/* β MCP System Phase
```
### Commit Message Patterns
```
[FASE-X] message β Updates phase X progress
feat: new feature β Adds feature to completed
fix #123 bug desc β Marks issue #123 as resolved
todo: task desc β Adds task to pending list
```
---
## π **Token Optimization Results**
| Metric | Before | After | Improvement |
|--------|--------|-------|-------------|
| **Context Size** | 200k tokens | 3k tokens | **93% reduction** |
| **Session Recovery** | Manual (~30 min) | Automated (~30 sec) | **60x faster** |
| **ROI** | N/A | Positive after 5 sessions | **Measurable** |
---
## π οΈ **Configuration**
### MCP Server Config (`mcp-config.json`)
```json
{
"mcpServers": {
"context-control": {
"command": "node",
"args": ["./context-control-server.js"],
"description": "Context Control MCP - Git-powered context management"
}
}
}
```
### Project Structure
```
project/
βββ .claude/
β βββ meta-context.md # Auto-updated project context
β βββ session-log.jsonl # Session history + metrics
βββ docs/
β βββ ROADMAP-INTERACTIVE.md # Auto-updating roadmap
βββ context-control-server.js # MCP server
βββ mcp-config.json # Configuration
```
---
## π **Metrics Dashboard Example**
```
π METRICS DASHBOARD - Your Project
βββββββββββββββββββββββββββββββββββββββ
π― PROGRESO DEL PROYECTO
βββββββββββββββββββββββββββββββββββββββ
β β
Completado: 15 tareas β
β β³ Pendiente: 23 tareas β
β π Progreso: 65% completado β
β β° EstimaciΓ³n: 2 semanas restante β
βββββββββββββββββββββββββββββββββββββββ
π° ROI SISTEMA MCP
βββββββββββββββββββββββββββββββββββββββ
β π½ Tokens ahorrados: 168,000 β
β π΅ Ahorro monetario: $3.36 USD β
β π ROI: +45.2% β
β β‘ Eficiencia: 93% reducciΓ³n β
βββββββββββββββββββββββββββββββββββββββ
```
---
## π§ **Advanced Usage**
### Custom Phase Detection
Add your own patterns in `context-control-server.js`:
```javascript
// Custom phase detection
if (staggedFiles.includes('src/api/')) {
phaseDetected = "API Development Phase";
}
```
### Integration with CI/CD
```yaml
# .github/workflows/context-control.yml
- name: Update Context
run: npm run ccmcp:dashboard
```
---
## π€ **Contributing**
1. Fork the repository
2. Create feature branch (`git checkout -b feature/amazing`)
3. Commit with patterns (`git commit -m "feat: amazing feature [FASE-X]"`)
4. Push to branch (`git push origin feature/amazing`)
5. Open Pull Request
---
## π **License**
MIT License - see [LICENSE](LICENSE) file for details.
---
## π **Why Context Control MCP?**
- **π Instant session recovery** - No more re-explaining projects
- **π Data-driven insights** - Track progress, velocity, and ROI
- **π§ Git-native** - Works with your existing workflow
- **β‘ Token efficient** - 93% reduction in context size
- **π― Phase-aware** - Automatically detects what you're working on
---
<div align="center">
**Made with β€οΈ for developers tired of losing context**
[Report Bug](https://github.com/context-control/mcp/issues) β’ [Request Feature](https://github.com/context-control/mcp/issues) β’ [Documentation](https://github.com/context-control/mcp/wiki)
</div>This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues