KODEGEN.017424-
高效、快速的MCP开发工具
科德根。ᴀ提供了一个超快的Rust原生MCP服务器(模型上下文协议),配备100多个精英自动编码工具,专为专业、自主的代码生成和可预测的高质量结果而设计。每个工具都经过深思熟虑的超优化,以提高速度(更快地编码)和上下文效率(更便宜地编码)。
 
科德根。ᴀɪ存储库
- 赛洛
- 编码器
- 编码属性
- kodegen蜡烛剂
- 代码-claude-agent
- 编码器-mcp-client
- 编解码器 mcp 方案
- kodegen服务器http
- kodegen simd
- kodegen工具浏览器
- 科迪根工具公司
- 编码器-工具-配置
- kodegen工具数据库
- kodegen工具文件系统
- kodegen工具git
- kodegen工具内省
- 编码工具进程
- 编码工具提示符
- kodegen工具推理机
- kodegen工具顺序思维
- 编码工具终端
- kodegen utils
概述
科德根。ᴀɪ专为快速、可靠和内存高效的上下文高效LLM代码生成而构建。
主要特点
🗂️ 曲速模式
14个文件系统工具针对具有原子操作和并发遍历的编码工作流进行了优化。读取具有偏移量的大量文件,批处理多个文件,使用流式结果搜索代码库,并以不同的精度进行外科手术编辑。
🔧 Git超级功能
由Gitoxide提供支持的20个全面的git工具,用于超快的存储库操作。初始化、克隆、分支、提交、签出、获取、合并和管理工作树——所有这些都采用异步优先设计和生产级错误处理。
💻 终端作为工具
具有智能状态检测和实时输出流的完整VT100伪终端会话。当AI代理需要完全的系统访问权限来运行构建、执行测试或管理部署时,这是完美的。
🧠 推理链
在扩展的问题解决过程中,进行有状态的思考,包括分支、修订和无限的上下文。分解参与者模型并发的复杂问题,以实现无锁性能。
🔮 代理人与代理人
N深度代理委托,对分层、协调的代理金字塔进行完全即时控制。Spawn专门为深度研究、复杂代码生成或并行分析提供Claude子代理。
🌐 网络爬行和搜索
4个用于自主网络文档爬行和全文搜索的工具。具有Tantivy索引、速率限制和多格式输出(Markdown/HTML/JSON)的后台爬行。非常适合从文档网站构建可搜索的知识库。
🐙 GitHub集成
用于全面集成GitHub API的16个工具。创建和管理问题,拉取请求、评论和评论。跨存储库搜索代码,管理PR,请求Copilot评论,并从您的AI代理自动化整个GitHub工作流程。
📊 LLM可观察性
跟踪工具使用情况,分析模式,并通过内置自检优化工作流程。每次调用都会被跟踪,以实现人工智能的自我提升。
📝 代理商管理提示
使用Jinja2渲染和模式验证创建和管理可重用的提示模板。构建提示库,并以编程方式标准化代理指令。
安装
快速安装
安装KODEGEN。ᴀ只需一个命令:
curl -fsSL https://kodegen.ai/install | sh这将:
- ✅ 每晚安装Rust
- ✅ 构建和安装
kodegen二进制 - ✅ 自动配置所有检测到的MCP客户端
- ✅ 让你准备好编码!
自动编辑器配置
安装程序会自动运行 kodegen install 其配置如下:
- ✅ 克劳德桌面版 -自动配置
claude_desktop_config.json - ✅ 帆板运动 -自动配置Windsurf MCP设置
- ✅ 光标 -自动配置光标AI设置
- ✅ 泽德 -自动配置Zed编辑器设置
- ✅ Roo代码 -自动配置Roo代码设置
手动安装
对于手动安装或从源代码构建:
# Clone the repository
git clone https://github.com/cyrup-ai/kodegen
cd kodegen
# Run installation script (handles all binaries with verification)
./install.sh脚本将:
- ✅ 编译并安装kodegen MCP服务器
- ✅ 编译并安装kodegend守护进程
- ✅ 在继续之前,请验证两个二进制文件都已准备就绪
- ✅ 自动配置检测到的MCP客户端
- ✅ 安装并启动守护程序服务
手动MCP客户端配置
添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"kodegen": {
"command": "kodegen"
}
}
}配置
运行时工具选择
通过向kodegen二进制文件传递参数来控制哪些工具在运行时处于活动状态:
方法1:逗号分隔列表
{
"mcpServers": {
"kodegen": {
"command": "kodegen",
"args": ["--tools", "filesystem,terminal,citescrape"]
}
}
}方法2:多重标记
{
"mcpServers": {
"kodegen": {
"command": "kodegen",
"args": [
"--tool", "filesystem",
"--tool", "terminal",
"--tool", "citescrape"
]
}
}
}可用工具类别:
filesystem-14个文件操作工具terminal-5个终端/流程管理工具process-2个流程管理工具sequential_thinking-1个推理链工具claude_agent-5个子代理编排工具citescrape-4个网络抓取和搜索工具prompt-4个提示模板管理工具introspection-2个可观察性工具git-20个git存储库工具(init、clone、branch、commit、checkout、fetch、merge、worktree操作)github-16个GitHub API工具(问题、PR、评论、评论、代码搜索、Copilot集成)config-2个配置管理工具(始终启用)
如果没有提供参数,则默认情况下启用所有编译的工具类别。
运行时配置
AI代理可以在运行时修改配置:
set_config_value({
"key": "file_read_line_limit",
"value": 5000
})配置选项:
file_read_line_limit-每个文件可读取的最大行数(默认值:2000)file_write_line_limit-每次操作可写入的最大行数(默认值:1000)fuzzy_search_threshold-模糊匹配的相似性阈值(默认值:0.8)blocked_commands-终端会话中要阻止的命令列表allowed_paths-文件操作路径白名单max_search_results-返回的最大搜索结果数(默认值:100)terminal_timeout-终端命令超时(秒)(默认值:300)
高级用户
带有特征门的自定义构建
通过仅编译所需的工具来创建超优化的二进制文件:
# Build with only filesystem and terminal tools
cargo build --release \
--no-default-features \
--features "filesystem,terminal"
# Install custom build
cargo install --path . \
--no-default-features \
--features "filesystem,terminal,sequential_thinking"可用功能标志:
filesystem-14个工具(约800KB)terminal-5个工具(约300KB)sequential_thinking-1个工具(~150KB)claude_agent-5个工具(~400KB)citescrape-3个工具(约600KB)prompt-4个工具(约250KB)introspection-2个工具(~100KB)process-2个工具(~150KB)
通用构建配置文件
最小编码助手(文件系统+终端)
cargo install --path . \
--no-default-features \
--features "filesystem,terminal"
# Binary: ~1.2MB (vs 3.5MB full build)
# Perfect for: Basic file operations and command execution思维代理(文件系统+顺序思维+代理)
cargo install --path . \
--no-default-features \
--features "filesystem,sequential_thinking,claude_agent"
# Binary: ~1.8MB
# Perfect for: Research, analysis, and multi-step reasoning文档爬虫(文件系统+Citescrape+顺序思维)
cargo install --path . \
--no-default-features \
--features "filesystem,citescrape,sequential_thinking"
# Binary: ~2.5MB
# Perfect for: Building searchable docs from websites, knowledge base creation全功能版本(默认)
cargo install --path .
# Binary: ~3.5MB
# Includes: All 33 tools across 7 categories结合编译时和运行时过滤
为了实现最大优化:
# 1. Build with only filesystem and terminal features
cargo install --path . \
--no-default-features \
--features "filesystem,terminal"
# 2. Configure MCP client to use only filesystem tools
{
"mcpServers": {
"kodegen": {
"command": "kodegen",
"args": ["--tool", "filesystem"]
}
}
}
# Result: Smallest binary + fastest startup + minimal memory footprint性能比较
| 构建配置 | 二进制大小 | 启动时间 | 内存使用情况 |
|---|---|---|---|
| 完整构建(所有功能) | ~3.5MB | ~25ms | ~8MB |
| 最小值(文件系统+终端) | ~1.2MB | ~12ms | ~4MB |
| 仅限文件系统 | ~900KB | ~8ms | ~3MB |
*注:测量值为近似值,可能因平台而异。*
工具参考
文件系统工具(14个工具)
fs_read_file
读取文件内容,支持偏移量/长度,适用于海量文件。
fs_read_file({
"path": "src/main.rs",
"offset": 0,
"limit": 100
})fs_write_file
使用原子操作将内容写入或附加到文件中。
fs_write_file({
"path": "output.txt",
"content": "Hello, world!",
"append": false
})fs_edit_block
手术文本替换与自动模糊匹配。
fs_edit_block({
"path": "src/main.rs",
"old_string": "fn process_data",
"new_string": "async fn process_data"
})其他文件系统工具: fs_read_multiple_files, fs_move_file, fs_delete_file, fs_delete_directory, fs_create_directory, fs_get_file_info, fs_list_directory, fs_search
终端工具(5个工具)
start_terminal_command
生成完整的VT100伪终端会话。
start_terminal_command({
"command": "cargo build --release",
"working_directory": "."
})其他终端工具: read_terminal_output, send_terminal_input, stop_terminal_command, list_terminal_commands
顺序思维(1个工具)
sequential_thinking
使用有状态推理会话分解复杂问题。
sequential_thinking({
"thought": "Analyzing the architecture patterns...",
"thought_number": 1,
"session_id": "planning-session-1"
})代理编排(5个工具)
spawn_claude_agent
Spawn为Claude指定了代表团的分代理。
spawn_claude_agent({
"task": "Research API design patterns for Rust",
"prompt_template": "research_agent"
})其他代理工具: read_claude_agent_output, send_claude_agent_prompt, terminate_claude_agent_session, list_claude_agents
快速管理(4个工具)
prompt_add
使用Jinja2创建可重用的提示模板。
add_prompt({
"name": "code_review",
"template": "Review this code: {{ code }}",
"description": "Code review prompt"
})其他提示工具: prompt_edit, prompt_delete, prompt_get
内省(2个工具)
inspect_usage_stats-跟踪工具使用情况和性能指标inspect_tool_calls-检查最近的工具调用
流程管理(2个工具)
list_processes-列出具有过滤功能的系统进程kill_process-通过PID终止进程
配置(2个工具)
get_config-检索当前配置值set_config_value-在运行时修改配置
例子
完整的工作流程:重构Rust项目
// 1. Search for function to refactor
start_search({
"pattern": "fn process_data",
"path": "src/"
})
// 2. Read the file
read_file({
"path": "src/processor.rs"
})
// 3. Make the function async
edit_block({
"path": "src/processor.rs",
"old_string": "fn process_data(input: &str) -> Result",
"new_string": "async fn process_data(input: &str) -> Result"
})
// 4. Run tests
start_terminal_command({
"command": "cargo test"
})
// 5. Check output
read_terminal_output({
"session_id": "terminal-123"
})多智能体研究
// Spawn a research agent
spawn_claude_agent({
"task": "Research best practices for error handling in Rust async code"
})
// Spawn another for code generation
spawn_claude_agent({
"task": "Generate example error handling code based on research findings"
})
// Monitor agents
list_claude_agents({})
// Read results
read_claude_agent_output({
"agent_id": "agent-001"
})建筑规划的顺序思维
// Start thinking session
sequential_thinking({
"session_id": "architecture-planning",
"thought": "Need to design a scalable API layer",
"thought_number": 1
})
// Branch to explore alternatives
sequential_thinking({
"session_id": "architecture-planning",
"thought": "Option A: REST API with versioning",
"thought_number": 2,
"branch_from": 1
})
// Revise earlier thinking
sequential_thinking({
"session_id": "architecture-planning",
"thought": "Actually, REST is better for our use case due to caching",
"thought_number": 4,
"revises": 2
})错误处理:RMCP集成
RMCP错误如何出现在日志中
stdio服务器在INFO/ERROR级别记录RMCP初始化和传输错误:
启动时连接失败:
ERROR Failed to connect to filesystem server at https://mcp.kodegen.ai:30438/mcp: connection closed during init (connection closed during: initialize response)
WARN 2 of 7 category servers failed to connect and are offline. Server starting with reduced functionality.工具调用期间的会话/传输故障:
ERROR Session/transport broken for tool 'read_file' (category: filesystem): connection closed during init - connection closed during: tool call response. Attempting recovery...
INFO Reconnection successful for category 'filesystem'. Retrying tool call 'read_file'...
INFO Tool call 'read_file' succeeded after recovery超时错误:
ERROR Tool 'complex_search' timed out after 30s (operation: call_tool)类别离线时的行为
部分类别离线:
- 服务器成功启动
- 离线类别被排除在外
list_tools结果 - 对离线类别的工具调用失败很快,错误很明显
- 首次工具调用时自动重新连接到脱机类别
所有类别离线:
- 服务器启动失败,出现错误:
Failed to connect to all 7 category servers. See errors above. - 单个错误日志显示每个类别失败的原因
恢复行为
stdio服务器会自动从以下位置恢复:
- HTTP 401(会话已过期)→ 重新连接并重试一次
- RMCP连接关闭错误→ 重新连接并重试一次
- RMCP传输关闭错误→ 重新连接并重试一次
无法恢复:
- 超时(记录并作为错误返回)
- 协议错误(记录并作为错误返回)
- 解析错误(记录并作为错误返回)
贡献
我们欢迎捐款!请看 贡献.md 作为指导方针。
贡献者快速入门
- 复刻仓库
- 克隆你的叉子:
git clone https://github.com/YOUR_USERNAME/kodegen.git - 创建要素分支:
git checkout -b feature/amazing-tool - 进行更改
- 运行测试:
cargo test - 承诺并推动:
git push origin feature/amazing-tool - 打开拉取请求
开发指南
- 遵循中的工具模式
packages/filesystem/src/read_file.rs - 所有工具均执行
Tool特质 - 写全面
prompt()法学硕士学习方法 - 将JsonSchema添加到所有Args类型
- 在两个路由器中注册工具(工具+提示)
- 更新文档
社区
- GitHub存储库: 编码器/编码器
- 网站: kodegen.ai
- 文档: 代码.ai/docs
许可证
科德根。ᴀɪ在Apache-2.0和MIT下获得双重许可。看 许可证.md 了解详情。
鸣谢
用(爱)制造 青榨槭
______________________________________________________________________
欢迎来到KODEGEN。ᴀɪ! 🚀
