home / mcp / mcp context provider

MCP Context Provider

A static MCP server that provides AI models with persistent tool context, preventing context loss between chats.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "doobidoo-mcp-context-provider": {
      "command": "python",
      "args": [
        "context_provider_server.py"
      ],
      "env": {
        "AUTO_LOAD_CONTEXTS": "true",
        "CONTEXT_CONFIG_DIR": "/path/to/mcp-context-provider/contexts",
        "MCP_MEMORY_SQLITE_PATH": "/path/to/memory.db",
        "MCP_MEMORY_STORAGE_BACKEND": "sqlite_vec"
      }
    }
  }
}

You deploy the MCP Context Provider to give AI models a persistent, tool-specific context that survives across chat sessions. It loads context rules and syntax preferences at startup, injects them into every conversation, and supports automatic corrections and intelligent learning for scalable, enterprise-ready context management.

How to use

You run the MCP Context Provider as a local or remote service and connect it through your MCP client. The provider exposes tool-specific context rules, syntax conversions, and memory-enabled learning features that stay available across sessions. In practice, you load the provider at startup, restart your client to rebind the server, and then interact with the context-enabled tools within any chat session. Use the available context methods to fetch rules, apply corrections, initialize sessions, and progressively optimize contexts based on usage.

How to install

Prerequisites: you need Python installed on your system. You may also use Node/NPM for helper tooling if you choose automated installation paths.

# Option A: Automated Installation (Recommended)
# Unix/Linux/macOS
git clone https://github.com/doobidoo/MCP-Context-Provider.git
cd MCP-Context-Provider
./scripts/install.sh

# Windows
git clone https://github.com/doobidoo/MCP-Context-Provider.git
cd MCP-Context-Provider
.\	ools\install.bat
```

```
# Option B: Manual Installation from DXT
npm install -g @anthropic-ai/dxt
wget https://github.com/doobidoo/MCP-Context-Provider/raw/main/mcp-context-provider-1.2.1.dxt
# Unpack to your preferred location
# dxt unpack mcp-context-provider-1.2.1.dxt ~/mcp-context-provider
# Then follow the local setup steps as described earlier
```

```
# Option C: Installation from Source
git clone https://github.com/doobidoo/MCP-Context-Provider.git
cd MCP-Context-Provider
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Configuration

Configure the client to load the MCP Context Provider. The configuration should point to the context directory, enable automatic loading, and specify how to start the provider. Use environment variables to customize paths and startup behavior.

{
  "mcpServers": {
    "context-provider": {
      "command": "/path/to/mcp-context-provider/venv/bin/python",
      "args": ["/path/to/mcp-context-provider/context_provider_server.py"],
      "env": {
        "CONTEXT_CONFIG_DIR": "/path/to/mcp-context-provider/contexts",
        "AUTO_LOAD_CONTEXTS": "true"
      }
    }
  }
}
```

```
# Alternative system Python installation
{
  "mcpServers": {
    "context-provider": {
      "command": "python",
      "args": ["context_provider_server.py"],
      "cwd": "/path/to/MCP-Context-Provider",
      "env": {
        "CONTEXT_CONFIG_DIR": "./contexts",
        "AUTO_LOAD_CONTEXTS": "true"
      }
    }
  }
}
```

Replace the paths with your actual installation locations.

Notes and additional setup

You can run the verification script to ensure the setup is correct and then restart your client to load the MCP server. The provider loads context files from the configured contexts directory and registers itself so that all chats can access the same persistent rules and preferences.

Available tools

get_tool_context

Fetches the loaded context rules for a specific tool

get_syntax_rules

Retrieves syntax conversion rules used by the provider

list_available_contexts

Lists all loaded context categories and their tools

apply_auto_corrections

Applies automatic syntax corrections across contexts

execute_session_initialization

Initializes a chat session with memory service integration

get_session_status

Retrieves detailed status of session initialization

create_context_file

Dynamically create a new context file with validation

update_context_rules

Update existing context rules with backup and validation

add_context_pattern

Add patterns to auto-trigger sections for memory integration

analyze_context_effectiveness

Analyze context effectiveness using memory-driven insights

suggest_context_optimizations

Provide global optimization suggestions for contexts

get_proactive_suggestions

Offer proactive context suggestions for workflow improvement

auto_optimize_context

Automatically optimize contexts based on learning recommendations