Context Engine exposes its local continuity layer to AI host apps through a shared read-only tool contract. The first transport is local MCP over stdio: Claude Desktop, Codex CLI, Cursor, and compatible desktop/IDE hosts spawn mcp-server.mjs as a child process, and the MCP server forwards each tool call to the local CE HTTP server on 127.0.0.1:3847.
This means CE works inside local chat-style apps that don't read project files (CLAUDE.md, AGENTS.md, etc.). When a session resets, a provider rate-limits you, or you switch tools mid-task, the next host can ask CE for handoffs, memory, skills, and status instead of making you re-explain the work.
Claude Desktop has two local paths:
claude_desktop_config.jsonfor manual stdio MCP registration.- A local desktop extension bundle (
.mcpb) for the Blender-style install flow, where Claude Desktop launches a local wrapper and the user only configures the Context Engine port.
ChatGPT app support is a separate transport, not a different reading of the same local setup. ChatGPT's current custom MCP/app flow is remote-server oriented and cannot spawn this local stdio server directly. Use mcp-http-server.mjs behind HTTPS for that path.
- CE must be running. Start the desktop app, or run
npm startfrom theapp/directory. The MCP server is a thin client; without CE behind it, every tool call returnsCE_UNREACHABLE. - Index must be built for
context_engine_searchto return results. From the desktop app, click "Reindex," orPOST /api/indexfrom a terminal. - Node 22+ must be on
PATH(the host needs to spawnnode mcp-server.mjs).
| Tool | Purpose |
|---|---|
context_engine_search |
Vector search over indexed skill chunks. Top-k ranked results. |
context_engine_list_skills |
Manifest of all skills (id, name, category, description, active). |
context_engine_get_skill |
Full skill body, optionally a single ## section slice. |
context_engine_handoffs |
Active work bookmarks for thread/project resume after a switch. |
context_engine_status |
Index health: chunk count, model, last-indexed timestamp. |
The expected usage pattern is status -> handoffs -> list/search -> get_skill: a model confirms CE is ready, checks whether there is an active handoff for the thread or repo, narrows candidates with context_engine_search or context_engine_list_skills, then pulls full text for the one or two skills that matter via context_engine_get_skill. Token reduction is a consequence of that continuity path, not the headline claim.
For the Blender-style local connector flow, install:
dist/context-engine-claude-desktop.mcpb
Build it from source:
npm run mcpb:packDuring installation, set Context Engine Port to 3847 unless CE is running on a different port. Claude Desktop launches the bundled stdio wrapper locally; the wrapper forwards tool calls to http://127.0.0.1:<port>.
This path does not need HTTPS, OAuth, Cloudflare, or a public URL. It is desktop-local only, like Blender's connector.
Edit claude_desktop_config.json:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add a mcpServers entry. Replace <ABSOLUTE_PATH_TO_APP> with the absolute path to your CE checkout's app/ directory:
{
"mcpServers": {
"context-engine": {
"command": "node",
"args": ["<ABSOLUTE_PATH_TO_APP>/mcp-server.mjs"],
"env": {
"CE_HOST": "127.0.0.1",
"CE_PORT": "3847"
}
}
}
}Restart Claude Desktop. The Context Engine tools should appear in the tools menu. If they don't, check Claude Desktop's MCP log — typical issues are an absolute path with the wrong slashes on Windows (use forward slashes or escape backslashes) or a stale Node version.
Edit ~/.codex/config.toml:
[mcp_servers.context-engine]
command = "node"
args = ["<ABSOLUTE_PATH_TO_APP>/mcp-server.mjs"]
[mcp_servers.context-engine.env]
CE_HOST = "127.0.0.1"
CE_PORT = "3847"Restart any active Codex session.
Note: Codex CLI also reads
AGENTS.mdfrom the current repo. CE already produces AGENTS.md via the existing compile flow, so inside a repo with a CE-compiledAGENTS.mdyou have two bridges available (file + MCP). MCP is preferred for token economy; the file is the fallback when the model would benefit from baseline context up-front.
The ChatGPT app path is not covered by local stdio MCP. Current ChatGPT custom MCP support is gated by plan/workspace settings and expects a remote server/connector flow rather than a local child process. Context Engine ships a Streamable HTTP adapter exposing the same tool contract:
context_engine_searchcontext_engine_list_skillscontext_engine_get_skillcontext_engine_handoffscontext_engine_status
Run it locally:
set MCP_OAUTH_PASSWORD=<operator-passphrase>
npm run mcp:httpDefaults:
- URL:
http://127.0.0.1:3850/mcp - Health check:
http://127.0.0.1:3850/health - Auth: OAuth authorization-code + PKCE when
MCP_OAUTH_PASSWORDis set. Claude discovers this through OAuth protected-resource metadata, dynamically registers a client, opens the consent page, then sends bearer tokens to/mcp. - Legacy local smoke auth: static bearer token when
MCP_HTTP_TOKENis set andMCP_OAUTH_PASSWORDis not set.
For Claude/ChatGPT remote connectors, put this server behind a trusted HTTPS tunnel or hosted endpoint, then register the HTTPS /mcp URL in the connector settings. Do not expose the adapter without OAuth or another auth layer.
This is the validated end-to-end flow for connecting ChatGPT app/web to your local CE via a Cloudflare Tunnel. Cloudflare is recommended over ngrok for this use case because it issues a stable, unauthenticated *.trycloudflare.com URL with no install state, and CE's OAuth provides the auth layer.
1. Run the HTTP adapter with OAuth.
# Windows (PowerShell)
$env:MCP_OAUTH_PASSWORD = "<operator-passphrase>"
$env:MCP_PUBLIC_URL = "https://<your-tunnel>.trycloudflare.com"
npm run mcp:http
# macOS / Linux
export MCP_OAUTH_PASSWORD=<operator-passphrase>
export MCP_PUBLIC_URL=https://<your-tunnel>.trycloudflare.com
npm run mcp:httpMCP_PUBLIC_URL is required: the OAuth metadata endpoints have to advertise the tunnel URL, not http://127.0.0.1:3850, or ChatGPT's connector will redirect to a localhost page and fail. CE refuses to bind a non-loopback host without auth, so do not unset MCP_OAUTH_PASSWORD.
2. Open the Cloudflare Tunnel. In a second terminal:
cloudflared tunnel --url http://127.0.0.1:3850cloudflared prints a https://<random>.trycloudflare.com URL after a few seconds. That's the value to plug into MCP_PUBLIC_URL (restart the adapter so it picks it up — the metadata bakes in at startup). The same URL is what ChatGPT will register.
3. Register the connector in ChatGPT.
- Open ChatGPT (web or desktop).
- Settings → Connectors → Developer mode → "Add a custom connector."
- Connector name:
Context Engine(any label is fine). - URL:
https://<your-tunnel>.trycloudflare.com/mcp— note the trailing/mcp. - Click Connect. ChatGPT performs OAuth dynamic client registration; the consent page appears in a popup.
- Enter your
MCP_OAUTH_PASSWORDand click Approve.
4. Verify. In a new ChatGPT chat, ask something that should require a CE skill (e.g. "use context engine to find any active skills about Python testing"). The tool transcript should show context_engine_search firing and returning ranked chunks.
Common failure modes:
- ChatGPT shows "Couldn't connect" → check that
MCP_PUBLIC_URLexactly matches the tunnel URL and the adapter was restarted after setting it. - OAuth approval succeeds but tools never appear → ChatGPT cached an old discovery doc; remove the connector and re-add it after restarting the adapter.
- Tools list is empty /
context_engine_statusreturnsready: false→ the index isn't built. Open the CE desktop app, go to Connections → Vector index → "Build / rebuild," wait for the indeterminate bar to finish, then retry the chat. cloudflaredprints "tunnel not found" → leftover state from a prior session; close allcloudflaredprocesses and retry.
Production deployment. For anything beyond developer testing, swap cloudflared tunnel --url ... for a named Cloudflare Tunnel bound to your own domain, or host the adapter behind your own HTTPS reverse proxy. Either way, keep MCP_OAUTH_PASSWORD set and the bind address loopback.
| Host surface | Bridge path | Status |
|---|---|---|
| Claude Desktop | Local desktop extension (.mcpb) or local MCP stdio (claude_desktop_config.json) |
MVP supported; extension bundle smoke-tested |
| Codex CLI | Local MCP stdio (~/.codex/config.toml) |
MVP supported |
| Cursor / compatible IDE MCP hosts | Local MCP stdio or host-specific MCP config | Same server, config TBD |
| Legacy file-based tools | Existing compile outputs (AGENTS.md, CLAUDE.md, .cursorrules, etc.) |
Existing fallback |
| ChatGPT app / web | Streamable HTTP MCP adapter (mcp-http-server.mjs) behind HTTPS |
Adapter implemented; connector/tunnel validation still required |
From the app/ directory, with no host attached:
npm run smoke:mcp
npm run smoke:mcpb
npm run smoke:mcp:httpThe stdio smoke test starts an in-process CE HTTP server on port 3858, spawns mcp-server.mjs, performs the stdio handshake, lists tools, validates each tool's schema, and exercises every tool with at least one call. The MCPB smoke test starts CE on port 3864, spawns the desktop-extension wrapper, lists tools, and calls context_engine_status. The HTTP smoke test starts CE on port 3861, spawns mcp-http-server.mjs on port 3862, checks bearer-token rejection, connects over Streamable HTTP, and calls context_engine_status.
To exercise the running production server (port 3847) instead, with CE already running:
node mcp-server.mjsthen drive it manually with an MCP client. The Anthropic MCP Inspector is the simplest way to do this interactively.
| Variable | Default | Purpose |
|---|---|---|
CE_HOST |
127.0.0.1 |
Host of the CE HTTP server. |
CE_PORT |
3847 |
Port of the CE HTTP server. |
Both can be overridden in the host config's env block, useful when CE runs on a non-default port or is reverse-proxied.
CE_UNREACHABLEon every call — CE HTTP server isn't running. Start the desktop app ornpm start.Index is empty— the vector index hasn't been built. TriggerPOST /api/indexor use the desktop app's reindex action.- Tools list is empty in the host — the host didn't spawn the MCP server. Check the host's MCP log; typical cause is a wrong absolute path or
nodenot on PATH. Cannot find module '@modelcontextprotocol/sdk/...'— runnpm installin theapp/directory. The SDK is a runtime dependency.- stdout pollution warnings — the MCP server writes only to stderr; stdout is reserved for the protocol. If you see protocol errors, check that no library you've added is logging to stdout from inside the MCP process.