René's URL Explorer Experiment


Title: feat: MCP 服务器手动重连功能 by dengmik-commits · Pull Request #84 · lessweb/deepcode-cli · GitHub

Open Graph Title: feat: MCP 服务器手动重连功能 by dengmik-commits · Pull Request #84 · lessweb/deepcode-cli

X Title: feat: MCP 服务器手动重连功能 by dengmik-commits · Pull Request #84 · lessweb/deepcode-cli

Description: 概述 当前 MCP 服务器初始化失败后直接标记 failed,无法恢复。本 PR 增加了手动重连机制:用户可在 /mcp 界面进入失败的服务器详情,选择 Reconnect 触发单次重连。 设计 /mcp → 服务器列表 fetch: ✗ Failed ↓ 按 Enter 进入详情 > ↻ [Reconnect] ← 二级菜单项 Error: exited with code 7 ↓ 按 Enter 触发重连 fetch: ↻ Reconnecting... ↓ 成功 → ✓ Ready / 失败 → ✗ Failed 关键约束: 失败后不自动重试,由用户主动触发 每次重连仅尝试一次,无 backoff/retry 重连时实时读取磁盘上的最新 settings.json,无需重启 变更 src/mcp/mcp-client.ts 新增 onDisconnect 回调参数,区分主动断开与进程崩溃 新增 isConnected() 方法 safeReject 修复进程退出竞态条件:close 事件可能在 sendRequest 注册前触发,导致 connect() 永远等待超时 适配上游的 Windows spawn 修复(直接传递 command+args,不强制拼 .cmd) src/mcp/mcp-manager.ts McpServerStatus.status 类型新增 "reconnecting" initialize() 拆分出 connectServer():单次尝试,失败直接 setStatus("failed") 新增公开方法 reconnect(name, config?):接受可选的最新配置,更新缓存并重连 onServerCrash():运行时崩溃清理旧条目并标记 failed,不自动重连 可配环境变量:DEEPCODE_MCP_TIMEOUT(单次连接超时,默认 30s) src/session.ts 新增 reconnectMcpServer(name, config?) 委托给 McpManager src/ui/App.tsx McpStatusList 传入 onReconnect 回调 回调内调用 resolveCurrentSettings() 保证每次重连都读取最新配置 src/ui/McpStatusList.tsx enterDetail 允许 failed / reconnecting 服务器进入详情 ServerDetailView 新增 onReconnect prop 对 failed 服务器渲染 [Reconnect] 菜单项,默认 > 光标选中 ItemRow 支持 action 类型,选中时显示 > 前缀 底部提示:Enter to reconnect · Esc back · Ctrl+C close src/tests/session.test.ts SessionManager marks MCP server as failed on single failed attempt (no auto-retry) — 确认失败后无自动重连 SessionManager reconnect succeeds on previously failed server — 确认手动重连成功 验证 自动化测试 npm run typecheck # ✅ 零错误 npm run bundle # ✅ dist/cli.js 335KB DEEPCODE_MCP_TIMEOUT=3000 npm test # ✅ 208/213 pass 手动验证流程 1. 制造失败: 将 ~/.deepcode/settings.json 中 fetch 服务器包名改为不存在的包: "fetch": { "command": "npx", - "args": ["-y", "mcp-fetch-server"] + "args": ["-y", "mcp-fetch-server-BROKEN"] } 2. 启动 deepcode,执行 /mcp: Manage MCP servers (1 ready, 1 starting, 1 failed) ... > ✗ fetch Failed Error: ... exited with code 1 ... 3. Enter 进入详情: ✗ fetch — Status Error: ... exited with code 1 ... ───────────────── > ↻ [Reconnect] 4. Enter 触发重连(包名仍然错误)—— 返回列表,看到 ↻ Reconnecting... 后再次 ✗ Failed。 5. 改回正确包名: - "args": ["-y", "mcp-fetch-server-BROKEN"] + "args": ["-y", "mcp-fetch-server"] 6. 再次 Enter → [Reconnect] → Enter —— fetch 恢复 ✓ Ready。 关键: 步骤 5-6 无需重启 deepcode,reconnect() 每次从磁盘实时读取最新配置。

Open Graph Description: 概述 当前 MCP 服务器初始化失败后直接标记 failed,无法恢复。本 PR 增加了手动重连机制:用户可在 /mcp 界面进入失败的服务器详情,选择 Reconnect 触发单次重连。 设计 /mcp → 服务器列表 fetch: ✗ Failed ↓ 按 Enter 进入详情 > ↻ [Reconnect] ← 二级菜单项 Error: exit...

X Description: 概述 当前 MCP 服务器初始化失败后直接标记 failed,无法恢复。本 PR 增加了手动重连机制:用户可在 /mcp 界面进入失败的服务器详情,选择 Reconnect 触发单次重连。 设计 /mcp → 服务器列表 fetch: ✗ Failed ↓ 按 Enter 进入详情 > ↻ [Reconnect] ← 二级菜单项 Error: ...

Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/84

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6df9cf78-c8db-cb02-85fd-75a76545c40a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE6FC:3C3A87:C43BF7:10D2229:6A4D5674
html-safe-nonce39c9dd924cdf8bd96c368c5b418e5e537ad902ca248ff4505f407196d28b05b3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkZDOjNDM0E4NzpDNDNCRjc6MTBEMjIyOTo2QTRENTY3NCIsInZpc2l0b3JfaWQiOiIyNDkwNDg5NjMyNTE3ODczODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd7576ae6af20a26b3cb321d8279bb0db75325bee6c7817aa86859179c792fee7
hovercard-subject-tagpull_request:3694244088
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/84/files
twitter:imagehttps://avatars.githubusercontent.com/u/270912164?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/270912164?s=400&v=4
og:image:alt概述 当前 MCP 服务器初始化失败后直接标记 failed,无法恢复。本 PR 增加了手动重连机制:用户可在 /mcp 界面进入失败的服务器详情,选择 Reconnect 触发单次重连。 设计 /mcp → 服务器列表 fetch: ✗ Failed ↓ 按 Enter 进入详情 > ↻ [Reconnect] ← 二级菜单项 Error: exit...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git
octolytics-dimension-user_id118287711
octolytics-dimension-user_loginlessweb
octolytics-dimension-repository_id1223512305
octolytics-dimension-repository_nwolessweb/deepcode-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1223512305
octolytics-dimension-repository_network_root_nwolessweb/deepcode-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56fc8347865a14e2ec811533d68f929cf4e0ec19
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lessweb/deepcode-cli/pull/84/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F84%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F84%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=lessweb%2Fdeepcode-cli
Reloadhttps://github.com/lessweb/deepcode-cli/pull/84/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/84/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/84/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
lessweb https://github.com/lessweb
deepcode-clihttps://github.com/lessweb/deepcode-cli
Notifications https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Fork 151 https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Star 1.7k https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Code https://github.com/lessweb/deepcode-cli
Issues 43 https://github.com/lessweb/deepcode-cli/issues
Pull requests 22 https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality 0 https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Code https://github.com/lessweb/deepcode-cli
Issues https://github.com/lessweb/deepcode-cli/issues
Pull requests https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
qorzjhttps://github.com/qorzj
lessweb:mainhttps://github.com/lessweb/deepcode-cli/tree/main
dengmik-commits:mainhttps://github.com/dengmik-commits/deepcode-cli/tree/main
Conversation 4 https://github.com/lessweb/deepcode-cli/pull/84
Commits 8 https://github.com/lessweb/deepcode-cli/pull/84/commits
Checks 9 https://github.com/lessweb/deepcode-cli/pull/84/checks
Files changed https://github.com/lessweb/deepcode-cli/pull/84/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
feat: MCP 服务器手动重连功能 https://github.com/lessweb/deepcode-cli/pull/84/files#top
Show all changes 8 commits https://github.com/lessweb/deepcode-cli/pull/84/files
e87f022 feat: add manual MCP server reconnect with secondary menu dengmik-commits May 16, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/e87f022dd42ab08f5929162a2bd742495e2e01a6
52dafba fix: re-apply dynamic modifier parsing for Shift+Enter after upstream… dengmik-commits May 18, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/52dafba25903dc70258d7e59dbe86e283a0f091f
7ab3d42 Merge branch 'main' of https://github.com/dengmik-commits/deepcode-cli dengmik-commits May 18, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/7ab3d42175debdde9f908e5d5d3e4b4845731503
34b0c97 fix: refresh mcpToolDefinitions cache after MCP reconnect dengmik-commits May 18, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/34b0c97121a146db4e8b249d73e7afaabc73c70d
dda8c40 Merge remote-tracking branch 'upstream/main' dengmik-commits May 18, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/dda8c40526a071c8b2036eb3138c6fe0aabc61a8
023fd85 Merge remote-tracking branch 'upstream/main' dengmik-commits May 19, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/023fd85c5842c04904d0e2779d0ac3ae3cfc34cd
c081efd Revert "fix: re-apply dynamic modifier parsing for Shift+Enter after … dengmik-commits May 19, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/c081efd169a7c2c47a503eb540b538640ac8810a
c323f2f merge upstream/main: resolve conflict in session.test.ts dengmik-commits May 19, 2026 https://github.com/lessweb/deepcode-cli/pull/84/commits/c323f2f6c9e19e10a82e7f1047ac9d23c296f952
Clear filters https://github.com/lessweb/deepcode-cli/pull/84/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
mcp-client.ts https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
mcp-manager.ts https://github.com/lessweb/deepcode-cli/pull/84/files#diff-710cf8658728525aefdd27c7d7ac3fce8d5aacd831b755ebce29ddbc1304ac96
session.ts https://github.com/lessweb/deepcode-cli/pull/84/files#diff-96998a2148aa3d52ad3e80303d0ad88fc43a4afd08966b5330a5657021ae52bb
session.test.ts https://github.com/lessweb/deepcode-cli/pull/84/files#diff-de8fd838e685eb171fd68dd90115fa8a20cf6d0b1aa1756278c53d2825eae713
App.tsx https://github.com/lessweb/deepcode-cli/pull/84/files#diff-0022b32944774e72bcbec1b0520e753925073bfbeff256269d0f668f5f515b0e
McpStatusList.tsx https://github.com/lessweb/deepcode-cli/pull/84/files#diff-42dda36a29773e24bfbeb630c276cce38b3e2d636f5658f32772137d6f0f8ffb
src/mcp/mcp-client.tshttps://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
View file https://github.com/dengmik-commits/deepcode-cli/blob/c323f2f6c9e19e10a82e7f1047ac9d23c296f952/src/mcp/mcp-client.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/84/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
https://github.com/lessweb/deepcode-cli/pull/84/files#diff-629980a013434764d29c6eb5dc269c55468056f2e134ac78c04ac0b24fd0989d
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/84/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.