Skip to main content
Glama

Context Control MCP

Git-powered context management for AI sessions

npm version License: MIT Node.js Version

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.

Related MCP server: Memory Journal MCP Server

⚑ 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

npm install @context-control/mcp

Basic Setup

# Initialize Context Control MCP
npm run ccmcp:hooks    # Install git hooks
npm run ccmcp:start    # Start MCP server

CLI Commands

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)

{
  "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:

// Custom phase detection
if (staggedFiles.includes('src/api/')) {
  phaseDetected = "API Development Phase";
}

Integration with CI/CD

# .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 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


Made with ❀️ for developers tired of losing context

Report Bug β€’ Request Feature β€’ Documentation

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers