[Feature] lithe-mcp 新旧协议回归测试随 #1799 删除后无替代:mcp-protocol.json 无读取方且工具数仍写 17
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust, typescript
Research direction
Read the protocol contract at rust/contracts/ide-api/v1.md, the existing fixture at rust/fixtures/ide-api/mcp-protocol.json, and rust/crates/ide-host/src/bin/lithe-mcp.rs to understand the current list_tools behavior. Add an integration test in rust/crates/ide-host that launches lithe-mcp over stdio for each fixture mode and checks the protocol metadata and exposed tools. Update the fixture and contract validation command; done means the test covers all three modes and passes on Windows and macOS.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
Core(Lithe-IDEA/Lithe-core-rust)的 rust/fixtures/ide-api/mcp-protocol.json 已经没有读取方。契约声称的 MCP 协议验证也已经不存在。
- 以前读取它的是
scripts/ide-mcp/test-ide-mcp.mjs,#1549 起用它在独立的 stdio 会话里分别验证 legacy(2025-11-25)和 modern(2026-07-28)客户端的tools/list都带ttlMs: 0、cacheScope: "private",是 #1544 / #1545 的回归测试。这个脚本在 #1799(0faecba49)随旧客户端一起删除,之后没有补上替代测试。 - 判定依据:在 Core main
5e69a21和本仓库 maine813e609e全仓库搜索mcp-protocol、providerTools、modernProtocolVersion、test-ide-mcp(含.github/workflows),只命中文档和功能矩阵:- Core
rust/contracts/ide-api/v1.md第 91 行写着 “legacy and modern clients are verified in separate stdio sessions usingrust/fixtures/ide-api/mcp-protocol.json”,第 210 行的验证命令仍是node --test scripts/ide-mcp/test-ide-mcp.mjs。 - Core
rust/contracts/rust-core-api.md第 461 行、本仓库docs/viva-migration.md第 457 行只是提到它。 - 本仓库
shared/platform-feature-matrix/features/ide-mcp-connection.json第 63 行把已删除的脚本列为证据。
- Core
rust/crates/ide-host现有测试(catalog.rs、lib.rs、failure_log.rs的单元测试)覆盖工具目录收窄、参数校验和 broker 调度,没有一个测试启动lithe-mcp完成 MCP 握手。src/bin/lithe-mcp.rs里list_tools的with_ttl_ms(0)和with_cache_scope(CacheScope::Private)没有任何测试保护。- fixture 内容也已过时:
toolCount: 17是 Core #23(78c065d)删掉lithe_environment_inspect/configure和 4 个lithe_maven_*工具之前的数量;现在catalog::tools()和host-tool-exposure.json中 macOS、Windows 两端都是 11 个工具。
保留现状的代价:
- 升级 rmcp(现在固定
=3.5.0)或修改list_tools时,2026-07-28 客户端整体拒连的问题(#1544 / #1545)可能再次出现,而 CI 发现不了。 - 契约和功能矩阵写的验证方式实际不存在。
toolCount: 17会误导维护者。- Agent 设计 #2407 第二阶段要新增
lithe_sessions_search/lithe_sessions_read,届时没有可以同步更新的协议测试。
Proposed solution / 建议方案
- 在
rust/crates/ide-host加集成测试(与二进制一样要求mcpfeature)。用测试临时目录生成连接描述,通过 stdio 启动lithe-mcp,按 fixture 的三种modes(legacy、modern、modern-after-initialize)各开一个会话完成握手,断言:tools/list带ttlMs: 0和cacheScope: "private";- 工具数等于
catalog::tools()在该连接的toolExposure下给出的数量; providerTools列出的工具都在目录里。
测试不需要真实 IDE。
- 修正 fixture:
toolCount改为 11,或者删掉这个字段,改由测试从目录算出,避免以后再次过时。 - 把
v1.md第 91、210 行的验证说明改成新的cargo test命令,ide-mcp-connection.json的证据换成新测试的路径。
风险:测试要等待子进程启动,必须按 write-stable-tests 使用有界等待和超时,并在测试结束时回收进程;Windows 上也要运行。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
AI
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
删除 mcp-protocol.json,同时删掉契约里关于新旧客户端验证的说明。不推荐:#1544 / #1545 是真实发生过的兼容问题,删掉之后这条回归就完全没有保护。
Additional context / 补充信息
- 相关:#1544、#1545(缺
ttlMs/cacheScope导致拒连)、#1549(引入 fixture 和脚本)、#1799(删除脚本)、Core #23(删除 6 个工具)、#2407(Agent 设计,第二阶段新增 MCP 会话工具)。 - 本单只处理 MCP 协议测试和这个 fixture,不包括功能矩阵中其他指向 #1799 已删除文件的证据。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 3h 48m
- Merged PRs (30d)
- 571
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 82/100
1lck/Lithe-IDEA#2431 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 3/5 1-2 days Newbie friendliness 57/100
1lck/Lithe-IDEA#2434 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
rel: fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/fews-web-oc#2400 ·
Maintainers usually reply within 1 day
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on ClaudePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ardia-browser/ardia#4426 ·
Maintainers usually reply within 1 day
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePossibly taken @bardrop claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pnp/cli-microsoft365#7713 ·
Maintainers usually reply within 1 day
-
Diagram: Journey Type: Bug / Error
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainers usually reply within 1 day