项目简介
Octomind是一个会话优先的AI开发助手,它革新了您与代码库的交互方式。基于Model Context Protocol (MCP) 构建,Octomind提供与开发工具的无缝集成、多AI服务商支持以及智能成本优化功能。它允许您通过自然语言指令执行文件操作、代码分析、shell命令、网络搜索等任务,显著提升开发效率。
主要功能点
- 会话优先架构: 所有操作都在交互式AI会话中进行,并保持上下文。这意味着您可以进行多轮对话,AI会记住之前的交流内容。
- 内置MCP工具: Octomind拥有强大的内置工具集,包括:
- 开发者工具: 执行shell命令 ('shell()')、进行抽象语法树代码搜索和重构 ('ast_grep()')、以及管理复杂任务的执行计划 ('plan()')。
- 文件系统工具: 进行文件读写 ('text_editor()')、文件列表 ('list_files()')、批量编辑 ('batch_edit()') 等。
- Web工具: 执行网络搜索 ('web_search()')、阅读HTML内容 ('read_html()')、以及进行图片和视频搜索。
- AI代理工具: 调度和执行复杂的AI任务流程 ('agent_*()') 和直接调用LLM ('call_llm()')。
- 多AI服务商支持: 无缝集成OpenRouter、OpenAI、Anthropic、Google、Amazon、Cloudflare、DeepSeek等多个主流AI模型提供商,您可以灵活切换模型。
- 多模态视觉支持: 利用AI视觉能力分析图像、截图和图表,帮助您理解视觉信息。
- 成本跟踪与优化: 实时监控您的AI使用情况、提供缓存机制和详细的成本报告,帮助您优化支出。
- 智能会话延续: 自动管理会话上下文,即使达到Token限制也能智能地保持对话连贯性。
- 分层处理: 采用AI管道系统进行复杂任务的分解和专业化处理,提高任务执行效率和准确性。
安装步骤
- 先决条件:
- 支持的AI服务商API Key(如OpenRouter、OpenAI)。
- 如果您选择从源代码构建,需要安装 Rust 1.82+ 和 Cargo。
- 一键安装 (推荐):
在终端中运行以下命令,即可轻松安装Octomind:
curl -fsSL https://raw.githubusercontent.com/muvon/octomind/master/install.sh | bash - 设置API Key:
选择一个您希望使用的AI服务商,并将其API Key设置为环境变量。建议使用OpenRouter以获得多模型访问能力:
export OPENROUTER_API_KEY="sk-or-v1-..." # 推荐,提供多服务商访问 # 或者直接设置其他服务商的API Key,例如: export OPENAI_API_KEY="sk-..." export ANTHROPIC_API_KEY="sk-ant-..." # 其他AI服务商的API Key设置方式类似,请参考Octomind官方文档。 - 启动您的第一个会话:
完成API Key设置后,运行以下命令启动Octomind的交互式AI会话:
octomind session
服务器配置 (作为MCP客户端连接Octomind提供的MCP服务)
Octomind是一个强大的AI开发助手,它本身内置了多种MCP服务(如'developer'、'filesystem'、'web'、'agent'),也能够启动和管理外部MCP服务器进程。这意味着您可以将Octomind配置为一个MCP服务器,供其他MCP客户端(如LLM应用)调用其提供的工具。
如果您是一个MCP客户端开发者,希望您的LLM应用调用Octomind提供的工具,您可以将Octomind配置为一个本地进程MCP服务器。
以下是MCP客户端如何配置连接到由Octomind托管的内置MCP服务的示例说明。请注意,这里的'command'和'args'是基于Octomind架构的合理推测,用于演示MCP客户端如何配置Octomind作为MCP服务器进程(例如通过标准输入/输出来通信,即'stdin'连接类型)。
{ "mcp": { "servers": [ { "name": "developer_tools_octomind", "description": "Octomind内置的开发者工具集,提供shell命令执行、AST代码搜索和计划任务管理。", "connection_type": "stdin", "command": "octomind", "args": ["mcp", "serve", "--server-name", "developer", "--connection-type", "stdin"], "tools": ["shell", "ast_grep", "plan"] }, { "name": "filesystem_octomind", "description": "Octomind内置的文件系统操作工具,用于文件读写、列表和批量修改。", "connection_type": "stdin", "command": "octomind", "args": ["mcp", "serve", "--server-name", "filesystem", "--connection-type", "stdin"], "tools": ["text_editor", "list_files", "batch_edit", "extract_lines"] }, { "name": "web_tools_octomind", "description": "Octomind内置的网络工具,用于网页搜索、图像视频搜索和HTML内容读取。", "connection_type": "stdin", "command": "octomind", "args": ["mcp", "serve", "--server-name", "web", "--connection-type", "stdin"], "tools": ["web_search", "read_html", "image_search", "video_search", "news_search"] }, { "name": "agent_orchestration_octomind", "description": "Octomind内置的AI代理调度器,用于执行复杂的AI工作流和模型调用。", "connection_type": "stdin", "command": "octomind", "args": ["mcp", "serve", "--server-name", "agent", "--connection-type", "stdin"], "tools": ["agent_*", "call_llm"] } ] } }
重要提示: 上述'command'和'args'是基于Octomind架构的合理推测,用于演示MCP客户端如何配置。您需要参考Octomind的最新官方文档(特别是'doc/08-mcp-server-development.md'部分),以获取启动Octomind内置服务作为独立MCP服务器的确切命令行参数和配置方法。在典型的Octomind交互会话中,这些内置服务会由Octomind自动管理和调用,用户无需手动配置。
基本使用方法
在启动'octomind session'会话后,您可以直接与AI助手对话并使用其内置工具:
- 自然语言提问: "How does authentication work in this project?" (AI会分析代码库并提供详细解释)
- 代码修改指令: "Add error handling to the login function" (AI会检查代码并建议具体的修改方案)
- 批量代码操作: "Rename 'processData' to 'processUserData' across all files" (AI会自动执行跨文件批量编辑)
- 视觉信息分析: 先输入 '/image screenshot.png' 附带图片,然后提问 "What's wrong with this UI layout?" (AI会分析图片内容并提供布局优化建议)
- 查看MCP服务状态: 输入 '/mcp info' 可以显示当前MCP服务器的状态和所有可用的工具。
- 执行计划任务: 使用 'plan' 工具启动一个多步、结构化的任务,例如:'plan(command="start", title="Implement User Profile Feature", tasks=[{"title":"Design API Endpoints", "description":"Detailed design for GET /users/{id} and PUT /users/{id} endpoints..."}, {"title":"Implement Backend Logic", "description":"Develop Rust handlers in src/api/users.rs for profile management..."}])'
- 执行Shell命令: 'shell(command="ls -la")' (执行系统shell命令并返回结果)
- 代码结构搜索: 'ast_grep(pattern="console.log($$$)", language="javascript")' (使用AST模式搜索代码)
- 网络内容搜索: 'web_search(query="Rust async programming best practices")' (在网络上进行搜索)
信息
分类
开发者工具