🐛 fix: slove the descktop use offical endpoint mcp not use stdio#11813
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts MCP plugin connection selection logic to always prefer HTTP or cloud endpoints over stdio in both desktop and web, and simplifies error logging parameters formatting. Sequence diagram for updated MCP connection preference in desktop and websequenceDiagram
actor User
participant DesktopApp
participant WebApp
participant MCPPluginStore
participant MCPDeploymentOptions
participant CloudEndpoint
User ->> DesktopApp: Install or activate MCP plugin
DesktopApp ->> MCPPluginStore: Request connection for plugin
MCPPluginStore ->> MCPDeploymentOptions: Get stdioOption, httpOption, haveCloudEndpoint
MCPDeploymentOptions -->> MCPPluginStore: Options data
MCPPluginStore ->> MCPPluginStore: Compute hasCloudEndpoint = stdioOption AND haveCloudEndpoint
alt hasCloudEndpoint in desktop
MCPPluginStore ->> CloudEndpoint: Create cloud type connection
CloudEndpoint -->> MCPPluginStore: Cloud connection
else hasCloudEndpoint is false
alt httpOption exists
MCPPluginStore ->> MCPDeploymentOptions: Create HTTP connection
MCPDeploymentOptions -->> MCPPluginStore: HTTP connection
else stdioOption exists
MCPPluginStore ->> MCPDeploymentOptions: Create stdio connection
MCPDeploymentOptions -->> MCPPluginStore: stdio connection
end
end
MCPPluginStore -->> DesktopApp: Selected connection
DesktopApp -->> User: MCP plugin ready using endpoint over stdio
User ->> WebApp: Install or activate MCP plugin
WebApp ->> MCPPluginStore: Request connection for plugin
MCPPluginStore ->> MCPDeploymentOptions: Get stdioOption, httpOption, haveCloudEndpoint
MCPDeploymentOptions -->> MCPPluginStore: Options data
MCPPluginStore ->> MCPPluginStore: Compute hasCloudEndpoint = stdioOption AND haveCloudEndpoint
alt hasCloudEndpoint in web
MCPPluginStore ->> CloudEndpoint: Create cloud type connection
CloudEndpoint -->> MCPPluginStore: Cloud connection
else hasCloudEndpoint is false
alt httpOption exists
MCPPluginStore ->> MCPDeploymentOptions: Create HTTP connection
MCPDeploymentOptions -->> MCPPluginStore: HTTP connection
else no endpoint
MCPPluginStore -->> WebApp: No valid connection (stdio not used in web)
end
end
MCPPluginStore -->> WebApp: Selected connection
WebApp -->> User: MCP plugin uses endpoint only
Flow diagram for MCP plugin connection selection logicflowchart TD
Start(["Start MCP connection selection"]) --> CheckCloud["Check hasCloudEndpoint = stdioOption AND haveCloudEndpoint"]
CheckCloud -->|"hasCloudEndpoint = true"| UseCloud["Use cloud endpoint connection (type=cloud)"]
UseCloud --> End
CheckCloud -->|"hasCloudEndpoint = false"| CheckHttp["Check httpOption exists"]
CheckHttp -->|"httpOption exists"| UseHttp["Use HTTP endpoint connection (type=http)"]
UseHttp --> End
CheckHttp -->|"no httpOption"| CheckDesktop["Check isDesktop AND stdioOption"]
CheckDesktop -->|"true"| UseStdio["Use stdio connection (type=stdio)"]
UseStdio --> End
CheckDesktop -->|"false"| NoConnection["No usable connection (installation fails or logs error)"]
NoConnection --> End
End(["End MCP connection selection"])
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new endpoint selection logic is now quite implicit; consider extracting the decision (cloud vs http vs stdio for desktop/web) into a small helper with clearly named branches to make the priority rules easier to understand and maintain.
- The inline comment
Web: endpoint only (stdio not supported)may not fully match the actual behavior depending on upstream fallback to stdio; consider either enforcing that rule in code or updating the comment to accurately reflect the current behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new endpoint selection logic is now quite implicit; consider extracting the decision (cloud vs http vs stdio for desktop/web) into a small helper with clearly named branches to make the priority rules easier to understand and maintain.
- The inline comment `Web: endpoint only (stdio not supported)` may not fully match the actual behavior depending on upstream fallback to stdio; consider either enforcing that rule in code or updating the comment to accurately reflect the current behavior.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #11813 +/- ##
==========================================
- Coverage 73.74% 73.62% -0.13%
==========================================
Files 1211 1211
Lines 97357 97511 +154
Branches 12630 10587 -2043
==========================================
- Hits 71797 71793 -4
- Misses 25469 25627 +158
Partials 91 91
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b2cabdb59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Prioritize endpoint (http/cloud) over stdio in all environments | ||
| // Desktop: endpoint > stdio | ||
| // Web: endpoint only (stdio not supported) | ||
| let shouldUseHttpDeployment = !!httpOption; | ||
|
|
There was a problem hiding this comment.
Avoid forcing HTTP on desktop when stdio is available
This change makes desktop always choose the HTTP deployment when a URL is present, even if a stdio deployment exists. For MCPs that publish an HTTP option for web (or for optional self-hosting) alongside a working stdio command, desktop now skips the dependency check and tries to connect to the HTTP URL, which commonly isn’t running by default, so installs succeed but tool execution fails until the user manually starts a server. The previous logic only selected HTTP on desktop when no non‑HTTP deployment existed, so this is a regression for dual‑mode plugins.
Useful? React with 👍 / 👎.
|
❤️ Great PR @ONLY-yours ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 2.0.0-next.379](v2.0.0-next.378...v2.0.0-next.379) <sup>Released on **2026-01-25**</sup> #### ✨ Features - **utils**: Added `trimBasedOnBatchProbe` for truncating without compromising structured data. #### 🐛 Bug Fixes - **desktop**: Prevent duplicate IPC handler registration from dynamic imports. - **misc**: Fix update memory tools, resolve server version check issue for desktop app, slove the descktop use offical endpoint mcp not use stdio. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **utils**: Added `trimBasedOnBatchProbe` for truncating without compromising structured data, closes [#11836](#11836) ([6dac3d1](6dac3d1)) #### What's fixed * **desktop**: Prevent duplicate IPC handler registration from dynamic imports, closes [#11827](#11827) ([c3fd2dc](c3fd2dc)) * **misc**: Fix update memory tools, closes [#11831](#11831) ([cfc03dd](cfc03dd)) * **misc**: Resolve server version check issue for desktop app, closes [#11834](#11834) ([0bd2a59](0bd2a59)) * **misc**: Slove the descktop use offical endpoint mcp not use stdio, closes [#11813](#11813) ([370bf16](370bf16)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 2.0.0-next.379 🎉 The release is available on: Your semantic-release bot 📦🚀 |
💻 Change Type
fixed: LOBE-4175
🔗 Related Issue
🔀 Description of Change
🧪 How to Test
📸 Screenshots / Videos
📝 Additional Information
Summary by Sourcery
Adjust MCP deployment selection to consistently prioritize HTTP/cloud endpoints over stdio across desktop and web environments.
Bug Fixes:
Enhancements: