# cortex [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/DanielBlomma/cortex  
**GitHub Stars:** 19  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cortex

## Description
Local repo context for coding assistants with semantic search and graph relationships.

## Tools
Capabilities this server exposes over MCP:

- **context.search** — Ranked context search across indexed entities.
- **context.get_related** — Fetch entity relationships from the graph.
- **context.impact** — Traverse likely impact paths across config, code and SQL starting from an entity id or query.
- **context.get_rules** — List indexed rules and optionally include inactive rules.
- **context.reload** — Reload the RyuGraph connection after updates/maintenance.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/DanielBlomma/cortex), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install --global @danielblomma/cortex-mcp
```

2. Configure:

```sh
cortex init --bootstrap
```

3. Install:

```sh
npm install --global @danielblomma/cortex-mcp@latest
```

## Documentation

## What the cortex MCP server does

The cortex MCP server builds a local map of repository code, symbols, relationships, and project rules. It is designed for coding assistants that need more context than filename or text search provides. The index supports semantic and lexical retrieval, symbol relationships, caller and dependency traversal, impact analysis, active rules, and source-of-truth signals.

Its MCP surface includes five context operations. `context.search` returns ranked results across indexed entities. `context.get_related` retrieves graph relationships for an entity. `context.impact` follows likely impact paths through configuration, code, and SQL from an entity ID or query. `context.get_rules` lists indexed rules and can include inactive rules. `context.reload` reloads the RyuGraph connection after maintenance or updates.

The repository also provides CLI commands for pattern evidence, convention profiles, pre-coding guidance, diff review, status checks, diagnostics, and index updates. These commands are separate from the five listed MCP tools and are part of the normal local workflow.

## How it works

Cortex stores repository context locally and exposes it through its CLI or, when needed, an MCP connection. Initialization indexes the project, adds Cortex instructions to `AGENTS.md`, installs Git hooks, and starts a background watcher. The hooks and watcher normally keep the index current, while `cortex update` can refresh it manually after substantial changes or when results appear stale.

For larger repositories, background bootstrapping makes lexical and graph search available while semantic indexing continues. The project supports this mode on macOS, Linux, and WSL; native Windows should use foreground bootstrapping.

The cortex MCP server is optional for the standard workflow. Agents can run Cortex CLI commands directly, and `cortex init` adds instructions telling them to search before answering and check impact before refactoring. Use `cortex connect` only when an MCP-capable client explicitly requires the connection.

## Setup and configuration

Install the package globally with Node.js 20.9 or newer and Git available:

```bash
npm install --global @danielblomma/cortex-mcp
cd your-project
cortex init --bootstrap
cortex doctor
```

`cortex doctor` checks the local setup. Useful maintenance commands include `cortex status`, `cortex watch status`, and `cortex update`. Large projects can use `cortex bootstrap --background --profile interactive`, followed by `cortex indexing status --json`.

Before implementing a change, use search, related-entity lookup, impact analysis, rules, or the bounded guidance command as appropriate. After coding, `cortex review --diff` examines staged, unstaged, and non-ignored untracked changes against `HEAD`. Convention profiles, guidance, and diff review are inspection-oriented local features; guidance is additive context rather than policy authority, so explicit active rules and conflicts still need checking.

The project also documents a DeepSeek Harness V1 integration with four agent-scoped tools and five behavior skills. The separately distributed npm bundle is not currently available, and the planned V2 proactive retrieval is not included in the stated release. Cortex is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/cortex/readme_

