Repository navigation
chat: start stopped agent host MCP servers for MCP Apps - #348950
Conversation
Agent host MCP Apps did not load when their MCP server was not running, for example after VS Code restarts with apps from an old session. The apps showed "isn't available yet" until something else started the server. Local MCP Apps already start their server on demand. - When an agent host MCP App load fails and its enabled server is Stopped, start the server one time. The status change then retries the load. Apps that share a server share one start request. - Do not start a server automatically again after it fails. This prevents a start, fail and retry loop. - Show a "Start Server" button in the app placeholder when the enabled server is Stopped or in Error, next to the existing "Sign In" behavior. Show a notification if the start fails. (Commit message generated by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
server.start() resolves after dispatch rather than startup completion, so later startup failures bypass the catch and leave users without the promised error notification.
1 open issue
What changed in this PR
This PR adds on-demand startup for agent-host MCP Apps whose servers are stopped, helping restored chat sessions load their apps after a VS Code restart.
Changes:
- Attempts one automatic server start after a failed app load, with shared tracking of start requests.
- Adds a Start Server placeholder button for enabled servers in Stopped or Error states.
- Adds coverage for one-time automatic startup and explicit retry after failure.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatMcpAppModel.test.ts |
Tests automatic startup limits and explicit retries. |
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.ts |
Adds the Start Server button and error-notification handling. |
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.ts |
Adds server-start requests, shared request tracking, and one-time automatic startup. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Starting an agent host MCP server only requests the start. The host reports a startup failure later as the server Error state, so the start request does not reject for it. - Show the reported startup error in the MCP App placeholder, with the Start Server button. - Show a notification only when the start request itself fails. (Commit message generated by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Demo of
|



Agent host MCP Apps did not load when their MCP server was not running, for example after
VS Code restarts with apps from an old session. The apps showed "isn't available yet" until
something else started the server. Local MCP Apps already start their server on demand.
one time. The status change then retries the load. Apps that share a server share one start
request.
retry loop.
Error, next to the existing "Sign In" behavior.
the start request itself fails.
(Commit message generated by Copilot)
How to test
ui://resource) in an Agents window session.