AIエージェントによる、リポジトリ内のIssueのトリアージ、バグ修正、SARIFスキャナーの到達可能性の検証、およびセマンティックなコード検索を可能にします。
別名 thyn-ai/codna-cli, codna-cli, codna
- スター
- 0
- ツール
- —
- ダウンロード数(30日間)
- 13,218
- 最新バージョン
- 0.2.113
- 最終コミット
- 2026年11月14日
- ライセンス
- Apache-2.0
Codna MCPとは
CodnaはMCPサーバーです。 AIエージェントによる、リポジトリ内のIssueのトリアージ、バグ修正、SARIFスキャナーの到達可能性の検証、およびセマンティックなコード検索を可能にします。.
プロジェクトのREADMEから生成された概要
Codna MCP server について
Codnaは、コードベースをマッピングすることで、バグ修正やIssueのトリアージを容易にするリポジトリインテリジェンスをAIエージェントに提供します。stdio経由のMCP serverとして機能し、CursorやClaude Desktopなどのクライアントと統合できます。開発者は、CLIで使用されているものと同じエンジンを使用して、ローカルまたはクラウドで実行できます。ツールの実行を有効にするには、codna loginによる初回のみの無料コミュニティログインが必要ですが、バグ修正などの特定のタスクには、Anthropic、OpenAI、Geminiなどのサービスから取得したモデルプロバイダーのキーが必要です。
このサーバーは主に5つのツールを提供します。関連するコードを特定するcodna_triage、CodeQLやSnykなどのツールによるSARIFスキャナーの検出結果の到達可能性を検証するcodna_secure、そしてセマンティックおよびレキシカルなコード検索を行うcodna_recallです。アクティブな開発においては、codna_fixが根本原因を特定し、GitHubトークンが提供されている場合はプルリクエストを作成することも可能です。独自の機能としてオンデバイスメモリランタイムを備えており、初期設定後はネットワーク通信を行わずに、コードのrecallを完全にオフラインで実行できます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
Codna MCPのインストール方法
フォーマット検証日 2026年11月10日Claude CodeにCodna MCPをインストール
$ claude mcp add --env ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY> --env CODNA_API_KEY=<YOUR_CODNA_API_KEY> --env GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> --env GITHUB_TOKEN=<YOUR_GITHUB_TOKEN> --env OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> codna-cli -- uvx codnaCursorにCodna MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"codna-cli": {
"command": "uvx",
"args": [
"codna"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>",
"CODNA_API_KEY": "<YOUR_CODNA_API_KEY>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}VS CodeにCodna MCPをインストール
.vscode/mcp.json
{
"servers": {
"codna-cli": {
"type": "stdio",
"command": "uvx",
"args": [
"codna"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>",
"CODNA_API_KEY": "<YOUR_CODNA_API_KEY>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}Claude DesktopにCodna MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"codna-cli": {
"command": "uvx",
"args": [
"codna"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>",
"CODNA_API_KEY": "<YOUR_CODNA_API_KEY>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}CodexにCodna MCPをインストール
~/.codex/config.toml
[mcp_servers.codna-cli] command = "uvx" args = ["codna"] [mcp_servers.codna-cli.env] ANTHROPIC_API_KEY = "<YOUR_ANTHROPIC_API_KEY>" CODNA_API_KEY = "<YOUR_CODNA_API_KEY>" GEMINI_API_KEY = "<YOUR_GEMINI_API_KEY>" GITHUB_TOKEN = "<YOUR_GITHUB_TOKEN>" OPENAI_API_KEY = "<YOUR_OPENAI_API_KEY>"
Gemini CLIにCodna MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"codna-cli": {
"command": "uvx",
"args": [
"codna"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>",
"CODNA_API_KEY": "<YOUR_CODNA_API_KEY>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}設定
ANTHROPIC_API_KEYシークレットProvider key for codna_fix's planner — any one of ANTHROPIC_API_KEY (Anthropic), OPENAI_API_KEY (OpenAI/ChatGPT), or GEMINI_API_KEY (Gemini) works (or store one with `codna key set <provider>`). Every tool also requires the one-time free `codna login` device authorization before executing; introspection (initialize/tools/list) needs no credentials.
CODNA_API_KEYシークレットCodna key from the one-time free `codna login` (device authorization, free community license). Required to execute any of the five tools; introspection (initialize/tools/list) needs none.
GEMINI_API_KEYシークレットAlternative provider key (Gemini) for codna_fix's planner — see ANTHROPIC_API_KEY.
GITHUB_TOKENシークレットWrite token, only for codna_fix with open_pr=true (opens a pull request) and codna_report_bug (files an issue).
OPENAI_API_KEYシークレットAlternative provider key (OpenAI/ChatGPT) for codna_fix's planner — see ANTHROPIC_API_KEY.
| 名前 | 説明 | 種類 |
|---|---|---|
| ANTHROPIC_API_KEY | Provider key for codna_fix's planner — any one of ANTHROPIC_API_KEY (Anthropic), OPENAI_API_KEY (OpenAI/ChatGPT), or GEMINI_API_KEY (Gemini) works (or store one with `codna key set <provider>`). Every tool also requires the one-time free `codna login` device authorization before executing; introspection (initialize/tools/list) needs no credentials. | シークレット |
| CODNA_API_KEY | Codna key from the one-time free `codna login` (device authorization, free community license). Required to execute any of the five tools; introspection (initialize/tools/list) needs none. | シークレット |
| GEMINI_API_KEY | Alternative provider key (Gemini) for codna_fix's planner — see ANTHROPIC_API_KEY. | シークレット |
| GITHUB_TOKEN | Write token, only for codna_fix with open_pr=true (opens a pull request) and codna_report_bug (files an issue). | シークレット |
| OPENAI_API_KEY | Alternative provider key (OpenAI/ChatGPT) for codna_fix's planner — see ANTHROPIC_API_KEY. | シークレット |
自動チェック
実行日 2026年11月12日詳細レポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能合格
- オープンソースライセンス (OSI)合格
- 過去1年以内にコミットまたはリリースあり合格
- パッケージ名が有名なパッケージに酷似していない合格
- リモートエンドポイントがHTTPSを使用未チェック
- 破壊的なツールがラベル付けされている未チェック
- モデルへの隠れた指示がない合格
- パッケージと依存関係に重大なアドバイザリがない合格
README
GitHubで見るCodna
Understand. Fix. Evolve.
Agents read your code. Codna understands it.
Codna maps a repository before it spends a token. It then reviews pull requests, fixes bugs and
proves which scanner findings are reachable. The same codna command runs on your machine, in the
GitHub Action and behind the GitHub App.
Runs on your machine or your cloud. Your code never leaves without your key.
Install
pip install codna # or: pipx install codna · uv tool install codna
codna --version
Python 3.12–3.13. Wheels for macOS on Apple silicon and Linux x86_64. git on your PATH.
Nothing else to install: no Node, Bun, Docker or server. The agent runtime ships inside the wheel.
Local commands need no Codna key. fix and review use your own model provider key, stored in
the OS keychain and never printed:
codna key set anthropic # also: openai, gemini, google, groq, mistral, openrouter, xai, cursor
Commands
codna triage . --issue "checkout total is wrong" # suspect files. Deterministic. 0 LLM tokens.
codna review . --pr 123 --post # findings with a verdict on the pull request
codna fix . --tests --apply --max-iterations 3 # patch, re-run your tests, re-fix until green
codna fix <git url> --ref <sha> --issue "…" --open-pr # push a branch and open a pull request
codna secure . --from-sarif results.sarif # which scanner findings are reachable. 0 LLM tokens.
codna fix prints the root cause, the impacted symbols, the blast radius, its confidence and a
regression risk. --open-pr needs a git URL and a GitHub write token. codna review posts one
inline comment per finding with severity, category and a suggestion block, and an Approve when the
diff is clean at medium and high. codna secure reads SARIF 2.1.0 from CodeQL, Semgrep, Snyk,
Trivy or any other scanner.
Other commands: init, status, doctor, login, key, impact, memory export, report.
Full reference: docs.codna.ai/reference/cli.
MCP server
Run Codna as a Model Context Protocol server over stdio — the same engine the CLI uses, inside Cursor, Claude Desktop, or your own agent:
pipx install "codna[mcp]" # or: pip install "codna[mcp]"
codna mcp # serve over stdio
codna mcp install --client cursor # optional: write the client config for you (or --client claude)
Five tools, each returning JSON; a failure comes back as codna_<tool> error: … text and never
crashes the server:
| Tool | What it does | Needs |
|---|---|---|
codna_triage |
Understand a repo and locate the code relevant to an issue. Deterministic, 0 LLM tokens. | free codna login |
codna_secure |
Prove which SARIF scanner findings (CodeQL, Semgrep, Snyk, Trivy) are reachable. Read-only, 0 LLM tokens. | free codna login |
codna_recall |
Recall code from local on-device memory — semantic + lexical search, fully offline. | free codna login (which also installs the on-device runtime) |
codna_fix |
Root-cause and plan a fix (read-only by default); with open_pr=true pushes a branch and opens a real PR. |
free codna login + provider key (BYOK; + GITHUB_TOKEN for open_pr=true) |
codna_report_bug |
File a bug, feature, or question to thyn-ai/feedback. | free codna login + GITHUB_TOKEN (else returns a pre-filled URL) |
Introspection (initialize/tools/list) needs no credentials. Executing any of the five tools
requires the one-time free community login (codna login — device authorization, free community
license) — fully offline thereafter. codna_fix additionally needs a provider key (BYOK, e.g.
ANTHROPIC_API_KEY); codna_report_bug needs GITHUB_TOKEN or it returns a pre-filled issue
URL; codna_recall additionally uses the on-device memory runtime that the same codna login
installs.
Full reference:
docs.codna.ai/guides/mcp.
Code memory
Code memory and recall run on your machine after a one-time free codna login (device
authorization), which also installs the signed on-device runtime. From then on, recall runs fully
offline: no key, no network calls. The optional
codna[memory] extra adds the on-device semantic reranker; without it, recall ranks lexically.
What leaves your machine
- Repository mapping, triage, recall and
impactrun offline. No model is involved. fixandreviewsend one issue-specific evidence bundle to the provider you chose, under your key. Not the repository.- Secret redaction is always on and cannot be turned off.
privacy.egress: fail-closedincodna.yamlrefuses to run tests without network denial and skips registry lookups during review.- Source distributions exclude runtime binaries, keys,
.envfiles and logs.
Links
- Homepage: https://codna.ai
- Documentation: https://docs.codna.ai
- Source (public mirror): https://github.com/thyn-ai/codna-cli
- Security: https://codna.ai/security
Codna MCPのよくある質問
Codna MCPをClaude Codeに追加するには
ターミナルでclaude mcp add --env ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY> --env CODNA_API_KEY=<YOUR_CODNA_API_KEY> --env GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> --env GITHUB_TOKEN=<YOUR_GITHUB_TOKEN> --env OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> codna-cli -- uvx codnaを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
Codna MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
Codnaはリポジトリ全体をLLMに送信しますか?
いいえ、fixおよびreviewは、リポジトリ全体ではなく、選択したプロバイダーに対して、使用しているキーに基づいたIssue固有のエビデンスバンドルのみを送信します。
CursorやClaude DesktopでCodnaを使用するにはどうすればよいですか?
pipx経由でMCP serverをインストールし、installコマンドを使用することで、CursorやClaude用のクライアント設定を自動的に書き込むことができます。
Codnaをオフラインで使用できますか?
はい、リポジトリマッピング、トリアージ、recall、およびimpactツールはオフラインで動作します。また、recallは初回ログイン後、完全にオフラインで動作します。
Codnaはどのようなスキャナーの検出結果を分析できますか?
Codnaは、CodeQL、Semgrep、Snyk、Trivy、またはSARIF 2.1.0を提供できるその他のスキャナーによる検出結果の到達可能性を証明できます。