This is a complete, step-by-step Windows deployment manual for the Context Engine MCP Server. It is written for beginners and covers installation, configuration, verification, and maintenance.
Shorter references:
docs/archive/QUICKSTART.md,docs/archive/GET_STARTED.md, anddocs/WINDOWS_SERVER_MANAGEMENT.md.
Windows PC
│
├─ Node.js + npm
├─ Context Engine (this repo)
└─ MCP Client (Codex CLI)
│
└─ Connects via stdio to:
C:\path\to\context-engine\dist\index.js
You’ll install prerequisites, build the server, register it once with Codex CLI, and then reuse that setup across repos.
- Install Node.js 18+
npm install -g @openai/codexnpm installnpm run build- Set
CE_AI_PROVIDER=openai_sessionand runcodex login codex mcp add context-engine -- node "C:\path\to\context-engine\dist\index.js"- Open Codex CLI from the repo you want to inspect
- Start Codex CLI ->
/mcp-> run a test query
If any step fails, follow the detailed walkthrough below.
- Windows 10/11 (Windows 7+ may work but is not recommended)
- Node.js 18+
- Internet access (for installing dependencies and authentication)
- Disk space: ~1–2 GB for node_modules + build output
- Download the LTS version from the official Node.js site.
- During installation, keep “Add to PATH” checked.
- Verify in PowerShell:
Expected: Node
node --version npm --version
v18.x.xor higher and npm prints a version.
If node isn’t found: close PowerShell and open a new one.
git --versionIf Git isn’t installed, you can download the repository as a ZIP file instead.
npm install -g @openai/codex
codex --versioncd C:\path\to\projects
git clone <REPO_URL> context-engine
cd context-engine- Download the repo ZIP.
- Extract it to:
C:\path\to\context-engine - Open PowerShell:
cd C:\path\to\context-engine
You’ll need the full path to this folder.
pwdExample output:
Path
----
C:\path\to\context-engine
npm installExpected: Packages install without errors.
npm run buildExpected: A dist\index.js file appears.
$env:CE_AI_PROVIDER = "openai_session"
$env:CE_OPENAI_SESSION_CMD = "cmd"
$env:CE_OPENAI_SESSION_ARGS_JSON = "[`"/d`",`"/s`",`"/c`",`"D:\\npm-global\\codex.cmd`"]"
codex login
codex login statusOr use .env:
copy .env.example .env
notepad .envSet values:
CE_AI_PROVIDER=openai_session
CE_OPENAI_SESSION_CMD=cmd
CE_OPENAI_SESSION_ARGS_JSON=["/d","/s","/c","D:\\npm-global\\codex.cmd"]
Tip:
.envis easiest for beginners; environment variables are for advanced setups.
node dist\index.js --helpExpected: Help output with CLI options.
Context Engine now chooses its workspace at startup like this:
- explicit
--workspacewins - otherwise it uses the current working directory
- if you launch from a nested folder inside a git repo, it falls back to the nearest git root
- if no git root exists, it stays on the current folder and logs a warning
That means the normal day-to-day flow is:
- register the MCP server once
- open the repo you want to work in
- let the server resolve the workspace automatically
Use --workspace "C:\path\to\repo" only when you want to force a specific repo.
If startup auto-index is enabled:
- missing or stale workspaces start background indexing automatically
- the server still starts first
- the first query may be slower until indexing finishes
You can disable startup auto-index with:
$env:CE_AUTO_INDEX_ON_STARTUP = "false".\manage-server.bat startExpected output (example):
[INFO] Starting Context Engine MCP Server...
[INFO] Workspace: C:\path\to\context-engine\.
[INFO] Indexing: Enabled
[INFO] File watching: Enabled
[INFO] Log file: C:\path\to\context-engine\.server.log
[SUCCESS] Server started with PID: 12345
.\manage-server.bat status.\manage-server.bat stopFor full script usage and log tips, see docs/WINDOWS_SERVER_MANAGEMENT.md.
codex mcp add context-engine -- node "C:\path\to\context-engine\dist\index.js"This registers Context Engine once. After that, open any repo and let the server resolve the workspace automatically. Use --workspace "C:\path\to\your-project" only when you want to force a specific repo.
If startup auto-index feels too heavy on a large repo, add this to the client environment block later:
CE_AUTO_INDEX_ON_STARTUP = "false"- Open config:
mkdir -Force $env:USERPROFILE\.codex notepad $env:USERPROFILE\.codex\config.toml
- Add:
[mcp_servers.context-engine] command = "node" args = [ "C:\\path\\to\\context-engine\\dist\\index.js" ]
- (Optional) Add environment settings under the same block:
[mcp_servers.context-engine.env] # Core indexing + caching CE_INDEX_STATE_STORE = "true" CE_SKIP_UNCHANGED_INDEXING = "true" CE_TOOL_RESPONSE_CACHE = "true" CE_INTERNAL_REQUEST_CACHE = "true" CE_METRICS = "true" CE_HTTP_METRICS = "true" # CE_HASH_NORMALIZE_EOL = "true" # Auth (replace with real values) CE_AI_PROVIDER = "openai_session" CE_OPENAI_SESSION_CMD = "codex" # Startup behavior CE_AUTO_INDEX_ON_STARTUP = "true" # Reactive Review Configuration REACTIVE_ENABLED = "true" REACTIVE_PARALLEL_EXEC = "true" REACTIVE_COMMIT_CACHE = "true" REACTIVE_SQLITE_BACKEND = "true" REACTIVE_GUARDRAILS = "true" REACTIVE_USE_AI_AGENT_EXECUTOR = "true" REACTIVE_ENABLE_MULTILAYER_CACHE = "true" REACTIVE_ENABLE_BATCHING = "true" # Tuning Parameters REACTIVE_BATCH_SIZE = "5" REACTIVE_MAX_WORKERS = "5" REACTIVE_OPTIMIZE_WORKERS = "true" REACTIVE_TOKEN_BUDGET = "10000" REACTIVE_CACHE_TTL = "300000" REACTIVE_STEP_TIMEOUT = "60000" REACTIVE_MAX_RETRIES = "2" REACTIVE_SESSION_TTL = "3600000" REACTIVE_MAX_SESSIONS = "100" REACTIVE_EXECUTION_TIMEOUT = "600000"
- Save the file.
Note: If you set
CE_HTTP_METRICS = "true", you must also start the server with--httpto expose metrics. SeeREADME.mdfor details.
If you want to force a specific workspace from this one-time setup, add
--workspace "C:\\path\\to\\your-project"once. Do not create separate per-repo config entries.
| Setting | What it does | Beginner note |
|---|---|---|
CE_INDEX_STATE_STORE |
Stores per-file hashes to speed up reindexing | Good default for larger repos |
CE_SKIP_UNCHANGED_INDEXING |
Skips files that haven’t changed | Requires CE_INDEX_STATE_STORE=true |
CE_TOOL_RESPONSE_CACHE |
Caches tool responses across runs | Faster repeated queries |
CE_INTERNAL_REQUEST_CACHE |
Caches work inside a single request | Safe performance boost |
CE_METRICS |
Enables internal metrics collection | No effect unless you read metrics |
CE_HTTP_METRICS |
Exposes /metrics over HTTP |
Requires --http when starting |
CE_HASH_NORMALIZE_EOL |
Normalizes CRLF/LF when hashing | Helpful on mixed Windows/Linux teams |
CE_AI_PROVIDER |
Active AI provider | Set to openai_session |
CE_OPENAI_SESSION_CMD |
Command used for session provider | Default is codex |
CE_AUTO_INDEX_ON_STARTUP |
Background-index missing or stale workspaces on startup | Set to false to opt out |
REACTIVE_ENABLED |
Turns on reactive review features | Required for reactive review tools |
REACTIVE_PARALLEL_EXEC |
Runs reactive steps in parallel | Faster on multi-core CPUs |
REACTIVE_COMMIT_CACHE |
Caches by commit hash | Better cache consistency |
REACTIVE_SQLITE_BACKEND |
Persists session state in SQLite | Helps with recovery |
REACTIVE_GUARDRAILS |
Adds validation/guardrails | Safer reactive reviews |
REACTIVE_USE_AI_AGENT_EXECUTOR |
Use local AI agent execution | Boosts speed if supported |
REACTIVE_ENABLE_MULTILAYER_CACHE |
Enables multi-layer caching | Improves repeat performance |
REACTIVE_ENABLE_BATCHING |
Batches review work | Faster for large PRs |
REACTIVE_BATCH_SIZE |
Number of items per batch | Adjust if reviews are slow |
REACTIVE_MAX_WORKERS |
Max parallel workers | Start with 4–6 |
REACTIVE_OPTIMIZE_WORKERS |
Auto-tunes worker count | Good default |
REACTIVE_TOKEN_BUDGET |
Max tokens per review session | Increase for large reviews |
REACTIVE_CACHE_TTL |
Cache time-to-live (ms) | 300000 = 5 minutes |
REACTIVE_STEP_TIMEOUT |
Step timeout (ms) | 60000 = 1 minute |
REACTIVE_MAX_RETRIES |
Retry count for failed steps | 1–2 recommended |
REACTIVE_SESSION_TTL |
Session cleanup TTL (ms) | 3600000 = 1 hour |
REACTIVE_MAX_SESSIONS |
Max sessions in memory | Avoids memory bloat |
REACTIVE_EXECUTION_TIMEOUT |
Zombie session timeout (ms) | 600000 = 10 minutes |
- Start Codex CLI:
codex
- In the Codex TUI, type:
/mcp - Confirm
context-engineis listed with tools like:semantic_searchget_fileget_context_for_prompt
- Open the repo you want to inspect before running queries so the server can resolve the workspace automatically.
In Codex CLI, try:
Search for authentication logic in the codebase
If startup says indexing is running, wait for it to finish or trigger index_workspace. If results appear after that, your deployment works.
git pull
npm install
npm run build
.\manage-server.bat restartnpm run build
.\manage-server.bat restartGet-Content .server.log -Tail 50.\manage-server.bat stopThen delete the project folder (C:\path\to\context-engine).
To remove global tools:
npm uninstall -g @openai/codexwhere node
where npmIf nothing appears, reinstall Node.js and reopen PowerShell.
- Try running PowerShell as Administrator.
- If you see proxy or SSL errors, your network may be blocking npm.
dir dist\index.jsIf missing:
npm run buildcodex login
codex login statusCheck logs:
Get-Content .server.log -Tail 50- If you used
codex mcp add, run:codex mcp list
- If you edited
config.tomlmanually, verify the paths are correct and absolute. - Restart Codex CLI.
- Run:
codex mcp list
- Confirm you opened Codex inside the repo you want to inspect.
- If the repo is large, give startup indexing time to finish.
- Check whether startup auto-index was disabled with
CE_AUTO_INDEX_ON_STARTUP=false. - Run
index_workspacemanually if you want to force the first build.
- Start Codex from the correct repo folder.
- If you want a fixed workspace every time, register with:
codex mcp add context-engine -- node "C:\path\to\context-engine\dist\index.js" --workspace "C:\path\to\your-project"
- Restart Codex CLI.
Allow Node.js when prompted. This server uses stdio (no open ports), but Windows may still prompt.
- MCP Server: A local process that provides tools to your coding assistant.
- stdio: Standard input/output; how MCP clients talk to servers.
- Workspace: The folder you want Context Engine to index and search.
docs/archive/QUICKSTART.md— Quick overviewdocs/archive/GET_STARTED.md— Full setup checklistdocs/WINDOWS_SERVER_MANAGEMENT.md— Server start/stop/logsdocs/archive/TROUBLESHOOTING.md— Common issues