Codna — repository intelligence

io.github.thyn-ai由 GitHub 帳號 thyn-ai 發布v0.2.112更新於 Nov 7, 2026

Repo intelligence: triage, fix PRs, SARIF reachability, recall. Free codna login to execute.

概覽

AI 產生的概覽

Codna 為助理提供儲存庫智慧:把問題定位到可疑檔案、規劃修正、判斷 SARIF 掃描結果是否可達,並從本機記憶召回程式碼。

可以做什麼
  • 以確定性方式分析儲存庫並找出與某個問題相關的程式碼,不消耗 LLM token
  • 以唯讀方式證明哪些 SARIF 掃描結果(CodeQL、Semgrep、Snyk、Trivy)確實可達
  • 透過語意與詞彙搜尋從裝置端記憶召回程式碼,完全離線
  • 找出根因並規劃修正,預設為唯讀,也可推送分支並建立真實的拉取請求
  • 向廠商的意見回饋儲存庫提交缺陷、功能請求或問題
適用情境
適合助理在程式碼庫中工作時使用:需要找出某個缺陷回報背後的檔案、判斷掃描告警是否真的可達、從本機記憶檢索相關程式碼,或產生修正並選擇性地送出拉取請求。
執行需求
本機 Python 套件(pip、pipx 或 uv),需 Python 3.12-3.13,僅支援 macOS Apple 晶片與 Linux x86_64,PATH 中需有 git;以 stdio 方式執行。執行任何工具都需要一次免費的 codna login。codna_fix 另需模型供應商金鑰,例如 ANTHROPIC_API_KEY、OPENAI_API_KEY 或 GEMINI_API_KEY;open_pr=true 與 codna_report_bug 需要 GITHUB_TOKEN。
安裝前請注意
codna_fix 在 open_pr=true 時會推送分支並建立拉取請求,codna_report_bug 會在公開意見回饋儲存庫開立 issue,兩者都會寫入遠端服務。fix 與 review 會用你的金鑰把針對該問題的證據包傳送給你選擇的模型供應商。供應商金鑰與 GITHUB_TOKEN 屬機密;README 表示金鑰存於作業系統鑰匙圈,且機密遮蔽始終開啟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Codna — repository intelligence,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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

bash
pip install codna          # or: pipx install codna · uv tool install codnacodna --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:

bash
codna key set anthropic    # also: openai, gemini, google, groq, mistral, openrouter, xai, cursor

Commands

bash
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 requestcodna fix . --tests --apply --max-iterations 3        # patch, re-run your tests, re-fix until greencodna fix <git url> --ref <sha> --issue "…" --open-pr # push a branch and open a pull requestcodna 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:

bash
pipx install "codna[mcp]"       # or: pip install "codna[mcp]"codna mcp                       # serve over stdiocodna 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:

ToolWhat it doesNeeds
codna_triageUnderstand a repo and locate the code relevant to an issue. Deterministic, 0 LLM tokens.free codna login
codna_secureProve which SARIF scanner findings (CodeQL, Semgrep, Snyk, Trivy) are reachable. Read-only, 0 LLM tokens.free codna login
codna_recallRecall code from local on-device memory — semantic + lexical search, fully offline.free codna login (which also installs the on-device runtime)
codna_fixRoot-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_bugFile 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 impact run offline. No model is involved.
  • fix and review send 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-closed in codna.yaml refuses to run tests without network denial and skips registry lookups during review.
  • Source distributions exclude runtime binaries, keys, .env files and logs.

Links

來源:README.md,提交 f8cd448

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

16
  1. v0.2.112最新Nov 7, 2026
  2. v0.2.106Nov 6, 2026
  3. v0.2.104Nov 5, 2026
  4. v0.2.98Nov 5, 2026
  5. v0.2.97Nov 5, 2026
  6. v0.2.96Nov 1, 2026
  7. v0.2.95Oct 26, 2026
  8. v0.2.94Oct 16, 2026
  9. v0.2.93Oct 11, 2026
  10. v0.2.90Sep 28, 2026
  11. v0.2.89Sep 25, 2026
  12. v0.2.87Sep 24, 2026
  13. v0.2.86Sep 24, 2026
  14. v0.2.85Sep 23, 2026
  15. v0.2.84Sep 23, 2026
  16. v0.2.83Sep 23, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分