ローカルリポジトリをインデックス化し、コーディングエージェントによるコード検索、シンボル間の関係性の追跡、変更による影響範囲の確認を可能にします。
別名 DanielBlomma/cortex, @danielblomma/cortex-mcp
- スター
- 19
- ツール
- —
- ダウンロード数(30日間)
- 523
- 最新バージョン
- 0.4.2
- 最終コミット
- 2026年9月11日
- ライセンス
- —
Cortex MCPとは
CortexはMCPサーバーです。 ローカルリポジトリをインデックス化し、コーディングエージェントによるコード検索、シンボル間の関係性の追跡、変更による影響範囲の確認を可能にします。.
プロジェクトのREADMEから生成された概要
Cortex MCP server について
Cortexは、コード、シンボル、プロジェクトルールをローカルマップとして構築することで、AIコーディングエージェントに構造化されたリポジトリのコンテキストを提供します。エージェントが推測したりファイル全体を読み込んだりする代わりに、CLIを通じてローカルインデックスにクエリを投げ、関連情報を取得します。このツールは完全にローカル環境で動作するため、コードのプライバシーが確保されます。動作にはNode.js 20.9以上とGitが必要です。
開発者は、コードを検索する cortex search、変更の影響範囲を推定する cortex impact、タスク開始前に引用付きのコンテキストを取得する cortex guidance といった特定のコマンドを使用します。システムは、増分更新を行うバックグラウンドのwatcherとGit hooksによって正確性を維持します。主なワークフローはCLI経由ですが、MCP互換性を必要とするクライアントには cortex connect を使用できます。インデックス作成のために外部ネットワークサービスを呼び出すことなく、エージェントがシンボルの関係性を追跡し、リポジトリの規約を遵守できるように設計されています。
できること
- 1変更の影響分析特定の修正がコードベースの他の部分にどのように影響するかをエージェントに推定させます。
- 2実装パターンの特定AIエージェントに周辺のコードパターンを特定させ、新しいコードが既存のスタイルに従うようにします。
- 3リポジトリルールの取得コードを書く前に、エージェントにプロジェクトの有効なルールやアーキテクチャの決定事項を読み取らせます。
- 4コードレビューの実施ステージング済みまたは未ステージングの変更を、リポジトリの現在のHEADと比較してレビューするためにツールを使用します。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
Cortex MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude CodeにCortex MCPをインストール
$ claude mcp add cortex -- npx -y @danielblomma/cortex-mcpCursorにCortex MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"cortex": {
"command": "npx",
"args": [
"-y",
"@danielblomma/cortex-mcp"
]
}
}
}VS CodeにCortex MCPをインストール
.vscode/mcp.json
{
"servers": {
"cortex": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@danielblomma/cortex-mcp"
]
}
}
}VS Code CLIにCortex MCPをインストール
$ code --add-mcp '{"name":"cortex","type":"stdio","command":"npx","args":["-y","@danielblomma/cortex-mcp"]}'Claude DesktopにCortex MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"cortex": {
"command": "npx",
"args": [
"-y",
"@danielblomma/cortex-mcp"
]
}
}
}CodexにCortex MCPをインストール
$ codex mcp add cortex -- npx -y @danielblomma/cortex-mcpCodex config.tomlにCortex MCPをインストール
~/.codex/config.toml
[mcp_servers.cortex] command = "npx" args = ["-y", "@danielblomma/cortex-mcp"]
Gemini CLIにCortex MCPをインストール
$ gemini mcp add -s user cortex npx -- -y @danielblomma/cortex-mcpGemini settings.jsonにCortex MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"cortex": {
"command": "npx",
"args": [
"-y",
"@danielblomma/cortex-mcp"
]
}
}
}自動チェック
実行日 2026年11月14日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み · 点数を上げるための改善点
- ソースリポジトリがリンクされており、アクセス可能danielblomma/cortex is public and reachablegithub.com/danielblomma/cortex ↗合格
- パッケージがこのリポジトリをソースとして指定@danielblomma/cortex-mcp names danielblomma/cortex as sourcenpmjs.com/package/@danielblomma/cortex-mcp ↗合格
- ビルドの来歴 (Sigstore 証明)No build attestation published for this release未チェック
- オープンソースライセンス (OSI)No license検出事項
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-09-11github.com/danielblomma/cortex ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from @danielblomma/cortex-mcp合格
- パッケージおよびその依存関係に重大な勧告なし1 resolved dependencies checked; no critical advisoryosv.dev ↗合格
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見るCortex
Give AI coding agents the right context from your repository.
Cortex builds a local map of your code, symbols, relationships, and project rules. Coding agents query that map through the CLI instead of guessing or reading the whole repository.
Your code stays on your machine. MCP is not required.
Start
Requires Node.js 20.9+ and Git.
npm install --global @danielblomma/cortex-mcp
cd your-project
cortex init --bootstrap
This indexes the repository, adds Cortex instructions to AGENTS.md, installs
Git hooks, and starts the background watcher.
Check the setup:
cortex doctor
Use
# Find relevant code.
cortex search "where is authentication handled?" --json
# Follow relationships from a search result.
cortex related <entity-id> --json
# See what a change may affect.
cortex impact "authentication" --json
# Read repository rules.
cortex rules --json
# Compare a changed file with nearby patterns.
cortex pattern-evidence src/auth.ts --json
# Inspect deterministic active conventions for a file or indexed entity.
cortex conventions src/payments/retry.ts --json
# Get cited, deterministic context before implementing a code task.
cortex guidance src/payments/retry.ts --task "add bounded retry handling" --json
# Review the staged, unstaged, and non-ignored untracked candidate against HEAD.
cortex review --diff --json
# Refresh context after significant changes.
cortex update
Agents can run these commands directly. cortex init adds instructions that
tell them to search before answering and check impact before refactoring. They
do not need an MCP connection.
What Cortex adds
Without Cortex, an agent often searches by filename and reads many unrelated files. Cortex gives it structured repository context:
- semantic search across code, rules, and architecture decisions;
- symbol definitions and file relationships;
- caller and dependency traversal;
- impact analysis before refactoring;
- active rules, deprecations, and source-of-truth signals;
- deterministic, subsystem-scoped convention profiles with cited reusable symbols;
- incremental updates after Git and filesystem changes.
The pipeline is local and straightforward:
repository -> local index -> Cortex CLI -> coding agent
Commands you will use
| Command | Purpose |
|---|---|
cortex search "..." --json |
Find relevant code and context |
cortex related <entity-id> --json |
Follow relationships from a result |
cortex impact "..." --json |
Estimate the blast radius of a change |
cortex rules --json |
Show active repository rules |
cortex pattern-evidence <file> --json |
Find nearby implementation patterns |
cortex conventions <file-or-entity> --json |
Inspect bounded repository convention profiles |
cortex guidance <file-or-entity> --task <text> --json |
Get bounded cited pre-coding guidance |
cortex review --diff --json |
Review the current Git candidate with cited local evidence |
cortex update |
Refresh changed context |
cortex status |
Show index status |
cortex doctor |
Diagnose the local setup |
cortex watch status |
Check background synchronization |
cortex dashboard |
Open the local status dashboard |
Run cortex help for the complete command list.
cortex conventions uses only the local index. It returns bounded, live-backed
version-1 profiles and does not call a model, planner, provider, or network
service. See Repository convention profiles
for the exact eligibility, limit, hashing, persistence, and safety contract.
Before implementing a code task, use cortex guidance as cited additive
context—not policy authority. Continue to use normal search, related, and
impact when needed, and never skip explicit active rules or conflicts. The
command is local-only and inspection-only; see the exact versioned contract in
Pre-coding guidance.
After coding and before finalization, use cortex review --diff. It separates
exact source-of-truth violations from heuristic local-pattern warnings and is
inspection-only. See Deterministic diff review.
Keep the index fresh
Git hooks and the watcher normally update Cortex automatically.
cortex status
cortex watch status
cortex update
Run cortex update manually after a large change or when results look stale.
Large repositories
Make lexical and graph search available first while semantic indexing continues in the background:
cortex bootstrap --background --profile interactive
cortex indexing status --json
This mode supports macOS, Linux, and WSL. Native Windows should use normal foreground bootstrap.
Upgrade
npm install --global @danielblomma/cortex-mcp@latest
cortex init --force
cortex bootstrap
cortex update
Project configuration and rules are preserved. See CHANGELOG.md for version-specific notes.
Optional MCP compatibility
The normal Cortex workflow uses the CLI. If a client explicitly requires MCP,
run cortex connect.
DeepSeek Harness integration
Cortex supports DeepSeek Harness through the V1 explicit tools and skills
integration. Cortex 2.6.0 contains and validates the integration source against
the pinned Harness 0.1.1-rc.2 release. Separate npm bundle distribution is
deferred and currently unavailable.
The bundle provides four agent-scoped tools (cortex_search,
cortex_related, cortex_impact, and cortex_rules) and five Cortex behavior
skills (change-impact, context-review, pattern-review, repo-research,
and using-cortex). Retrieval is local, repository-scoped, explicit, and
user-controlled. The integration does not automatically initialize, update,
or watch a repository.
V2 proactive/assistive retrieval remains planned and experimental; it is not included in Cortex 2.6.0. See the V1-to-V2 integration plan for details.
Links
License
MIT
Cortex MCPのよくある質問
Cortex MCPをClaude Codeに追加するには
ターミナルでclaude mcp add cortex -- npx -y @danielblomma/cortex-mcpを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
Cortex MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
Cortexはコードをリモートサービスに送信しますか?
いいえ。インデックスの構築とクエリはローカルで行われるため、コードがマシン外に出ることはありません。
CortexにはMCP接続が必要ですか?
いいえ。エージェントはCortex CLIコマンドを直接実行します。MCPは、明示的に必要とするクライアントに対してのみオプションとして提供されます。
プロジェクトでCortexをセットアップするにはどうすればよいですか?
npmパッケージをグローバルにインストールした後、プロジェクトディレクトリで cortex init --bootstrap を実行してください。これにより、リポジトリのインデックス作成、AGENTS.mdへの指示の追加、Git hooksのインストール、およびwatcherの起動が行われます。
インデックスを最新の状態に保つにはどうすればよいですか?
通常はGit hooksとバックグラウンドのwatcherが自動的にCortexを更新しますが、大規模な変更の後は cortex update を手動で実行することもできます。
変更が何に影響するかを分析するにはどうすればよいですか?
リファクタリングの前に、cortex impact を特定のトピックに対して実行することで、影響範囲を推定できます。