Context Engine MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm run build
node dist/index.js
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add context-engine -- node "<FULL_PATH_TO_CONTEXT_ENGINE>/dist/index.js"

Replace <FULL_PATH_TO_CONTEXT_ENGINE>/dist/index.js with the actual folder you prepared in step 1.

README.md

A local-first, agent-agnostic MCP server for workspace indexing and retrieval.

Context Engine MCP Server

A local-first, agent-agnostic Model Context Protocol (MCP) server for workspace indexing, retrieval, planning, and review workflows, with a setup path that works well for Codex and other OpenAI-powered agents.

New here? Start with the beginner quick start below.

If you want client-specific setup help, see docs/MCP_CLIENT_SETUP.md.

If you are on Windows, see docs/WINDOWS_DEPLOYMENT_GUIDE.md.

Historical docs live in docs/archive/INDEX.md if you need the old planning and migration notes.

OpenAI / Codex Showcase

If you want to see what this project demonstrates for OpenAI-style agent workflows, start here:

  • Local workspace indexing and retrieval
  • Review and planning workflows layered on top of the same MCP server
  • Beginner-friendly install and client setup
  • Windows support and copy-paste setup examples
  • AI-agent-friendly instructions for self-setup

Why This Matters

  • It shows how an OpenAI-powered agent can connect to a real workspace and start using tools right away.
  • It combines retrieval, review, and planning in one MCP server instead of relying on one-off scripts.
  • It gives both humans and AI agents a simple, repeatable setup path, which makes demos and onboarding easier.

Fastest demo path:

npm install
npm run build
codex mcp add context-engine -- node dist/index.js

Then in Codex, confirm the tools are visible and try:

use semantic_search to find authentication logic

Beginner Quick Start

If you just want to get Context Engine running locally, follow these steps:

  1. Install Node.js 18+.
  2. Clone this repository and open it in a terminal at the repo root.
  3. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Run the verification checks:
npm run verify
  1. Start the MCP server:
node dist/index.js

By default, Context Engine now resolves the workspace like this:

  • explicit --workspace wins
  • otherwise it uses the current folder
  • if you launched 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

On first run, if the index is missing or stale, startup can kick off background indexing automatically. The server still starts first, but the first query may be slower until indexing finishes.

Connect It To Your MCP Client

The server speaks MCP over stdio, so most clients can launch it with the same command.

First-Time Setup vs Daily Use

Use this mental model:

  1. First-time setup: Register the MCP server once in your client.
  2. Daily use: Open any repo and let the server resolve the workspace automatically.
  3. Override only when needed: Pass --workspace <absolute-path> if the client launches from the wrong folder or you want a different repo on purpose.

Codex CLI

codex mcp add context-engine -- node dist/index.js

Windows example

codex mcp add context-engine -- node "D:\GitProjects\context-engine\dist\index.js"

Claude Code, Claude Desktop, Cursor, Antigravity

See docs/MCP_CLIENT_SETUP.md for copy-paste config examples for each client.

Ready-to-use sample config files live in examples/mcp-clients/. Optional skill packages for AI workflows live in examples/skills/.

If an AI agent is setting this up

Paste this into the agent if you want it to do the setup for you:

Set up Context Engine MCP for this workspace.

  1. Run npm install and npm run build.
  2. Register the MCP server once with node dist/index.js.
  3. Confirm the client launches the MCP server from the repo I am working in.
  4. If the client launches from the wrong folder, add --workspace <absolute-path-to-workspace> as an override.
  5. Confirm the server appears in the client and that tool_manifest() or an equivalent tool list works.
  6. Run one quick retrieval test, for example semantic_search, to confirm the connection is working.
  7. If startup says the workspace is unindexed or stale, let the background indexing finish or run index_workspace manually.

If the client is Codex CLI, use:

codex mcp add context-engine -- node dist/index.js

Startup Behavior

When the server starts without --workspace, it tries to be repo-aware:

  • repo root launch: uses that repo
  • nested repo folder launch: upgrades to the nearest git root
  • non-git folder launch: stays on the current folder and warns clearly

If startup auto-index is enabled, missing or stale workspaces start background indexing automatically.

Operator override:

  • disable startup auto-index with CE_AUTO_INDEX_ON_STARTUP=false
  • force a specific workspace with --workspace "D:\path\to\repo"

Architecture

This implementation follows a clean 5-layer archit

Tools (2)

semantic_searchPerforms semantic search across the workspace to find relevant code or documentation.
index_workspaceManually triggers the indexing of the current workspace.

Environment Variables

CE_AUTO_INDEX_ON_STARTUPControls whether background indexing starts automatically on server launch.

Configuration

claude_desktop_config.json
{"mcpServers": {"context-engine": {"command": "node", "args": ["/path/to/context-engine/dist/index.js"]}}}

Try it

Use semantic_search to find authentication logic in the codebase.
Index the current workspace to ensure my search results are up to date.
Find all references to the database connection string using semantic search.
Help me plan the implementation of a new feature by searching for existing patterns.

Frequently Asked Questions

What are the key features of Context Engine?

Local-first workspace indexing and retrieval. Automated background indexing for stale workspaces. Repo-aware workspace resolution (git root detection). Deterministic static analysis and planning workflows. Agent-agnostic design compatible with Claude, Codex, and Cursor.

What can I use Context Engine for?

Developers needing to search across large codebases using natural language queries.. AI agents requiring persistent memory and context of a local project folder.. Teams standardizing code review and planning workflows across different AI clients.. Users working on Windows or Linux needing a consistent, repeatable setup for AI-assisted coding..

How do I install Context Engine?

Install Context Engine by running: codex mcp add context-engine -- node dist/index.js

What MCP clients work with Context Engine?

Context Engine works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Context Engine docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare