MCP-based contextual flag system for AI assistants
Project description
Context Engine MCP
Note: This project was inspired by the pioneering work in SuperClaude Framework and SuperGemini Framework. Special thanks to SuperClaude-Org team members @NomenAK and @mithun50 whose work made this possible.
Context Engine provides 18 contextual flags that guide assistant behavior (e.g., --strict, --auto). It exposes an MCP stdio server and small setup helpers for common clients.
Quick Start
# Install (recommended)
pipx install context-engine-mcp
# For Claude Code
context-engine install
# For Continue
context-engine install --target cn
Then in your client/assistant, use prompts with flags:
- "Fix this bug --auto" (auto-select flags)
- "--save" (handoff documentation)
- "Analyze --strict" (precise, zero-tolerance mode)
18 Flags
| Flag | Purpose |
|---|---|
--analyze |
Multi-angle systematic analysis |
--auto |
AI selects optimal flag combination |
--collab |
Co-develop solutions through trust-based iteration |
--concise |
Minimal communication |
--discover |
Discover existing solutions before building new |
--explain |
Progressive disclosure |
--git |
Version control best practices |
--lean |
Essential focus only |
--load |
Load handoff documentation |
--parallel |
Multi-agent processing |
--performance |
Speed and efficiency optimization |
--readonly |
Analysis only mode |
--refactor |
Code quality improvement |
--reset |
Reset all flag states to new (clears session cache) |
--save |
Handoff documentation |
--seq |
Sequential thinking |
--strict |
Zero-error enforcement |
--todo |
Task management |
Installation
Claude Code
# Install package
pipx install context-engine-mcp
# Install configuration files
context-engine install
Register the MCP server with Claude CLI:
# Choose ONE of these commands:
# Standard Python installation
claude mcp add -s user -- context-engine context-engine-mcp
# UV installation
claude mcp add -s user -- context-engine uv run context-engine-mcp
# Custom command
claude mcp add -s user -- context-engine <your-command>
This also writes ~/.claude/CONTEXT-ENGINE.md and appends a reference to ~/.claude/CLAUDE.md.
Continue Extension
# Install package
pipx install context-engine-mcp
# Install configuration files
context-engine install --target cn
Edit ~/.continue/mcpServers/context-engine.yaml and uncomment ONE option:
# Option 1: Standard Python (most common)
name: Context Engine MCP
command: context-engine-mcp
# Option 2: UV installation
# name: Context Engine MCP
# command: uv
# args: ["run", "context-engine-mcp"]
# Option 3: Custom installation
# name: Context Engine MCP
# command: <your-custom-command>
Restart VS Code, then type @ in Continue chat to access MCP tools.
Gemini CLI
# Install package
pipx install context-engine-mcp
# Install configuration files for Gemini CLI
context-engine install --target gemini-cli
This command:
- Appends
@CONTEXT-ENGINE.mdto~/.gemini/GEMINI.md(adds once; no duplicate) - Writes latest instructions to
~/.gemini/CONTEXT-ENGINE.md
It does not modify ~/.gemini/settings.json.
If required, register the MCP stdio command in Gemini CLI settings:
- Command:
context-engine-mcp - Args:
[] - Transport: stdio
MCP registration (example)
- File:
~/.gemini/settings.json - Add or merge this into the
mcpServerssection:
{
"mcpServers": {
"context-engine": {
"type": "stdio",
"command": "context-engine-mcp",
"args": [],
"env": {}
}
}
}
Gemini CLI settings
- Location:
~/.gemini/settings.json - Structure:
{
"mcpServers": {
"<server-name>": {
"type": "stdio",
"command": "<executable or interpreter>",
"args": ["<arg1>", "<arg2>", "..."],
"env": { "ENV_KEY": "value" }
}
}
}
Common setups
- pipx (PATH):
{
"mcpServers": {
"context-engine": {
"type": "stdio",
"command": "context-engine-mcp",
"args": [],
"env": {}
}
}
}
- uv (run):
{
"mcpServers": {
"context-engine": {
"type": "stdio",
"command": "uv",
"args": ["run", "context-engine-mcp"],
"env": {}
}
}
}
- venv absolute path (Windows):
{
"mcpServers": {
"context-engine": {
"type": "stdio",
"command": "C:\\path\\to\\venv\\Scripts\\context-engine.exe",
"args": [],
"env": {}
}
}
}
- venv with interpreter (module run):
{
"mcpServers": {
"context-engine": {
"type": "stdio",
"command": "/path/to/venv/bin/python",
"args": ["-m", "context_engine_mcp"],
"env": {}
}
}
}
Notes
typeisstdio.- If the command is not on PATH, use an absolute path (escape backslashes on Windows).
- After editing, restart Gemini CLI and verify tools (e.g., list_available_flags).
Usage
In Chat
# Auto mode - AI selects flags
"Refactor this code --auto"
# Direct flags
"--save" # Creates handoff doc
"--analyze --strict" # Multi-angle analysis with zero errors
"--reset --analyze" # Reset session and reapply
# Combined flags
"Review this --analyze --strict --seq"
MCP Tools
list_available_flags()- Shows all 18 flagsget_directives(['--flag1', '--flag2'])- Activates flags
Development: use pip install -e . for editable installs.
Configuration updates: edit ~/.context-engine/flags.yaml and restart the MCP server.
Optional MCP Servers
Additional MCP servers can complement certain flags:
For --seq flag:
# Sequential thinking server
claude mcp add -s user -- sequential-thinking npx -y @modelcontextprotocol/server-sequential-thinking
These are optional; Context Engine works without them.
Session
- Duplicate flags produce a brief reminder instead of repeating full directives.
- Use
--resetwhen the task/context changes (resets all flag states to new). - The server tracks active flags per session.
- Note: In Claude, flag states persist through
/clearor/compactcommands. Use--resetto reinitialize.
--auto
--auto instructs the assistant to analyze the task and pick appropriate flags (do not include --auto in get_directives calls).
Behavior
--autoonly: the assistant selects a full set of flags automatically.--auto --flag1 --flag2: the assistant applies--flag1,--flag2and may add additional flags if helpful. User‑specified flags take priority when there is overlap or conflict.--flag1 --flag2(without--auto): only the specified flags are applied.
Files Created
~/.claude/
├── CLAUDE.md # References @CONTEXT-ENGINE.md
├── CONTEXT-ENGINE.md # Flag instructions (auto-updated)
├── hooks/
│ └── context-engine-hook.py # Hook for flag detection (Claude Code only)
└── settings.json # Updated with hook registration (Claude Code only)
~/.continue/
├── config.yaml # Contains Context Engine rules
└── mcpServers/
├── context-engine.yaml
├── sequential-thinking.yaml
└── context7.yaml
~/.context-engine/
└── flags.yaml # Flag definitions
~/.gemini/
├── GEMINI.md # References @CONTEXT-ENGINE.md
└── CONTEXT-ENGINE.md # Flag instructions (auto-updated)
Uninstallation
# Complete uninstall from all environments (Claude Code + Continue)
context-engine uninstall
# Remove Python package
pipx uninstall context-engine-mcp
Note: During uninstallation, ~/.context-engine/flags.yaml is backed up to ~/flags.yaml.backup_YYYYMMDD_HHMMSS before removal. During installation, existing flags.yaml is backed up and updated to the latest version.
Claude Code note: Uninstall removes the @CONTEXT-ENGINE.md reference from ~/.claude/CLAUDE.md, deletes ~/.claude/CONTEXT-ENGINE.md if present, removes the hook file from ~/.claude/hooks/context-engine-hook.py, and removes the hook registration from ~/.claude/settings.json.
Gemini CLI note: Uninstall removes the @CONTEXT-ENGINE.md reference from ~/.gemini/GEMINI.md and deletes ~/.gemini/CONTEXT-ENGINE.md if present.
Continue note: Uninstall removes the Context Engine rules from ~/.continue/config.yaml (when present) and deletes ~/.continue/mcpServers/context-engine.yaml if present.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file context_engine_mcp-2.2.1.tar.gz.
File metadata
- Download URL: context_engine_mcp-2.2.1.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8535f018e56c5f8d03235d611989489bcd0cf2877d8ddf698e463aa0a8dfde
|
|
| MD5 |
0e6ea41c2e2f78bbbadf5cf0779cdd48
|
|
| BLAKE2b-256 |
2f36e7709c25874516fa433f0656bfeeab8b1399b306db77ecfd0ee91aafee80
|
Provenance
The following attestation bundles were made for context_engine_mcp-2.2.1.tar.gz:
Publisher:
publish.yml on SuperClaude-Org/context-engine-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
context_engine_mcp-2.2.1.tar.gz -
Subject digest:
8f8535f018e56c5f8d03235d611989489bcd0cf2877d8ddf698e463aa0a8dfde - Sigstore transparency entry: 517302633
- Sigstore integration time:
-
Permalink:
SuperClaude-Org/context-engine-mcp@4dcd07e5e057ea098bb78bf19aa9155b8e02d961 -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/SuperClaude-Org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4dcd07e5e057ea098bb78bf19aa9155b8e02d961 -
Trigger Event:
push
-
Statement type:
File details
Details for the file context_engine_mcp-2.2.1-py3-none-any.whl.
File metadata
- Download URL: context_engine_mcp-2.2.1-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1c173975fba5695154ff3a7c5c409d4eecd7504c7e6bf431eee4ac22fad90f2
|
|
| MD5 |
4077970d32086ef58f5db98007d746f8
|
|
| BLAKE2b-256 |
73f8c6e17a077b73c0292b9316d6e87e3b6b95f842f11bf70dc009d303b602d5
|
Provenance
The following attestation bundles were made for context_engine_mcp-2.2.1-py3-none-any.whl:
Publisher:
publish.yml on SuperClaude-Org/context-engine-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
context_engine_mcp-2.2.1-py3-none-any.whl -
Subject digest:
b1c173975fba5695154ff3a7c5c409d4eecd7504c7e6bf431eee4ac22fad90f2 - Sigstore transparency entry: 517302635
- Sigstore integration time:
-
Permalink:
SuperClaude-Org/context-engine-mcp@4dcd07e5e057ea098bb78bf19aa9155b8e02d961 -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/SuperClaude-Org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4dcd07e5e057ea098bb78bf19aa9155b8e02d961 -
Trigger Event:
push
-
Statement type: