feat(core): add mcp support (#34513)

This commit is contained in:
Aiden Cline 2026-06-30 08:37:44 -05:00 committed by GitHub
commit b1ca070b3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 1966 additions and 388 deletions

View file

@ -376,6 +376,34 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
const attention = createTuiAttention({ renderer, config: tuiConfig, kv })
const clipboard = useClipboard()
// Toast once when an MCP server enters a failed or needs-auth state so the user knows to act,
// without having to open the status panel. Tracking the last alerted status avoids re-toasting
// the same problem on every refresh while still re-alerting if the state changes.
const mcpAlerted: Record<string, string> = {}
createEffect(() => {
for (const server of data.location.mcp.list() ?? []) {
const status = server.status
if (status.status !== "failed" && status.status !== "needs_auth") {
delete mcpAlerted[server.name]
continue
}
if (mcpAlerted[server.name] === status.status) continue
mcpAlerted[server.name] = status.status
if (status.status === "needs_auth")
toast.show({
variant: "warning",
title: "MCP server needs authentication",
message: `Connect "${server.name}" to use its tools.`,
})
else
toast.show({
variant: "error",
title: "MCP server failed to connect",
message: `${server.name}: ${status.error}`,
})
}
})
const api = createTuiApi(
createTuiApiAdapters({
version: InstallationVersion,