Cortex builds a local knowledge graph of your codebase using tree-sitter parsing, then exposes it to Claude and other MCP clients through semantic search and relationship queries. It indexes files, symbols, architectural decision records, and the connections between them (calls, imports, deprecations), so your assistant retrieves the right context instead of dumping entire directories into the prompt. The setup is one command: `cortex init --bootstrap` scaffolds the index, installs git hooks to keep it fresh, and registers the MCP server with Claude Desktop or Codex. You get graph traversal queries, call graph lookups, and rule enforcement at retrieval time. Runs entirely local with WSL support for Windows users running Node in a Linux environment.
Public tool metadata for what this MCP can expose to an agent.
listAllEntitiesList and filter catalog entities with support for pagination, search, and various filters including groups, types, owners, and git repositories. If the client is trying to fetch data for teams, use 'type': 'team' in these APIs.16 paramsList and filter catalog entities with support for pagination, search, and various filters including groups, types, owners, and git repositories. If the client is trying to fetch data for teams, use 'type': 'team' in these APIs.
pageintegerquerystringtypesarraygroupsarrayownersarraycontextstringpageSizeintegerincludeLinksbooleanincludeOwnersbooleanhierarchyDepthstringgitRepositoriesarrayincludeArchivedbooleanincludeMetadatabooleanincludeNestedFieldsarrayincludeSlackChannelsbooleanincludeHierarchyFieldsarraylistEntityDescriptorsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources5 paramsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources
pageintegeryamlbooleantypesarraycontextstringpageSizeintegerlistDependenciesForEntityList all dependencies for an entity including both incoming (who depends on this service) and outgoing (what this service depends on) relationships. Essential for understanding service interactions, planning changes, and assessing blast radius6 paramsList all dependencies for an entity including both incoming (who depends on this service) and outgoing (what this service depends on) relationships. Essential for understanding service interactions, planning changes, and assessing blast radius
pageintegercontextstringpageSizeintegercallerTagstringincludeIncomingbooleanincludeOutgoingbooleangetDependencyGet specific dependency details between two entities including method, path, and metadata. Useful for understanding the nature of the relationship, API contracts, and communication patterns between services5 paramsGet specific dependency details between two entities including method, path, and metadata. Useful for understanding the nature of the relationship, API contracts, and communication patterns between services
pathstringmethodstringcontextstringcalleeTagstringcallerTagstringgetEntityDetailsRetrieve comprehensive details about a specific entity including its metadata, ownership, hierarchies, and relationships. This is the primary method for getting complete information about services, teams, or domains.5 paramsRetrieve comprehensive details about a specific entity including its metadata, ownership, hierarchies, and relationships. This is the primary method for getting complete information about services, teams, or domains.
contextstringtagOrIdstringincludeOwnersbooleanhierarchyDepthstringincludeHierarchyFieldsarraygetCustomDataForEntityList all custom data key-value pairs associated with an entity. Retrieve metadata, configuration settings, and custom attributes stored for services, resources, or domains. Supports pagination for entities with large amounts of custom data4 paramsList all custom data key-value pairs associated with an entity. Retrieve metadata, configuration settings, and custom attributes stored for services, resources, or domains. Supports pagination for entities with large amounts of custom data
pageintegercontextstringtagOrIdstringpageSizeintegergetCustomDataForEntityByKeyRetrieve a specific custom data value by key for an entity. Efficiently access individual metadata attributes, configuration values, or custom properties without fetching all custom data3 paramsRetrieve a specific custom data value by key for an entity. Efficiently access individual metadata attributes, configuration values, or custom properties without fetching all custom data
keystringcontextstringtagOrIdstringlistCustomEventsForEntityList custom events for an entity with optional filtering by type and time range. Supports pagination and filtering by event type, start time, and end time to retrieve historical event data8 paramsList custom events for an entity with optional filtering by type and time range. Supports pagination and filtering by event type, start time, and end time to retrieve historical event data
pageintegertypestringcontextstringendTimestringtagOrIdstringpageSizeintegerstartTimestringtimestampstringgetCustomEventForEntityByUuidRetrieve a specific custom event by its UUID. Returns event details including title, description, timestamp, type, and any custom data associated with the event3 paramsRetrieve a specific custom event by its UUID. Returns event details including title, description, timestamp, type, and any custom data associated with the event
uuidstringcontextstringtagOrIdstringgetDeploysForEntityList all deployments for a specific catalog entity. Returns deployment history including timestamps, environments, SHAs, and deployment types in paginated format4 paramsList all deployments for a specific catalog entity. Returns deployment history including timestamps, environments, SHAs, and deployment types in paginated format
pageintegercontextstringtagOrIdstringpageSizeintegergetCurrentOncallForEntityRetrieve the current on-call personnel for an entity in real-time. Shows who is actively responsible for incident response, including primary and secondary on-call, contact information, and rotation schedules2 paramsRetrieve the current on-call personnel for an entity in real-time. Shows who is actively responsible for incident response, including primary and secondary on-call, contact information, and rotation schedules
contextstringtagOrIdstringgetEntityDescriptorCortex Catalog API - Access and manage your service catalog, teams, domains, and resources3 paramsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources
yamlbooleancontextstringtagOrIdstringlistEntityDestinationsForRelationshipTypeList all destinations for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.5 paramsList all destinations for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.
depthstringcontextstringtagOrIdstringincludeArchivedbooleanrelationshipTypeTagstringlistEntitySourcesForRelationshipTypeList all sources for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.5 paramsList all sources for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.
depthstringcontextstringtagOrIdstringincludeArchivedbooleanrelationshipTypeTagstringgetCustomMetricDataRetrieve custom metric data points for an entity. Returns paginated time-series data for a specific custom metric, with optional filtering by date range to analyze trends and patterns7 paramsRetrieve custom metric data points for an entity. Returns paginated time-series data for a specific custom metric, with optional filtering by date range to analyze trends and patterns
pageintegercontextstringendDatestringtagOrIdstringpageSizeintegerstartDatestringcustomMetricKeystringqueryPointInTimeMetricsExecute point-in-time queries for one or more engineering metrics. Returns current metric values for specified time periods, with support for batch queries and optional period-over-period comparisons. Time range (startTime/endTime) cannot exceed 6 months (180 days). PREREQUISI...14 paramsExecute point-in-time queries for one or more engineering metrics. Returns current metric values for specified time periods, with support for batch queries and optional period-over-period comparisons. Time range (startTime/endTime) cannot exceed 6 months (180 days). PREREQUISI...
limitintegercontextstringendTimestringfiltersarraygroupByarraymetricsarrayorderByarraynextPagestringstartTimestringcomparisonvaluenestedGroupByarraynestedMetricsarraytimeAttributestringnestedTimeAttributestringlistMetricDefinitionsList all available engineering metric definitions. USAGE - Call this endpoint BEFORE querying metrics (queryPointInTimeMetrics): 1. Once at start: Call with view='basic' to discover all available metrics - cache this response 2. Once per metric: Call with view='full' and key=M...3 paramsList all available engineering metric definitions. USAGE - Call this endpoint BEFORE querying metrics (queryPointInTimeMetrics): 1. Once at start: Call with view='basic' to discover all available metrics - cache this response 2. Once per metric: Call with view='full' and key=M...
keyarrayviewstringcontextstringlistInitiativesList all initiatives in the organization with optional filters for draft and expired initiatives. View active improvement programs, strategic projects, and their current status to understand organizational priorities and track progress5 paramsList all initiatives in the organization with optional filters for draft and expired initiatives. View active improvement programs, strategic projects, and their current status to understand organizational priorities and track progress
pageintegercontextstringpageSizeintegerincludeDraftsbooleanincludeExpiredbooleangetInitiativeRetrieve detailed information about a specific initiative including its goals, timeline, affected entities, scorecard targets, and current progress. Essential for understanding initiative scope and tracking achievement of objectives2 paramsRetrieve detailed information about a specific initiative including its goals, timeline, affected entities, scorecard targets, and current progress. Essential for understanding initiative scope and tracking achievement of objectives
cidstringcontextstringgetMyWorkspaceTOOL for retrieving current user's owned resources and work items across the Cortex workspace. FLEXIBLE REQUEST STRUCTURE: The request accepts an object with optional fields for each resource type: - myEntitiesRequest: Fetch entities (services, resources, domains) owned by the...7 paramsTOOL for retrieving current user's owned resources and work items across the Cortex workspace. FLEXIBLE REQUEST STRUCTURE: The request accepts an object with optional fields for each resource type: - myEntitiesRequest: Fetch entities (services, resources, domains) owned by the...
contextstringmyTeamsRequestobjectmyOpenPRsRequestobjectmyEntitiesRequestobjectmyWorkItemsRequestobjectmyScorecardsRequestobjectmyRequestedReviewsRequestobjectlistRelationshipTypesList all available relationship types with pagination. View relationship type configurations to understand what kinds of relationships can be created between entities like services, resources, domains, and teams3 paramsList all available relationship types with pagination. View relationship type configurations to understand what kinds of relationships can be created between entities like services, resources, domains, and teams
pageintegercontextstringpageSizeintegergetRelationshipTypeDetailsGet complete details of a specific relationship type including its configuration, rules, source/destination filters, and inheritance settings. Essential for understanding how entities can be connected and what validation rules apply2 paramsGet complete details of a specific relationship type including its configuration, rules, source/destination filters, and inheritance settings. Essential for understanding how entities can be connected and what validation rules apply
contextstringrelationshipTypeTagstringlistEntityRelationshipsList all entity relationships/full graph for a specific relationship type across the entire organization. Returns paginated results showing all source-destination pairs, useful for understanding the complete relationship graph and finding all connections of a particular type4 paramsList all entity relationships/full graph for a specific relationship type across the entire organization. Returns paginated results showing all source-destination pairs, useful for understanding the complete relationship graph and finding all connections of a particular type
pageintegercontextstringpageSizeintegerrelationshipTypeTagstringlistScorecardsList all scorecards in the organization with optional filtering. View scorecard configurations to understand quality standards, compliance requirements, and maturity models. Supports filtering by groups, entities, and teams to find relevant scorecards7 paramsList all scorecards in the organization with optional filtering. View scorecard configurations to understand quality standards, compliance requirements, and maturity models. Supports filtering by groups, entities, and teams to find relevant scorecards
pageintegerteamsarraygroupsarraycontextstringentitiesarraypageSizeintegershowDraftsbooleangetScorecardGet complete details of a scorecard including its configuration, rules, levels, weights, exemption settings, and evaluation criteria. Essential for understanding how services are evaluated and what standards they must meet2 paramsGet complete details of a scorecard including its configuration, rules, levels, weights, exemption settings, and evaluation criteria. Essential for understanding how services are evaluated and what standards they must meet
tagstringcontextstringgetScorecardNextStepsForEntityGet actionable next steps for an entity to improve its scorecard performance. Shows which rules need to be satisfied to reach the next maturity level, helping teams prioritize improvements and track progress toward compliance goals3 paramsGet actionable next steps for an entity to improve its scorecard performance. Shows which rules need to be satisfied to reach the next maturity level, helping teams prioritize improvements and track progress toward compliance goals
tagstringcontextstringentityTagstringlistScorecardScoresRetrieve scores for all entities evaluated by a specific scorecard. Returns paginated results showing how each service, resource, or domain performs against the scorecard's rules, including individual rule scores and overall scorecard scores5 paramsRetrieve scores for all entities evaluated by a specific scorecard. Returns paginated results showing how each service, resource, or domain performs against the scorecard's rules, including individual rule scores and overall scorecard scores
tagstringpageintegercontextstringpageSizeintegerentityTagstringgetTeamDetailsRetrieve detailed information about a specific team by its tag or ID. Returns complete team data including members, slack channels, metadata, and whether it's backed by an identity provider group2 paramsRetrieve detailed information about a specific team by its tag or ID. Returns complete team data including members, slack channels, metadata, and whether it's backed by an identity provider group
contextstringtagOrIdstringquery_docsQuery the Cortex knowledge base for answers. Args: query: The question to ask Cortex docs Returns: Response from Cortex including answer and metadata2 paramsQuery the Cortex knowledge base for answers. Args: query: The question to ask Cortex docs Returns: Response from Cortex including answer and metadata
querystringcontextstringget_more_toolsCheck for additional tools whenever your task might benefit from specialized capabilities - even if existing tools could work as a fallback.1 paramsCheck for additional tools whenever your task might benefit from specialized capabilities - even if existing tools could work as a fallback.
contextvalue
The context layer for AI-assisted software engineering.
Cortex is a local, repository-scoped context engine for coding assistants. It parses your source code with tree-sitter, indexes it into a structured knowledge graph of entities (files, symbols, rules, ADRs) and their relationships (calls, defines, constrains, implements, supersedes), and exposes that context through CLI commands. MCP remains available as a compatibility and integration bridge for clients that support it.
Where a general-purpose AI assistant sees your codebase as a pile of text files, Cortex gives it a precise map: what exists, how it is connected, which rules govern it, and which parts are source-of-truth versus deprecated.
Cortex runs entirely on the developer's machine. Source code never leaves the host.
Cortex is designed for engineering teams that rely on AI assistants for non-trivial work on real codebases. Use it when:
Cortex is not a replacement for your editor, your version control, or your coding assistant. It is the grounding layer that makes those assistants act with knowledge of your specific repository.
cortex init --bootstrap) scaffolds everything needed for local indexing, git hooks, CLI retrieval, and optional MCP compatibility.Cortex operates as a five-stage pipeline between your repository and your AI assistant.
CALLS, DEFINES, CONSTRAINS, IMPLEMENTS, IMPORTS, SUPERSEDES).cortex ... --json, with MCP exposing equivalent tool responses when enabled.Git hooks keep the index fresh on every checkout, pull, commit, and rewrite. A live TUI dashboard (cortex dashboard) shows what Cortex adds to the repository in real time.
Modern coding assistants are bottlenecked by context, not by model capability. Feeding a model more files rarely helps; feeding it the right files almost always does.
Cortex is built on one principle: prefer retrieval quality over analysis completeness. A smaller, sharper context package outperforms a broad dump of files. Every component — from tree-sitter parsing to graph traversal to rule filtering — exists to raise the signal-to-noise ratio of what the assistant sees.
The result is an assistant that behaves as if it already knows your codebase, because — through Cortex — it does.

claude and/or codex CLI in PATHnpm i -g @danielblomma/cortex-mcp
To upgrade an already-scaffolded project to a new Cortex version:
npm i -g @danielblomma/cortex-mcp
cortex init --force # re-scaffolds .context runtime + .context/scripts
cortex bootstrap
cortex update
cortex init --force preserves per-project files: .context/config.yaml,
.context/rules.yaml, and your notes/decisions.
Version-specific notes (see CHANGELOG.md for details):
cortex update after upgrading triggers a full re-embed automatically
(~2 min per 1000 entities plus a one-time model download). The
CORTEX_EMBED_MAX_CHARS env var is removed and silently ignored.
Existing projects keep their old ranking weights in config.yaml; the
recommended block is now semantic: 0.55, graph: 0.10, trust: 0.20, recency: 0.15. If you use MCP, restart the MCP server after
re-embedding. The first search after a re-embed can hit a stale
embeddings cache — re-run the query.From the repository you want to index:
cortex init --bootstrap
This will:
.context/, .context/scripts/, the local context runtime (.context/mcp compatibility path), .githooks/, and docs filescortex connect or cortex init --connectDisable watcher setup:
cortex init --bootstrap --no-watch
Check context status:
cortex status
Use the CLI as the default local agent interface:
cortex search "authentication flow" --json
cortex related file:src/auth.ts --json
cortex impact "payment service" --json
cortex rules --json
cortex explain "where retries are configured" --json
These commands read the same local graph, embeddings, and rules used by the MCP server, but they do not require an MCP client registration.
MCP remains supported for clients that need it. Register MCP clients explicitly:
cortex connect
Then verify the client registration:
Claude:
claude mcp list
Codex:
codex mcp list
Install via Claude Code plugin marketplace:
/plugin marketplace add DanielBlomma/cortex
/plugin install cortex@cortex-marketplace
/plugin enable cortex
Then initialize Cortex in your target repository. If you want the plugin to call the local MCP server, also run cortex connect from that repository:
cortex init --bootstrap
cortex connect
If client registration is unavailable, configure MCP manually.
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"cortex": {
"command": "cortex",
"args": ["mcp"],
"env": {
"CORTEX_PROJECT_ROOT": "/absolute/path/to/your-project"
}
}
}
}
Codex (~/.config/codex/mcp-config.json):
{
"mcpServers": {
"cortex-myproject": {
"command": "cortex",
"args": ["mcp"],
"cwd": "/absolute/path/to/your-project"
}
}
}
If you run Node.js inside WSL but use Claude Desktop or another MCP client on Windows:
# In a WSL terminal
npm i -g @danielblomma/cortex-mcp
cd /mnt/c/Users/yourname/your-project
cortex init --bootstrap
%APPDATA%\Claude\claude_desktop_config.json):{
"mcpServers": {
"cortex": {
"command": "wsl.exe",
"args": ["--distribution", "Ubuntu", "--exec", "cortex", "mcp"],
"env": {
"CORTEX_PROJECT_ROOT": "C:\\Users\\yourname\\your-project",
"CORTEX_AUTO_BOOTSTRAP_ON_MCP": "1"
}
}
}
}
Cortex automatically converts Windows paths (e.g. C:\Users\...) to WSL paths (/mnt/c/Users/...).
For projects on the WSL filesystem (e.g. ~/projects/myapp), use the WSL path directly:
{
"mcpServers": {
"cortex": {
"command": "wsl.exe",
"args": ["--distribution", "Ubuntu", "--exec", "cortex", "mcp"],
"env": {
"CORTEX_PROJECT_ROOT": "/home/yourname/projects/myapp",
"CORTEX_AUTO_BOOTSTRAP_ON_MCP": "1"
}
}
}
}
Notes:
/mnt/ paths (Windows filesystem) automatically uses poll mode since inotify is unreliable across filesystem boundaries.~/...) rather than /mnt/c/....context.searchRanked context search across indexed entities.
Input:
query (string, required)top_k (int, 1-20, default 5)include_deprecated (bool, default false)include_content (bool, default false)context.get_relatedFetch entity relationships from the graph.
Input:
entity_id (string, required)depth (int, 1-3, default 1)include_edges (bool, default true)context.impactTraverse likely impact paths across config, code and SQL starting from an entity id or query.
Input:
entity_id (string, optional) — either entity_id or query is requiredquery (string, optional)depth (int, 1-4, default 2)top_k (int, 1-20, default 8)include_edges (bool, default true)profile ("all" | "config_only" | "config_to_sql" | "code_only" | "sql_only", default "all")sort_by ("impact_score" | "shortest_path" | "semantic_score" | "graph_score" | "trust_score", default "impact_score")context.get_rulesList indexed rules and optionally include inactive rules.
Input:
scope (string, optional)include_inactive (bool, default false)context.reloadReload the RyuGraph connection after updates/maintenance.
Input:
force (bool, default true)A live TUI that shows what Cortex adds to your repository at a glance.
cortex dashboard

The dashboard displays:
Options:
--interval <sec> — auto-refresh interval (default: 2 seconds).r to force refresh, q to quit.cortex init [path] [--force] [--bootstrap] [--connect] [--no-connect] [--watch] [--no-watch]
cortex connect [path] [--skip-build]
cortex mcp
cortex bootstrap
cortex update
cortex search <query> [--json]
cortex related <entity-id> [--json]
cortex impact <query|entity-id> [--json]
cortex rules [--json]
cortex explain <query|entity-id> [--json]
cortex status
cortex dashboard [--interval <sec>]
cortex watch [start|stop|status|run|once] [--interval <sec>] [--debounce <sec>] [--mode <auto|event|poll>]
cortex help
This repository includes two GitHub Actions workflows:
Release Bump (.github/workflows/release-bump.yml)
workflow_dispatch from mainpatch/minor/major)package.json, server.json, plugin manifests)vX.Y.ZRelease Publish (.github/workflows/release-publish.yml)
v*.*.*@danielblomma/cortex-mcp to npm via npm trusted publishing (GitHub OIDC)Required npm configuration:
@danielblomma/cortex-mcp on npmjs.comDanielBlomma/cortexrelease-publish.ymlEmbedding generation tunes itself to the machine: the number of parallel
workers, memory limits for long files, and skip-work caching are all derived
from the available CPU cores and RAM at run time (container memory limits
included). No configuration is needed — on a laptop or a CI runner, cortex
picks safe, fast settings by itself. The one exception worth knowing:
when several cortex instances share one machine, set CORTEX_EMBED_THREADS
to give each its fair share of cores.
cortex init --bootstrap)..context/.mcp/dist/server.js missing:
Run cortex bootstrap (or re-run cortex init --bootstrap).claude or codex not found during cortex connect:
MCP registration is skipped for that client; use manual config above if needed.cortex update, then rerun the CLI query. If you use MCP, reconnect the client or call context.reload.frontend/ hosts the cortex website (GitHub Pages, deployed on push to main):
product overview plus bootstrap evaluation metrics.benchmark/bootstrapbench/ runs cortex bootstrap against 69 pinned
real-world repositories in isolated containers and extracts chunk, embedding
and graph statistics. See benchmark/bootstrapbench/README.md.MIT
com.mcparmory/google-search
io.github.pipeworx-io/brave-search
marcopesani/mcp-server-serper
brave/brave-search-mcp-server
com.mcparmory/google-search-console
acamolese/google-search-console-mcp