context-tracker-mcp
v1.0.5
Published
MCP server for tracking context, code changes, and generating documentation
Maintainers
Readme
Context Tracker MCP
एक powerful MCP agent जो आपके development context को कभी नहीं भूलता और automatic documentation generate करता है।
🚀 What's New (v1.0.0)
✅ Concurrency Control - Thread-safe operations with Mutex & ReadWriteLock
✅ Unit Testing - 70+ comprehensive Jest tests
✅ Resource Pooling - Smart caching with TTL management
✅ Error Analysis - Automatic error pattern detection
✅ Project Intelligence - Code metrics and recommendations
✅ Configuration Management - Dynamic config loading/updating
✅ NPM Package Ready - Distribute to any PC
📦 Installation & Deployment
1. Install Dependencies
# MCP Server
cd mcp
npm install
# VSCode Extension
cd vscode-extension
npm install2. Build the Project
# Build MCP Server
cd mcp
npm run build
# Build VSCode Extension
cd vscode-extension
npm run compile3. VSCode Extension Setup
- VSCode में
Ctrl+Shift+Ppress करें Extensions: Install from VSIX...select करेंvscode-extensionfolder में generated.vsixfile install करें
4. MCP Server Configuration
अपने MCP client में यह configuration add करें:
{
"mcpServers": {
"context-tracker": {
"command": "node",
"args": ["path/to/context-tracker-mcp/dist/index.js"],
"env": {
"NODE_ENV": "production"
}
}
}
}🎯 Usage
VSCode Extension Commands
Ctrl+Shift+T: Track Current ContextCtrl+Shift+H: Show Context HistoryCtrl+Shift+D: Generate Documentation- Right-click on CSS: Track Styling
Windsurf Workflows
/context-track: Start tracking new context/context-update: Update existing context/generate-docs: Generate documentation/context-error: Log an error
MCP Tools
// Track context
await trackContext('start', {
description: 'Adding user authentication',
files: ['src/auth.ts', 'components/Login.tsx']
});
// Generate documentation
const docs = await generateDocumentation('complete', 'markdown');
// Log error
await logError('TypeError: Cannot read property', 'Added null check', 'During login');
// Track styling
await trackStyling('.button', { color: 'blue', padding: '10px' }, 'styles.css');📂 Project Structure
context-tracker-mcp/
├── src/
│ ├── index.ts # MCP Server entry point
│ ├── context-tracker.ts # Core context tracking (Thread-safe)
│ ├── documentation-generator.ts # Auto documentation
│ ├── file-watcher.ts # File change monitoring
│ ├── error-analyzer.ts # Error pattern analysis ⭐ NEW
│ ├── project-intelligence.ts # Code metrics & insights ⭐ NEW
│ ├── config-manager.ts # Configuration management ⭐ NEW
│ ├── resource-manager.ts # Smart caching ⭐ NEW
│ └── mutex.ts # Concurrency control ⭐ NEW
├── tests/ # Unit tests ⭐ NEW
│ ├── context-tracker.test.ts
│ ├── config-manager.test.ts
│ ├── resource-manager.test.ts
│ ├── error-analyzer.test.ts
│ └── mutex.test.ts
├── vscode-extension/ # VSCode extension
│ └── context-tracker-vscode-1.0.0.vsix
├── .windsurf/workflows/ # Windsurf workflows
│ ├── co.md # Continue workflow ⭐ NEW
│ ├── context-track.md
│ └── generate-docs.md
├── context-data/ # Local data storage
├── DEPLOYMENT_GUIDE.md # Deployment instructions ⭐ NEW
└── README.md🔧 Configuration
VSCode Settings
{
"contextTracker.autoTrack": true,
"contextTracker.watchedPaths": ["./src", "./components", "./styles"],
"contextTracker.dataDirectory": "./context-data"
}MCP Server Options
// Custom data directory
const tracker = new ContextTracker('./my-context-data');
// Custom watched paths
await fileWatcher.initialize(['./src', './lib', './styles']);📊 Data Storage
सभी data locally store होता है:
context-data/context.json: Complete context historycontext-data/errors.json: Error log with solutionscontext-data/styling.json: Styling changes history
🎨 Examples
Starting a New Feature
# VSCode: Ctrl+Shift+T
# Description: Adding user registration system
# Files: src/auth/register.ts, components/RegisterForm.tsxLogging an Error
# VSCode: Command Palette > Log Error
# Error: Cannot read property 'email' of undefined
# Solution: Added null validation before accessing email
# Context: During user registration validationTracking Styling
/* Select this CSS in VSCode and right-click > Track Styling */
.button {
background: #007bff;
color: white;
padding: 10px 20px;
border-radius: 5px;
}Generate Documentation
# Windsurf: /generate-docs
# Type: complete
# Format: markdown🚀 Advanced Usage
Custom MCP Integration
import { ContextTracker } from './src/context-tracker.js';
const tracker = new ContextTracker();
// Track complex context
await tracker.trackContext('start', {
description: 'Building payment gateway',
files: ['src/payment/', 'components/PaymentForm.tsx'],
code: 'const payment = new PaymentProcessor();',
metadata: {
priority: 'high',
estimatedHours: 8,
dependencies: ['user-auth', 'database']
}
});Custom Documentation
import { DocumentationGenerator } from './src/documentation-generator.js';
const generator = new DocumentationGenerator(tracker);
// Generate custom documentation
const customDocs = await generator.generate('features', 'json');� Deployment to Another PC
Method 1: NPM Package (Easiest)
# On your PC (create package)
npm run build
npm pack
# Creates: context-tracker-mcp-1.0.0.tgz
# On other PC (install)
npm install -g context-tracker-mcp-1.0.0.tgz
context-tracker-mcpMethod 2: VS Code Extension
# Package extension
cd vscode-extension
vsce package
# Creates: .vsix file
# Install on other PC via VS Code
# Extensions → Install from VSIXMethod 3: Full Project
# Copy entire project folder
# On other PC:
npm install
npm run build
npm start�🐛 Troubleshooting
Common Issues
MCP Server Not Starting
npm run build node dist/index.jsVSCode Extension Not Working
- Restart VSCode
- Check MCP server is running
- Verify configuration
File Watching Not Working
- Check file permissions
- Verify watched paths exist
- Check .gitignore doesn't block files
Debug Mode
# Enable debug logging
DEBUG=context-tracker:* npm run dev🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if needed
- Submit a pull request
📄 License
MIT License - see LICENSE file for details
🙏 Acknowledgments
- MCP (Model Context Protocol) team
- VSCode extension API
- Windsurf workflow system
Made with ❤️ for developers who never want to lose context!
