feat(mcp): add Kimi CLI adapter for MCP config import - #821
Open
whyihaveyou wants to merge 1 commit into
Open
Conversation
Adds a KimiAdapter that detects MCP servers from the Kimi Code CLI user-level config file (~/.kimi-code/mcp.json, honoring $KIMI_CODE_HOME). Kimi Code CLI exposes no mcp subcommand, so install/remove rewrite the config file atomically (temp file + rename). - New McpSource::Kimi variant (serde "kimi") - Parses stdio/http/sse entries; disabled servers flagged with import_skip_reason - Adapter registered in adapters/mod.rs and added to the MCP sync scan list in aionui-app router state - Unit tests for parsing, JSON round-trips, and file I/O Refs: iOfficeAI/AionUi#3975
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Kimi Code CLI adapter to the MCP agent sync layer, so AionUi's "one-click MCP import" can detect and import MCP servers configured in Kimi Code CLI.
Part of the effort to extend one-click MCP import beyond Claude Code and Codex (see iOfficeAI/AionUi#3975).
Changes
crates/aionui-mcp/src/adapters/kimi.rs:~/.kimi-code/mcp.json(honoring$KIMI_CODE_HOME), the user-level config file documented at https://moonshotai.github.io/kimi-code/en/customization/mcpcommand), HTTP (url), and legacy SSE (transport: "sse") entries; disabled servers (enabled: false) are flagged withimport_skip_reason: "Disabled"install_server/remove_serverrewrite the config file atomically (temp file + rename), since Kimi Code CLI exposes nomcpsubcommandMcpSource::Kimi(serde"kimi") incrates/aionui-common/src/enums.rsadapters/mod.rs, exported fromaionui-mcplib, and added to the scan list incrates/aionui-app/src/router/state.rsTest Plan
cargo fmt --all -- --check✅cargo clippy -p aionui-common -p aionui-mcp --all-targets -- -D warnings✅cargo test -p aionui-common -p aionui-mcp✅Refs: iOfficeAI/AionUi#3975
中文说明 / Chinese Summary
本 PR 为 MCP Agent 同步层新增了一个 Kimi Code CLI 适配器,使 AionUi 的「MCP 一键导入」能够检测并导入 Kimi Code CLI 中配置的 MCP 服务器(配合把一键导入扩展到 Claude Code/Codex 之外,见 iOfficeAI/AionUi#3975)。新增适配器
crates/aionui-mcp/src/adapters/kimi.rs:从~/.kimi-code/mcp.json(识别$KIMI_CODE_HOME)读取 MCP 配置,可解析 stdio(command)/ HTTP(url)/ 旧版 SSE(transport: "sse")三类条目并标注禁用项;因 Kimi Code CLI 没有mcp子命令,install_server/remove_server通过临时文件+重命名原子改写配置文件。同时在McpSource枚举新增Kimi(serde"kimi")、在adapters/mod.rs注册并接入扫描列表。附配置解析/JSON/文件 I/O 单测,cargo fmt、cargo clippy、cargo test全绿。