Codna — repository intelligence

io.github.thyn-ai由 GitHub 账号 thyn-ai 发布v0.2.113更新于 Nov 8, 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.112Nov 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 分