# CodeCortex Context Engine

> CodeCortex Context Engine is an open-source MCP server for developer tools. Open-source context engine that maps a repository for AI coding agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, Linux, macOS, Windows
- **Website:** https://behnamjalalico.github.io/CodeCortex/
- **Repository:** https://github.com/behnamjalalico/codecortex
- **MCP Registry name:** io.github.BehnamJalaliCo/codecortex-context-engine
- **Categories:** developer tools, knowledge and memory
- **Listing updated:** 2026-11-16

## About

CodeCortex indexes a repository and answers an agent's questions with ranked evidence instead of raw files. It covers symbols and references, dependencies, call relationships, Git and PR history, ownership and architecture, and trims results to a context budget with provenance.

Before an edit, an agent can check reverse dependencies and affected tests. Edits go through guarded semantic and structural rewrite flows that preview before applying. Project and team memory persists across chats, and workspaces can span several repositories.

Install the PyPI package (Python 3.11 to 3.13), run cortex init, index and doctor, then start the MCP server with cortex mcp. A configurator writes merge-safe settings for Claude Code, Codex, Cursor, Gemini CLI and OpenCode while leaving user-owned entries alone. The README cites committed hardening figures, such as 711 passing tests, and calls them measurements rather than performance promises.

## Features

- **Repository map:** Symbols, definitions, references and call relationships.
- **Hybrid retrieval:** Lexical, semantic, structural, graph, Git and memory signals ranked together.
- **Impact analysis:** Reverse dependencies, affected tests and ownership before an edit.
- **Guarded edits:** Semantic edits and structural rewrite previews with review steps.
- **Persistent memory:** Project and team memory plus multi-repo workspace search.
- **Agent configurator:** Merge-safe setup for five coding agents.

## Good for

- Check what an edit to a class could break
- Give an agent a task-specific slice of a large repo
- Search code by meaning, such as authentication flows
- Keep project knowledge between agent sessions

## Install

### Claude Code (Terminal)

```sh
claude mcp add codecortex-context-engine -- uvx codecortex-context-engine
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "codecortex-context-engine": {
      "command": "uvx",
      "args": [
        "codecortex-context-engine"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "codecortex-context-engine": {
      "command": "uvx",
      "args": [
        "codecortex-context-engine"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "codecortex-context-engine": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "codecortex-context-engine"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "codecortex-context-engine": {
      "command": "uvx",
      "args": [
        "codecortex-context-engine"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "codecortex-context-engine": {
      "command": "uvx",
      "args": [
        "codecortex-context-engine"
      ]
    }
  }
}
```

## FAQ

### What Python versions work?

Python 3.11 to 3.13.

### Which agents can it configure?

Claude Code, Codex, Cursor, Gemini CLI and OpenCode.

### Is it open source?

Yes, the project describes itself as open source and publishes a license file.

### How do I start the MCP server?

Run cortex mcp --path . after initialising and indexing.

### Is CodeCortex Context Engine free?

Yes. CodeCortex Context Engine is open source, so you can use and self-host it for free.

### How do I add CodeCortex Context Engine to Claude Code?

Run this command in your terminal: claude mcp add codecortex-context-engine -- uvx codecortex-context-engine

### What are the best alternatives to CodeCortex Context Engine?

The closest alternatives to CodeCortex Context Engine are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/codecortex-context-engine
