
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.
概览
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。
安装
在 SourceWeft 中
- 打开 控制台中的 Codna — repository intelligence,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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
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:
Commands
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:
Five tools, each returning JSON; a failure comes back as codna_<tool> error: … text and never
crashes the server:
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
来源:README.md,提交 f8cd448
工具
0版本历史
16- v0.2.112Nov 7, 2026
- v0.2.106Nov 6, 2026
- v0.2.104Nov 5, 2026
- v0.2.98Nov 5, 2026
- v0.2.97Nov 5, 2026
- v0.2.96Nov 1, 2026
- v0.2.95Oct 26, 2026
- v0.2.94Oct 16, 2026
- v0.2.93Oct 11, 2026
- v0.2.90Sep 28, 2026
- v0.2.89Sep 25, 2026
- v0.2.87Sep 24, 2026
- v0.2.86Sep 24, 2026
- v0.2.85Sep 23, 2026
- v0.2.84Sep 23, 2026
- v0.2.83Sep 23, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分