The stable, glowing orb at the center represents the persistent context that survives across chat sessions. The flowing data streams show how ongoing conversations connect to and draw from this stable core of information, preventing context loss. A static MCP (Model Context Protocol) server that provides AI models with persistent tool context, preventing context loss between chat sessions. This se
Add this skill
npx mdskills install doobidoo/mcp-context-providerComprehensive MCP server providing persistent context management with intelligent learning capabilities
1# MCP Context Provider23<div align="center">4 <img src="assets/MCP-CONTEXT-PROVIDER.png" alt="MCP Context Provider Architecture" width="600"/>56 *The stable, glowing orb at the center represents the persistent context that survives across chat sessions. The flowing data streams show how ongoing conversations connect to and draw from this stable core of information, preventing context loss.*7</div>89A static MCP (Model Context Protocol) server that provides AI models with persistent tool context, preventing context loss between chat sessions. This server automatically loads and injects tool-specific rules, syntax preferences, and best practices at Claude Desktop startup.1011## Overview1213The Context Provider acts as a **persistent neural core** for your AI interactions, eliminating the need to re-establish context in each new chat session by:1415- ๐ **Persistent Context**: Like the stable orb in the visualization, rules and preferences survive across Claude Desktop restarts16- โก **Automatic Injection**: Context flows seamlessly into every conversation, just as the data streams connect to the central core17- ๐ฏ **Tool-Specific**: Each tool gets its own context rules and syntax preferences, creating specialized knowledge pathways18- ๐ง **Auto-Corrections**: Automatic syntax transformations (e.g., Markdown โ DokuWiki) ensure consistency across all interactions19- ๐ **Scalable**: Easy to add new tools and context rules, expanding the knowledge network20- ๐ข **Enterprise-Ready**: Version-controlled context management provides organizational stability2122## The Neural Network Metaphor2324Just like the image depicts, your MCP Context Provider functions as:25- **Central Orb**: The stable, persistent context core that maintains consistency26- **Neural Pathways**: Tool-specific context rules that create specialized knowledge channels27- **Data Streams**: Individual chat sessions that flow through and benefit from the persistent context28- **Network Stability**: Prevents the ephemeral nature of conversations from losing important contextual information2930## Quick Start3132### Option 1: Automated Installation (Recommended)3334The easiest way to install MCP Context Provider is using the provided installation scripts:3536**Unix/Linux/macOS:**37```bash38# Clone the repository (contains latest source files)39git clone https://github.com/doobidoo/MCP-Context-Provider.git40cd MCP-Context-Provider4142# Run the automated installer (builds fresh package)43./scripts/install.sh44```4546**Windows:**47```powershell48# Clone the repository first49git clone https://github.com/doobidoo/MCP-Context-Provider.git50cd MCP-Context-Provider5152# Run the Windows installer53.\scripts\install.bat54```5556The installation script automatically:57- Builds the latest DXT package from source58- Creates a Python virtual environment59- Installs all required dependencies60- Configures Claude Desktop settings6162### Option 2: Manual Installation from DXT6364```bash65# Install DXT CLI (if not already installed)66npm install -g @anthropic-ai/dxt6768# Download the DXT package69wget https://github.com/doobidoo/MCP-Context-Provider/raw/main/mcp-context-provider-1.2.1.dxt7071# Unpack the extension to your desired location72dxt unpack mcp-context-provider-1.2.1.dxt ~/mcp-context-provider7374# Navigate to the installation directory75cd ~/mcp-context-provider7677# Create and activate a Python virtual environment78python -m venv venv79source venv/bin/activate # On Windows: venv\Scripts\activate8081# Install dependencies82pip install mcp>=1.9.483```8485### Option 3: Installation from Source8687```bash88# Clone the repository89git clone https://github.com/doobidoo/MCP-Context-Provider.git90cd MCP-Context-Provider9192# Create and activate a Python virtual environment93python -m venv venv94source venv/bin/activate # On Windows: venv\Scripts\activate9596# Install dependencies97pip install -r requirements.txt98```99100### 2. Configuration101102Update your Claude Desktop configuration file:103104**Configuration File Location**:105- **Linux**: `~/.config/claude/claude_desktop_config.json`106- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`107- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`108109**For Virtual Environment Installation (Recommended):**110```json111{112 "mcpServers": {113 "context-provider": {114 "command": "/path/to/mcp-context-provider/venv/bin/python",115 "args": ["/path/to/mcp-context-provider/context_provider_server.py"],116 "env": {117 "CONTEXT_CONFIG_DIR": "/path/to/mcp-context-provider/contexts",118 "AUTO_LOAD_CONTEXTS": "true"119 }120 }121 }122}123```124125**For System Python Installation:**126```json127{128 "mcpServers": {129 "context-provider": {130 "command": "python",131 "args": ["context_provider_server.py"],132 "cwd": "/path/to/MCP-Context-Provider",133 "env": {134 "CONTEXT_CONFIG_DIR": "./contexts",135 "AUTO_LOAD_CONTEXTS": "true"136 }137 }138 }139}140```141142**Important**: Replace `/path/to/mcp-context-provider` with the actual installation path.143144### 3. Verify Installation145146Run the verification script to ensure everything is configured correctly:147148```bash149python scripts/verify_install.py150```151152### 4. Restart Claude Desktop153154After updating the configuration, restart Claude Desktop to load the MCP server.155156## How It Works157158### Architecture1591601. **Context Provider Server**: Python MCP server that loads JSON context files1612. **Context Files**: Tool-specific rules stored in `/contexts` directory1623. **Claude Desktop Integration**: MCP server registered in configuration1634. **Automatic Loading**: Context is injected at startup and persists across chats164165### Context Flow166167```168Startup โ Load Context Files โ Register MCP Tools โ Context Available in All Chats169```170171### Available Tools172173Once loaded, the following tools are available in all chat sessions:174175**Core Context Tools:**176- `get_tool_context`: Get context rules for specific tool177- `get_syntax_rules`: Get syntax conversion rules178- `list_available_contexts`: List all loaded context categories179- `apply_auto_corrections`: Apply automatic syntax corrections180181**Phase 1 - Session Management:**182- `execute_session_initialization`: Initialize session with memory service integration183- `get_session_status`: Retrieve detailed session initialization status184185**Phase 2 - Dynamic Context Management:**186- `create_context_file`: Create new context files dynamically with validation187- `update_context_rules`: Update existing context rules with backup and validation188- `add_context_pattern`: Add patterns to auto-trigger sections for memory integration189190**Phase 3 - Intelligent Learning (v1.6.0+):**191- `analyze_context_effectiveness`: Analyze context effectiveness with memory-driven insights192- `suggest_context_optimizations`: Generate global optimization suggestions based on usage patterns193- `get_proactive_suggestions`: Provide proactive context suggestions for workflow improvement194- `auto_optimize_context`: Automatically optimize contexts based on learning engine recommendations195196<div align="center">197 <img src="assets/Get-tool-specific-context-rules.png" alt="MCP Context Provider Tools in Action" width="800"/>198199 *Screenshot showing the MCP Context Provider in action within Claude Desktop. The tool automatically detects and lists all available context categories (dokuwiki, terraform, azure, git, general_preferences) and provides interactive access to tool-specific rules and guidelines.*200</div>201202## Context Files203204The server loads context files from the `/contexts` directory:205206- **`dokuwiki_context.json`**: DokuWiki syntax rules and preferences207- **`terraform_context.json`**: Terraform naming conventions and best practices208- **`azure_context.json`**: Azure resource naming and compliance rules209- **`git_context.json`**: Git commit conventions and workflow patterns210- **`general_preferences.json`**: Cross-tool preferences and standards211212### Context File Structure213214Each context file follows this pattern:215216```json217{218 "tool_category": "toolname",219 "description": "Tool-specific context rules",220 "auto_convert": true,221 "syntax_rules": {222 "format_rules": "conversion patterns"223 },224 "preferences": {225 "user_preferences": "settings"226 },227 "auto_corrections": {228 "regex_patterns": "automatic fixes"229 },230 "metadata": {231 "version": "1.0.0",232 "applies_to_tools": ["tool:*"]233 }234}235```236237## Examples238239### DokuWiki Syntax Conversion240241Input (Markdown):242```markdown243# My Header244This is `inline code` and here's a [link](http://example.com).245```246247Auto-converted to DokuWiki:248```249====== My Header ======250This is ''inline code'' and here's a [[http://example.com|link]].251```252253### Azure Resource Naming254255Input: `storage_account_logs_prod`256Auto-corrected to: `stlogsprod` (following Azure naming conventions)257258### Git Commit Messages259260Input: `Fixed the login bug`261Auto-corrected to: `fix: resolve login authentication issue`262263## Adding New Context264265To add support for a new tool:2662671. Create a new JSON file: `contexts/{toolname}_context.json`2682. Follow the standard context structure2693. Restart Claude Desktop to load the new context270271The server automatically detects and loads any `*_context.json` files in the contexts directory.272273## Benefits274275### For Developers276- No need to re-establish context in new chats277- Automatic syntax corrections save time278- Consistent formatting across all work279- Best practices automatically applied280281### For Teams282- Shared context rules across team members283- Version-controlled standards284- Consistent code and documentation formatting285- Enterprise compliance automatically enforced286287### For Organizations288- Centralized context management289- Scalable across multiple tools290- Audit trail of context changes291- Easy deployment and updates292293## ๐ง Phase 3: Intelligent Learning System (v1.6.0+)294295### Revolutionary Learning Capabilities296297Version 1.6.0 introduces the **Synergistic Integration with Intelligent Learning** system, transforming the MCP Context Provider from a static configuration tool into an intelligent, self-improving context evolution platform.298299### ๐ฏ Key Learning Features300301#### **Intelligent Context Evolution**302- **Automatic Effectiveness Analysis**: Contexts self-analyze based on usage patterns and memory data303- **Smart Optimization Suggestions**: AI-driven recommendations for context improvements304- **Auto-Optimization**: Contexts automatically improve through pattern learning and preference tuning305- **Proactive Intelligence**: Suggests missing tool contexts and workflow enhancements306307#### **Real Memory Service Integration**308- **Persistent Learning**: Full integration with `mcp-memory-service` for persistent learning data309- **Usage Pattern Tracking**: Comprehensive tracking of context modifications and effectiveness310- **Memory-Driven Insights**: Historical data analysis for continuous improvement311- **Team Knowledge Propagation**: Shared learning insights across team members312313#### **Advanced MCP Tools**3144 new intelligent tools for context management:315- `analyze_context_effectiveness`: Memory-driven effectiveness analysis316- `suggest_context_optimizations`: Global optimization recommendations317- `get_proactive_suggestions`: Workflow improvement suggestions318- `auto_optimize_context`: Automatic context optimization based on learning319320### ๐ Learning Workflow321322```323Context Usage โ Memory Storage โ Pattern Analysis โ Optimization Suggestions โ Auto-Improvement324 โ โ โ โ โ325Session Data โ Learning Engine โ Effectiveness Score โ Proactive Recommendations โ Enhanced Contexts326```327328### ๐ Learning Metrics329330The system tracks and analyzes:331- **Context Effectiveness Scores** (0.0-1.0 scale)332- **Usage Pattern Recognition** (frequency, modifications, interactions)333- **Session Performance Optimization** (sub-second initialization targets)334- **Memory-Driven Trend Analysis** (historical usage and improvement data)335336### ๐ Phase 3 Setup337338**Prerequisites**: Requires `mcp-memory-service` integration3393401. **Configure Memory Service** (`.mcp.json`):341```json342{343 "mcpServers": {344 "memory": {345 "command": "/path/to/uv",346 "args": ["--directory", "/path/to/mcp-memory-service", "run", "memory"],347 "env": {348 "MCP_MEMORY_STORAGE_BACKEND": "sqlite_vec",349 "MCP_MEMORY_SQLITE_PATH": "/path/to/memory.db"350 }351 },352 "context-provider": {353 "command": "python",354 "args": ["context_provider_server.py"],355 "env": {356 "CONTEXT_CONFIG_DIR": "./contexts",357 "AUTO_LOAD_CONTEXTS": "true"358 }359 }360 }361}362```3633642. **Test Learning Features**:365```bash366# Run comprehensive Phase 3 tests367python tests/test_phase3_learning.py368369# Check learning engine health370python -c "371from context_provider_server import ContextProvider372import asyncio373async def test():374 provider = ContextProvider()375 stats = await provider.memory_service.get_memory_stats()376 print(f'Learning system status: {stats}')377asyncio.run(test())378"379```380381### ๐ Phase 3 Documentation382383- **[Learning System Guide](docs/phase3/LEARNING_GUIDE.md)**: Comprehensive guide to intelligent features384- **[API Reference](docs/phase3/API_REFERENCE.md)**: Complete API documentation for learning components385- **[Examples & Use Cases](docs/phase3/EXAMPLES.md)**: Practical examples and enterprise use cases386387### ๐ Implementation Roadmap Complete388389**โ Phase 1**: Session initialization with memory service integration390**โ Phase 2**: Dynamic context file creation and management391**โ Phase 3**: Synergistic integration with intelligent learning392393The MCP Context Provider now offers enterprise-ready intelligent context evolution with self-improving contexts that learn from usage patterns and automatically optimize through real memory service integration.394395## Advanced Usage396397### Custom Context Rules398399Create your own context files by following the established pattern. The server supports:400401- Regex-based auto-corrections402- Tool-specific preferences403- Conditional formatting rules404- Multi-tool context inheritance405406### Environment-Specific Context407408Use environment variables to load different context sets:409410```json411{412 "env": {413 "CONTEXT_CONFIG_DIR": "./contexts/production",414 "ENVIRONMENT": "prod"415 }416}417```418419## Troubleshooting420421### Common Issues4224231. **Context not loading**: Check file path in Claude Desktop config4242. **Server not starting**: Verify Python dependencies installed4253. **Rules not applying**: Check JSON syntax in context files426427See [TROUBLESHOOTING.md](docs/guides/TROUBLESHOOTING.md) for detailed solutions.428429## Documentation430431- [Context Guide](docs/guides/CONTEXT_GUIDE.md): Complete context file reference432- [Developer Guide](docs/guides/DEVELOPER_GUIDE.md): Creating custom contexts433- [Examples](docs/EXAMPLES.md): Real-world usage examples434- [Troubleshooting](docs/guides/TROUBLESHOOTING.md): Common issues and solutions435436## ๐ Wiki & Use Cases437438Explore advanced integrations and real-world use cases in our **[Community Wiki](https://github.com/doobidoo/MCP-Context-Provider/wiki)**:439440- **[Wiki Homepage](https://github.com/doobidoo/MCP-Context-Provider/wiki)**: Comprehensive guide to what the Context Provider is good for441- **[AppleScript with Memory Integration](https://github.com/doobidoo/MCP-Context-Provider/wiki/AppleScript-with-Memory-Integration)**: Advanced workflow showcasing intelligent script management with persistent memory442- **Integration Examples**: Community-driven examples of Context Provider workflows443- **Best Practices**: Tips and patterns for maximizing Context Provider effectiveness444445*The wiki demonstrates how the Context Provider transforms from simple rule storage into intelligent, self-improving workflow automation.*446447## DXT Package Distribution448449The MCP Context Provider is available as a Desktop Extension (DXT) package for easy distribution and installation:450451- **Package**: `mcp-context-provider-1.0.0.dxt` (18.6 MB)452- **Contents**: Complete server with all dependencies bundled453- **Platform**: Windows, macOS, Linux with Python 3.8+454- **Dependencies**: Self-contained (no external pip requirements)455456### Building DXT Package457458To build your own DXT package from source:459460```bash461# Install DXT CLI462npm install -g @anthropic-ai/dxt463464# Build the package465cd dxt466dxt pack467468# The package will be created as mcp-context-provider-1.0.0.dxt469```470471### Distribution Notes472473- The DXT package includes all Python dependencies (MCP SDK, Pydantic, etc.)474- Total unpacked size: ~45 MB including all dependencies475- Optimized for offline installation and deployment476- Compatible with corporate environments and air-gapped systems477478## Contributing4794801. Fork the repository4812. Create a feature branch: `git checkout -b feature/new-context`4823. Add your context file to `/contexts`4834. Test with your Claude Desktop setup4845. Submit a pull request485486## License487488MIT License - see [LICENSE](LICENSE) file for details.489
Full transparency โ inspect the skill content before installing.