🙌 OpenHands: AI-Driven Development
Add recommended automations and MCP marketplace setup flow (#504)
Graham Neubig90ad71dbd9b9
diff --git a/AGENTS.md b/AGENTS.mdindex e699e62ea6..40e2fd857f 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -398,7 +398,7 @@ return new ConversationClient(getAgentServerClientOptions()).someMethod(...);- Custom secrets are NOT auto-attached by the agent-server. `POST /api/conversations` only persists what the client sends in `request.secrets`; the persisted secrets store (`/api/settings/secrets`) is never read at conversation-start. `buildStartConversationRequestWithEncryptedSettings` enumerates `SecretsService.getSecrets()` and turns each entry into a `LookupSecret` whose `url` points back at `/api/settings/secrets/{name}` and whose `headers` carry `X-Session-API-Key` for auth. Pre-1.21.x agent-server SDKs would silently drop that header during validation when `secrets_encrypted=true` (the cipher in the validation context tried to `cipher.decrypt(plaintext_session_key)`, failed, and the validator removed the header — the conversation runtime then got 401s for every saved secret). The SDK fix preserves plaintext header values when decryption fails; if you still see saved secrets unavailable inside a conversation, verify the running agent-server bundles a `LookupSecret._validate_secrets` that falls back to plaintext on decrypt failure.-- MCP page layout: MCP is a **top-level** nav entry at `/mcp` (rendered by `src/routes/mcp.tsx`), shown right below "Skills" in `src/components/features/sidebar/sidebar.tsx`. The legacy `/settings/mcp` route still works as a redirect via `src/routes/mcp-settings-redirect.tsx`, and `src/routes/mcp-settings.tsx` re-exports the new page so the published `MCPSettings` library symbol (in `src/components/settings/index.ts`) keeps the same shape. Marketplace catalog lives in `src/constants/mcp-marketplace.ts` (Slack and Tavily must stay first) — `src/utils/mcp-marketplace-utils.ts` matches installed servers back to catalog entries (Tavily uses the `"tavily-builtin"` sentinel because it is gated by `search_api_key_set` rather than `mcp_config`). Components are colocated under `src/components/features/mcp-page/` and reuse the existing `MCPServerForm` for the "Add custom server" / edit flow.+- MCP page layout: MCP is a **top-level** nav entry at `/mcp` (rendered by `src/routes/mcp.tsx`), shown right below "Skills" in `src/components/features/sidebar/sidebar.tsx`. The legacy `/settings/mcp` route still works as a redirect via `src/routes/mcp-settings-redirect.tsx`, and `src/routes/mcp-settings.tsx` re-exports the new page so the published `MCPSettings` library symbol (in `src/components/settings/index.ts`) keeps the same shape. Marketplace catalog data and MCP logo mappings live in `@openhands/extensions/mcps` (Slack and Tavily must stay first in that package) — `src/utils/mcp-marketplace-utils.ts` matches installed servers back to catalog entries (Tavily uses the `"tavily-builtin"` sentinel because it is gated by `search_api_key_set` rather than `mcp_config`). Components are colocated under `src/components/features/mcp-page/` and reuse the existing `MCPServerForm` for the "Add custom server" / edit flow.- Library packaging notes:- Public npm entrypoints now come from `src/index.ts` → `src/lib/index.ts`, with domain barrels under `src/components/{conversation,terminal,browser,files,settings,sidebar}/index.ts`.diff --git a/__tests__/components/automations/recommended-automations.test.tsx b/__tests__/components/automations/recommended-automations.test.tsxnew file mode 100644index 0000000000..fa9cf4a1a0--- /dev/null+++ b/__tests__/components/automations/recommended-automations.test.tsx@@ -0,0 +1,365 @@+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { fireEvent, render, screen, waitFor } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import SettingsService from "#/api/settings-service/settings-service.api";+import {+ consumePendingTaskDraft,+ getConversationState,+} from "#/utils/conversation-local-storage";+import {+ __resetActiveStoreForTests,+ setActiveSelection,+ setRegisteredBackends,+} from "#/api/backend-registry/active-store";+import { ActiveBackendProvider } from "#/contexts/active-backend-context";+import type { Backend } from "#/api/backend-registry/types";+import {+ RecommendedAutomationsLauncher,+ buildAutomationPrompt,+} from "#/components/features/automations/recommended-automations-launcher";+import {+ RecommendedAutomationsSection,+ getAutomationsByPopularity,+} from "#/components/features/automations/recommended-automations-section";+import {+ AUTOMATION_CATALOG,+ type RecommendedAutomation,+} from "@openhands/extensions/automations";++const { mockCreateConversationMutate, mockUseSettings } = vi.hoisted(() => ({+ mockCreateConversationMutate: vi.fn(),+ mockUseSettings: vi.fn(),+}));++vi.mock("react-i18next", () => ({+ useTranslation: () => ({+ t: (key: string, vars?: Record<string, unknown>) => {+ if (vars?.name) return `${key}:${String(vars.name)}`;+ if (vars?.count != null) return `${key}:${String(vars.count)}`;+ return key;+ },+ }),+}));++vi.mock("#/hooks/mutation/use-create-conversation", () => ({+ useCreateConversation: () => ({+ mutate: mockCreateConversationMutate,+ isPending: false,+ }),+}));++vi.mock("#/hooks/query/use-settings", () => ({+ useSettings: () => mockUseSettings(),+}));++const localBackend: Backend = {+ id: "local-backend",+ name: "Local",+ host: "http://localhost:8000",+ apiKey: "",+ kind: "local",+};++const cloudBackend: Backend = {+ id: "cloud-backend",+ name: "Cloud",+ host: "https://staging.all-hands.dev/",+ apiKey: "cloud-token",+ kind: "cloud",+};++function renderLauncher({ withBackendProvider = false } = {}) {+ const queryClient = new QueryClient({+ defaultOptions: { queries: { retry: false }, mutations: { retry: false } },+ });++ const launcher = <RecommendedAutomationsLauncher />;++ return render(+ <QueryClientProvider client={queryClient}>+ {withBackendProvider ? (+ <ActiveBackendProvider>{launcher}</ActiveBackendProvider>+ ) : (+ launcher+ )}+ </QueryClientProvider>,+ );+}++function settingsWithMcpConfig(mcp_config: unknown) {+ return {+ agent_settings: {+ mcp_config,+ },+ };+}++function settingsWithGithubMcp() {+ return settingsWithMcpConfig({+ mcpServers: {+ github: {+ command: "npx",+ args: ["-y", "@modelcontextprotocol/server-github"],+ env: { GITHUB_PERSONAL_ACCESS_TOKEN: "github-token" },+ },+ },+ });+}++describe("recommended automations", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ localStorage.clear();+ __resetActiveStoreForTests();+ setRegisteredBackends([localBackend]);+ setActiveSelection({ backendId: localBackend.id });+ mockUseSettings.mockReturnValue({+ data: settingsWithMcpConfig({ mcpServers: {} }),+ });+ });++ afterEach(() => {+ localStorage.clear();+ __resetActiveStoreForTests();+ });++ it("shows recommended automations in popularity order", () => {+ const onSelect = vi.fn();++ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ onSelect={onSelect}+ />,+ );++ const cards = screen.getAllByTestId(/^recommended-automation-card-/);+ expect(cards[0]).toHaveAttribute(+ "data-testid",+ "recommended-automation-card-github-pr-reviewer",+ );+ expect(cards[1]).toHaveAttribute(+ "data-testid",+ "recommended-automation-card-slack-standup-digest",+ );+ });++ it("sorts recommendation popularity deterministically when ranks are missing or tied", () => {+ const makeAutomation = (+ id: string,+ popularityRank?: number,+ ): RecommendedAutomation =>+ ({+ ...AUTOMATION_CATALOG[0],+ id,+ popularityRank,+ }) as RecommendedAutomation;++ expect(+ getAutomationsByPopularity([+ makeAutomation("missing-first"),+ makeAutomation("tie-a", 10),+ makeAutomation("top", 20),+ makeAutomation("tie-b", 10),+ makeAutomation("missing-second"),+ ]).map((automation) => automation.id),+ ).toEqual(["top", "tie-a", "tie-b", "missing-first", "missing-second"]);+ });++ it("filters recommendations by required MCP keywords", () => {+ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ query="standup"+ onSelect={vi.fn()}+ />,+ );++ expect(+ screen.getByTestId("recommended-automation-card-slack-standup-digest"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("recommended-automation-card-github-pr-reviewer"),+ ).not.toBeInTheDocument();+ });++ it("selects a recommendation directly from its card", () => {+ const automation = AUTOMATION_CATALOG.find(+ (item) => item.id === "github-pr-reviewer",+ )!;+ const onSelect = vi.fn();++ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ onSelect={onSelect}+ />,+ );++ fireEvent.click(+ screen.getByTestId("recommended-automation-card-github-pr-reviewer"),+ );+ expect(onSelect).toHaveBeenCalledWith(automation);+ });++ it("opens the MCP install modal instead of launching when the required MCP is missing", async () => {+ renderLauncher();++ fireEvent.click(+ screen.getByTestId("recommended-automation-card-github-pr-reviewer"),+ );++ const modal = await screen.findByTestId("mcp-install-modal");+ expect(modal).toHaveAttribute("data-marketplace-id", "github");+ expect(+ screen.getByTestId("mcp-install-field-GITHUB_PERSONAL_ACCESS_TOKEN"),+ ).toBeInTheDocument();+ expect(mockCreateConversationMutate).not.toHaveBeenCalled();+ });++ it("launches directly with local automation API instructions when the required MCP is already installed", () => {+ mockUseSettings.mockReturnValue({+ data: settingsWithGithubMcp(),+ });++ renderLauncher();++ fireEvent.click(+ screen.getByTestId("recommended-automation-card-github-pr-reviewer"),+ );++ expect(mockCreateConversationMutate).toHaveBeenCalledTimes(1);+ expect(screen.queryByTestId("mcp-install-modal")).not.toBeInTheDocument();++ const [, options] = mockCreateConversationMutate.mock.calls[0];+ options.onSuccess({ conversation_id: "conversation-1" });++ const draft = getConversationState("conversation-1").draftMessage;+ expect(draft).toContain("local");+ expect(draft).toContain("$OPENHANDS_AUTOMATION_API_KEY");+ expect(draft).not.toContain("app.all-hands.dev");+ expect(draft).not.toContain("$OPENHANDS_API_KEY");+ });++ it("ignores repeated card clicks while a recommendation launch is in flight", () => {+ mockUseSettings.mockReturnValue({+ data: settingsWithGithubMcp(),+ });++ renderLauncher();++ const card = screen.getByTestId(+ "recommended-automation-card-github-pr-reviewer",+ );+ fireEvent.click(card);+ fireEvent.click(card);++ expect(mockCreateConversationMutate).toHaveBeenCalledTimes(1);+ });++ it("stores cloud start-task drafts until the real conversation is ready", () => {+ setRegisteredBackends([cloudBackend]);+ setActiveSelection({ backendId: cloudBackend.id });+ mockUseSettings.mockReturnValue({+ data: settingsWithGithubMcp(),+ });++ renderLauncher({ withBackendProvider: true });++ fireEvent.click(+ screen.getByTestId("recommended-automation-card-github-pr-reviewer"),+ );++ const [, options] = mockCreateConversationMutate.mock.calls[0];+ options.onSuccess({+ conversation_id: "task-cloud-start-task",+ task_id: "cloud-start-task",+ });++ expect(+ getConversationState("task-cloud-start-task").draftMessage,+ ).toBeNull();+ const pendingDraft = consumePendingTaskDraft("cloud-start-task");+ expect(pendingDraft).toContain(+ "https://staging.all-hands.dev/api/automation/v1/preset/prompt",+ );+ expect(pendingDraft).not.toContain("https://staging.all-hands.dev//api");+ expect(pendingDraft).toContain("$OPENHANDS_API_KEY");+ });++ it("launches the recommendation after the missing MCP is installed", async () => {+ const saveSpy = vi+ .spyOn(SettingsService, "saveSettings")+ .mockResolvedValue(true);++ renderLauncher();++ fireEvent.click(+ screen.getByTestId("recommended-automation-card-github-pr-reviewer"),+ );+ await screen.findByTestId("mcp-install-modal");++ fireEvent.change(+ screen.getByTestId("mcp-install-field-GITHUB_PERSONAL_ACCESS_TOKEN"),+ {+ target: { value: "github-token" },+ },+ );+ fireEvent.click(screen.getByTestId("mcp-install-submit"));++ await waitFor(() => expect(saveSpy).toHaveBeenCalledTimes(1));+ await waitFor(() =>+ expect(mockCreateConversationMutate).toHaveBeenCalledTimes(1),+ );+ });+});++describe("buildAutomationPrompt", () => {+ const basePrompt = "Create an automation that does something useful.";++ it("appends local API instructions for local backends without cloud endpoints", () => {+ const result = buildAutomationPrompt(basePrompt, "local");+ expect(result).toContain(basePrompt);+ expect(result).toContain("local");+ expect(result).toContain("<RUNTIME_SERVICES>");+ expect(result).toContain("$OPENHANDS_AUTOMATION_API_KEY");+ expect(result).toContain("/api/automation/v1/preset/prompt");+ expect(result).not.toContain("app.all-hands.dev");+ expect(result).not.toContain("$OPENHANDS_API_KEY");+ expect(result).toContain(+ "instead of using any remote/cloud automation API",+ );+ });++ it("appends cloud API instructions for the active cloud backend", () => {+ const result = buildAutomationPrompt(+ basePrompt,+ "cloud",+ "https://staging.all-hands.dev/",+ );+ expect(result).toContain(basePrompt);+ expect(result).toContain(+ "https://staging.all-hands.dev/api/automation/v1/preset/prompt",+ );+ expect(result).not.toContain("https://staging.all-hands.dev//api");+ expect(result).not.toContain("app.all-hands.dev");+ expect(result).toContain("$OPENHANDS_API_KEY");+ expect(result).toContain("/api/automation/v1/preset/prompt");+ expect(result).not.toContain("<RUNTIME_SERVICES>");+ expect(result).not.toContain("$OPENHANDS_AUTOMATION_API_KEY");+ });++ it("keeps the original prompt text verbatim at the start", () => {+ const localResult = buildAutomationPrompt(basePrompt, "local");+ const cloudResult = buildAutomationPrompt(+ basePrompt,+ "cloud",+ "https://staging.all-hands.dev",+ );+ expect(localResult.startsWith(basePrompt)).toBe(true);+ expect(cloudResult.startsWith(basePrompt)).toBe(true);+ });+});diff --git a/__tests__/components/features/conversation-panel/conversation-panel.test.tsx b/__tests__/components/features/conversation-panel/conversation-panel.test.tsxindex 4d08b5e1f7..7664aadd47 100644--- a/__tests__/components/features/conversation-panel/conversation-panel.test.tsx+++ b/__tests__/components/features/conversation-panel/conversation-panel.test.tsx@@ -759,44 +759,59 @@ describe("ConversationPanel", () => {const cards = await screen.findAllByTestId("conversation-card");expect(cards).toHaveLength(3);+ const getCardByTitle = async (title: string) => {+ const currentCards = await screen.findAllByTestId("conversation-card");+ const card = currentCards.find((candidate) =>+ within(candidate).queryByText(title),+ );+ expect(card).toBeDefined();+ return card as HTMLElement;+ };+// Test RUNNING conversation - should show stop button- const runningEllipsisButton = within(cards[0]).getByTestId(+ const runningCard = await getCardByTitle("Running Conversation");+ const runningEllipsisButton = within(runningCard).getByTestId("ellipsis-button",);await user.click(runningEllipsisButton);- expect(screen.getByTestId("stop-button")).toBeInTheDocument();+ expect(await screen.findByTestId("stop-button")).toBeInTheDocument();// Click outside to close the menuawait user.click(document.body);- // Wait for context menu to close.+ // Wait for context menu to close before opening the next one.await waitFor(() => {- expect(cards[0]).toHaveAttribute("data-context-menu-open", "false");+ expect(screen.queryByTestId("stop-button")).not.toBeInTheDocument();});- // Test STARTING conversation - should show stop button- const startingEllipsisButton = within(cards[1]).getByTestId(+ // Test STARTING/RUNNING conversation - should show stop button+ const startingCard = await getCardByTitle("Starting Conversation");+ const startingEllipsisButton = within(startingCard).getByTestId("ellipsis-button",);await user.click(startingEllipsisButton);- expect(screen.getByTestId("stop-button")).toBeInTheDocument();+ expect(await screen.findByTestId("stop-button")).toBeInTheDocument();// Click outside to close the menuawait user.click(document.body);- // Wait for context menu to close.+ // Wait for context menu to close before opening the next one.await waitFor(() => {- expect(cards[1]).toHaveAttribute("data-context-menu-open", "false");+ expect(screen.queryByTestId("stop-button")).not.toBeInTheDocument();});// Test STOPPED conversation - should NOT show stop button- const stoppedEllipsisButton = within(cards[2]).getByTestId(+ const stoppedCard = await getCardByTitle("Stopped Conversation");+ const stoppedEllipsisButton = within(stoppedCard).getByTestId("ellipsis-button",);await user.click(stoppedEllipsisButton);+ await waitFor(() => {+ expect(stoppedCard).toHaveAttribute("data-context-menu-open", "true");+ });expect(screen.queryByTestId("stop-button")).not.toBeInTheDocument();});diff --git a/__tests__/components/features/mcp-page/install-server-modal.test.tsx b/__tests__/components/features/mcp-page/install-server-modal.test.tsxindex 2d3fb7f1e8..dda3ce905f 100644--- a/__tests__/components/features/mcp-page/install-server-modal.test.tsx+++ b/__tests__/components/features/mcp-page/install-server-modal.test.tsx@@ -5,7 +5,10 @@ import SettingsService from "#/api/settings-service/settings-service.api";import { MOCK_DEFAULT_USER_SETTINGS } from "#/mocks/handlers";import { ActiveBackendProvider } from "#/contexts/active-backend-context";import { InstallServerModal } from "#/components/features/mcp-page/install-server-modal";-import { MCP_MARKETPLACE, MarketplaceEntry } from "#/constants/mcp-marketplace";+import {+ MCP_CATALOG as MCP_MARKETPLACE,+ type McpCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/mcps";function renderWith(ui: React.ReactNode) {return render(ui, {@@ -118,7 +121,6 @@ describe("InstallServerModal", () => {id: "synthetic-required",name: "Synthetic",description: "Synthetic catalog entry used in tests.",- logo: null,iconBg: "#000000",template: {kind: "shttp",@@ -153,7 +155,6 @@ describe("InstallServerModal", () => {id: "synthetic-optional",name: "Synthetic Optional",description: "Synthetic entry that allows empty api_key.",- logo: null,iconBg: "#000000",template: {kind: "shttp",diff --git a/__tests__/components/onboarding/onboarding-modal.test.tsx b/__tests__/components/onboarding/onboarding-modal.test.tsxindex ee48375293..b0168e6354 100644--- a/__tests__/components/onboarding/onboarding-modal.test.tsx+++ b/__tests__/components/onboarding/onboarding-modal.test.tsx@@ -38,6 +38,23 @@ vi.mock("#/routes/llm-settings", () => ({),}));+vi.mock(+ "#/components/features/automations/recommended-automations-launcher",+ () => ({+ RecommendedAutomationsLauncher: ({+ onLaunched,+ }: {+ onLaunched?: () => void;+ }) => (+ <div data-testid="recommended-automations-launcher-stub">+ <button type="button" onClick={onLaunched}>+ launch recommended automation+ </button>+ </div>+ ),+ }),+);+vi.mock("#/hooks/use-is-creating-conversation", () => ({useIsCreatingConversation: () => false,}));@@ -315,4 +332,60 @@ describe("OnboardingModal", () => {// is non-empty and matches the resolved default message.expect(helloInput.value).toBe("ONBOARDING$HELLO_DEFAULT_MESSAGE");});++ it("shows recommended automations below the Say Hello input", async () => {+ const onClose = vi.fn();+ renderModal(onClose);+ const user = userEvent.setup();++ await user.click(screen.getByTestId("onboarding-agent-next"));+ await waitFor(+ () =>+ expect(screen.getByTestId("onboarding-modal")).toHaveAttribute(+ "data-current-step",+ "1",+ ),+ { timeout: 3000 },+ );+ await waitFor(() =>+ expect(screen.getByTestId("onboarding-backend-next")).not.toBeDisabled(),+ );+ await user.click(screen.getByTestId("onboarding-backend-next"));+ await waitFor(() =>+ expect(screen.getByTestId("onboarding-slide-2")).toHaveAttribute(+ "data-active",+ "true",+ ),+ );+ await user.click(screen.getByTestId("onboarding-llm-next"));+ await waitFor(() =>+ expect(screen.getByTestId("onboarding-slide-3")).toHaveAttribute(+ "data-active",+ "true",+ ),+ );++ const helloInput = screen.getByTestId("onboarding-hello-input");+ const recommendations = screen.getByTestId(+ "onboarding-recommended-automations",+ );+ expect(+ helloInput.compareDocumentPosition(recommendations) &+ Node.DOCUMENT_POSITION_FOLLOWING,+ ).toBeTruthy();+ expect(+ within(recommendations).getByTestId(+ "recommended-automations-launcher-stub",+ ),+ ).toBeInTheDocument();++ expect(recommendations.closest("form")).toBeNull();++ await user.click(+ within(recommendations).getByRole("button", {+ name: "launch recommended automation",+ }),+ );+ expect(onClose).toHaveBeenCalledTimes(1);+ });});diff --git a/__tests__/constants/extensions-catalogs.test.ts b/__tests__/constants/extensions-catalogs.test.tsnew file mode 100644index 0000000000..27b50a7388--- /dev/null+++ b/__tests__/constants/extensions-catalogs.test.ts@@ -0,0 +1,30 @@+import { describe, expect, it } from "vitest";+import { AUTOMATION_CATALOG } from "@openhands/extensions/automations";+import { MCP_CATALOG } from "@openhands/extensions/mcps";+import { MCP_LOGO_IDS, MCP_LOGOS } from "@openhands/extensions/mcps/logos";++describe("OpenHands extensions catalogs", () => {+ it("hydrates the MCP marketplace from @openhands/extensions", () => {+ expect(MCP_CATALOG.length).toBeGreaterThan(0);++ const github = MCP_CATALOG.find((entry) => entry.id === "github");+ expect(github?.template.kind).toBe("stdio");+ expect(MCP_LOGOS.github).toBeTruthy();++ for (const entry of MCP_CATALOG) {+ expect(MCP_LOGO_IDS.has(entry.id)).toBe(true);+ }+ });++ it("loads recommended automations from @openhands/extensions", () => {+ expect(AUTOMATION_CATALOG.length).toBeGreaterThan(0);++ const knownMcpIds = new Set(MCP_CATALOG.map((entry) => entry.id));+ for (const automation of AUTOMATION_CATALOG) {+ expect(automation.requiredMcpIds.length).toBeGreaterThan(0);+ expect(automation.requiredMcpIds.every((id) => knownMcpIds.has(id))).toBe(+ true,+ );+ }+ });+});diff --git a/__tests__/hooks/query/use-task-polling.test.tsx b/__tests__/hooks/query/use-task-polling.test.tsxnew file mode 100644index 0000000000..5c8ef25867--- /dev/null+++ b/__tests__/hooks/query/use-task-polling.test.tsx@@ -0,0 +1,98 @@+import React from "react";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { renderHook, waitFor } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";+import type { AppConversationStartTask } from "#/api/conversation-service/agent-server-conversation-service.types";+import { NavigationProvider } from "#/context/navigation-context";+import { useTaskPolling } from "#/hooks/query/use-task-polling";+import {+ consumePendingTaskDraft,+ getConversationState,+ setPendingTaskDraft,+} from "#/utils/conversation-local-storage";++vi.mock(+ "#/api/conversation-service/agent-server-conversation-service.api",+ () => ({+ default: {+ getStartTask: vi.fn(),+ },+ }),+);++const readyTask: AppConversationStartTask = {+ id: "123",+ created_by_user_id: "user-1",+ status: "READY",+ detail: null,+ app_conversation_id: "conversation-1",+ agent_server_url: null,+ request: {},+ created_at: new Date().toISOString(),+ updated_at: new Date().toISOString(),+};++describe("useTaskPolling", () => {+ let queryClient: QueryClient;+ const navigate = vi.fn();++ const createWrapper = () => {+ queryClient = new QueryClient({+ defaultOptions: { queries: { retry: false } },+ });++ return function Wrapper({ children }: { children: React.ReactNode }) {+ return (+ <QueryClientProvider client={queryClient}>+ <NavigationProvider+ value={{+ currentPath: "/conversations/task-123",+ conversationId: "task-123",+ isNavigating: false,+ navigate,+ }}+ >+ {children}+ </NavigationProvider>+ </QueryClientProvider>+ );+ };+ };++ beforeEach(() => {+ vi.clearAllMocks();+ localStorage.clear();+ });++ afterEach(() => {+ queryClient?.clear();+ localStorage.clear();+ });++ it("moves pending task drafts onto the real conversation before redirecting", async () => {+ vi.mocked(AgentServerConversationService.getStartTask).mockResolvedValue(+ readyTask,+ );+ setPendingTaskDraft("123", "Create this automation draft");++ const { result } = renderHook(() => useTaskPolling(), {+ wrapper: createWrapper(),+ });++ await waitFor(() => expect(result.current.taskStatus).toBe("READY"));+ await waitFor(() => {+ expect(navigate).toHaveBeenCalledWith("/conversations/conversation-1", {+ replace: true,+ });+ });++ expect(getConversationState("conversation-1").draftMessage).toBe(+ "Create this automation draft",+ );+ expect(consumePendingTaskDraft("123")).toBeNull();+ expect(AgentServerConversationService.getStartTask).toHaveBeenCalledWith(+ "123",+ );+ });+});diff --git a/__tests__/scripts/dev-with-automation.test.ts b/__tests__/scripts/dev-with-automation.test.tsindex 727e012a6c..c60e77bb99 100644--- a/__tests__/scripts/dev-with-automation.test.ts+++ b/__tests__/scripts/dev-with-automation.test.ts@@ -15,6 +15,7 @@ import { setTimeout as delay } from "node:timers/promises";import { fileURLToPath } from "node:url";import { describe, expect, it, afterEach } from "vitest";import {+ buildAgentServerAutomationEnv,buildAutomationCommand,buildConfig,DEFAULT_AUTOMATION_REPO,@@ -115,6 +116,16 @@ describe("buildAutomationCommand", () => {});});+describe("buildAgentServerAutomationEnv", () => {+ it("exposes the local automation API key under the name agents use in curl commands", () => {+ expect(+ buildAgentServerAutomationEnv({ localApiKey: "automation-local-key" }),+ ).toEqual({+ OPENHANDS_AUTOMATION_API_KEY: "automation-local-key",+ });+ });+});+describe("buildConfig", () => {const servers: net.Server[] = [];const keyDirs: string[] = [];diff --git a/__tests__/utils/mcp-marketplace-utils.test.ts b/__tests__/utils/mcp-marketplace-utils.test.tsindex f3a91a179e..7a12f46c65 100644--- a/__tests__/utils/mcp-marketplace-utils.test.ts+++ b/__tests__/utils/mcp-marketplace-utils.test.ts@@ -6,7 +6,7 @@ import {isMarketplaceEntryAvailable,marketplaceEntryMatchesQuery,} from "#/utils/mcp-marketplace-utils";-import { MCP_MARKETPLACE } from "#/constants/mcp-marketplace";+import { MCP_CATALOG as MCP_MARKETPLACE } from "@openhands/extensions/mcps";const slackEntry = MCP_MARKETPLACE.find((e) => e.id === "slack")!;const tavilyEntry = MCP_MARKETPLACE.find((e) => e.id === "tavily")!;diff --git a/package-lock.json b/package-lock.jsonindex 744f57f127..45185a3e4d 100644--- a/package-lock.json+++ b/package-lock.json@@ -12,6 +12,7 @@"@heroui/react": "2.8.10","@microlink/react-json-view": "1.31.20","@monaco-editor/react": "4.7.0",+ "@openhands/extensions": "git+https://github.com/OpenHands/extensions.git#3bba8e3bd8a134ad190347549d9aead98b081980","@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#v0.6.0","@react-router/node": "7.14.2","@react-router/serve": "7.14.2",@@ -3438,6 +3439,19 @@"dev": true,"license": "MIT"},+ "node_modules/@openhands/extensions": {+ "version": "0.0.0",+ "resolved": "git+https://github.com/OpenHands/extensions.git#3bba8e3bd8a134ad190347549d9aead98b081980",+ "license": "MIT",+ "engines": {+ "node": ">=18.20.0"+ },+ "peerDependencies": {+ "lucide-react": ">=0.400.0",+ "react": ">=18.0.0",+ "react-icons": ">=5.0.0"+ }+ },"node_modules/@openhands/typescript-client": {"version": "0.1.1","resolved": "git+https://github.com/OpenHands/typescript-client.git#ef62e82fc3dfb03991a1c8025429caf354427263",diff --git a/package.json b/package.jsonindex 89774e43a2..e78b65b195 100644--- a/package.json+++ b/package.json@@ -23,6 +23,7 @@"@heroui/react": "2.8.10","@microlink/react-json-view": "1.31.20","@monaco-editor/react": "4.7.0",+ "@openhands/extensions": "git+https://github.com/OpenHands/extensions.git#3bba8e3bd8a134ad190347549d9aead98b081980","@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#v0.6.0","@react-router/node": "7.14.2","@react-router/serve": "7.14.2",diff --git a/scripts/dev-docker.mjs b/scripts/dev-docker.mjsindex 63a42868ea..610be019fe 100644--- a/scripts/dev-docker.mjs+++ b/scripts/dev-docker.mjs@@ -56,6 +56,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";import process from "node:process";import {+ buildAgentServerAutomationEnv,c,commandExists,logError,@@ -353,6 +354,7 @@ function startAgentServerDocker(config) {// that exist inside the container (under the mounted ~/.openhands).const containerEnv = {HOME: CONTAINER_HOME_DIR,+ ...buildAgentServerAutomationEnv(config),OH_CONVERSATIONS_PATH: `${CONTAINER_OPENHANDS_DIR}/agent-canvas/conversations`,OH_PERSISTENCE_DIR: CONTAINER_OPENHANDS_DIR,OH_BASH_EVENTS_DIR: `${CONTAINER_OPENHANDS_DIR}/agent-canvas/bash_events`,diff --git a/scripts/dev-static.mjs b/scripts/dev-static.mjsindex 2621d0d420..13add54e5e 100644--- a/scripts/dev-static.mjs+++ b/scripts/dev-static.mjs@@ -56,7 +56,11 @@ import {isProcessRunning,signalProcessTree,} from "./dev-process-utils.mjs";-import { buildAutomationCommand, buildConfig } from "./dev-with-automation.mjs";+import {+ buildAgentServerAutomationEnv,+ buildAutomationCommand,+ buildConfig,+} from "./dev-with-automation.mjs";const __dirname = dirname(fileURLToPath(import.meta.url));const projectRoot = resolve(__dirname, "..");@@ -292,7 +296,10 @@ function startAgentServer(config) {OH_CANVAS_SAFE_VSCODE_PORT: config.vscodePort.toString(),});- const agentServerEnv = buildAgentServerEnv(safeConfig);+ const agentServerEnv = {+ ...buildAgentServerEnv(safeConfig),+ ...buildAgentServerAutomationEnv(config),+ };spawnService("agent-server",diff --git a/scripts/dev-with-automation.mjs b/scripts/dev-with-automation.mjsindex 5d627a92ac..7e0d3110d7 100644--- a/scripts/dev-with-automation.mjs+++ b/scripts/dev-with-automation.mjs@@ -518,6 +518,17 @@ async function waitForService(name, url, timeoutMs = 30000) {// Service Starters// ═══════════════════════════════════════════════════════════════════════════+function buildAgentServerAutomationEnv(config) {+ return {+ // Make the local automation backend key available to terminal commands+ // spawned by the agent-server. The launcher also seeds this into Settings+ // > Secrets, but agents commonly create automations with a curl command+ // that references `$OPENHANDS_AUTOMATION_API_KEY`; exposing it here keeps+ // that path working even before/without secret-registry env expansion.+ OPENHANDS_AUTOMATION_API_KEY: config.localApiKey,+ };+}+function startAgentServer(config) {logService("agent-server",@@ -536,7 +547,10 @@ function startAgentServer(config) {OH_CANVAS_SAFE_VSCODE_PORT: config.vscodePort.toString(),});- const agentServerEnv = buildAgentServerEnv(safeConfig);+ const agentServerEnv = {+ ...buildAgentServerEnv(safeConfig),+ ...buildAgentServerAutomationEnv(config),+ };spawnService("agent-server",@@ -1127,6 +1141,7 @@ function startStaticFrontend(config, staticDir) {// ═══════════════════════════════════════════════════════════════════════════export {+ buildAgentServerAutomationEnv,buildAutomationCommand,buildConfig,main,diff --git a/src/components/features/automations/recommended-automations-launcher.tsx b/src/components/features/automations/recommended-automations-launcher.tsxnew file mode 100644index 0000000000..10dc0d4ad6--- /dev/null+++ b/src/components/features/automations/recommended-automations-launcher.tsx@@ -0,0 +1,230 @@+import { useCallback, useMemo, useRef, useState } from "react";+import { useActiveBackend } from "#/contexts/active-backend-context";+import { useNavigation } from "#/context/navigation-context";+import { useCreateConversation } from "#/hooks/mutation/use-create-conversation";+import { useSettings } from "#/hooks/query/use-settings";+import { useIsCreatingConversation } from "#/hooks/use-is-creating-conversation";+import { useConversationStore } from "#/stores/conversation-store";+import {+ setConversationState,+ setPendingTaskDraft,+} from "#/utils/conversation-local-storage";+import type { RecommendedAutomation } from "@openhands/extensions/automations";+import { parseMcpConfig } from "#/utils/mcp-config";+import { flattenMcpConfig } from "#/utils/mcp-installed-servers";+import {+ MCP_CATALOG as MCP_MARKETPLACE,+ type McpCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/mcps";+import {+ findInstalledMatch,+ getMarketplaceEntryById,+} from "#/utils/mcp-marketplace-utils";+import { InstallServerModal } from "#/components/features/mcp-page/install-server-modal";+import { RecommendedAutomationsSection } from "./recommended-automations-section";++interface RecommendedAutomationsLauncherProps {+ query?: string;+ onLaunched?: () => void;+}++function getRequiredEntries(automation: RecommendedAutomation) {+ return automation.requiredMcpIds+ .map((id) => getMarketplaceEntryById(id, MCP_MARKETPLACE))+ .filter((entry): entry is MarketplaceEntry => !!entry);+}++/**+ * Augment the catalog prompt with explicit API instructions so the agent+ * calls the correct automation endpoint instead of guessing (e.g. calling+ * the cloud API when running locally, or vice-versa).+ */+function trimTrailingSlashes(value: string): string {+ return value.replace(/\/+$/, "");+}++export function buildAutomationPrompt(+ basePrompt: string,+ backendKind: "local" | "cloud",+ backendHost?: string,+): string {+ if (backendKind === "cloud") {+ const endpoint = backendHost+ ? `POST ${trimTrailingSlashes(backendHost)}/api/automation/v1/preset/prompt`+ : "POST /api/automation/v1/preset/prompt on the active OpenHands Cloud backend";++ return [+ basePrompt,+ "",+ "---",+ "**Which API to use:** Create this automation using the active OpenHands Cloud Automations API.",+ `- Endpoint: \`${endpoint}\``,+ "- Auth: `Authorization: Bearer $OPENHANDS_API_KEY`",+ ].join("\n");+ }++ // Local backend — the automation sidecar URL is in <RUNTIME_SERVICES>.+ return [+ basePrompt,+ "",+ "---",+ "**Which API to use:** Create this automation using the **local** OpenHands Automations API that is running alongside this agent.",+ "- Read the Automation backend URL from the `<RUNTIME_SERVICES>` block in your system context.",+ "- Endpoint path: `POST /api/automation/v1/preset/prompt`",+ "- Auth: `X-API-Key: $OPENHANDS_AUTOMATION_API_KEY`",+ "- If no local Automation backend is listed in `<RUNTIME_SERVICES>`, stop and ask me to start the full local automation stack instead of using any remote/cloud automation API.",+ ].join("\n");+}++export function RecommendedAutomationsLauncher({+ query,+ onLaunched,+}: RecommendedAutomationsLauncherProps) {+ const activeBackend = useActiveBackend();+ const { navigate } = useNavigation();+ const { data: settings } = useSettings();+ const createConversation = useCreateConversation();+ const isCreatingConversation = useIsCreatingConversation();+ const setMessageToSend = useConversationStore(+ (state) => state.setMessageToSend,+ );+ const [pendingAutomation, setPendingAutomation] =+ useState<RecommendedAutomation | null>(null);+ const [installQueue, setInstallQueue] = useState<MarketplaceEntry[]>([]);+ const completedInstallRef = useRef(false);+ const launchInFlightRef = useRef(false);++ const installedMcpServers = useMemo(+ () =>+ flattenMcpConfig(parseMcpConfig(settings?.agent_settings?.mcp_config)),+ [settings?.agent_settings?.mcp_config],+ );++ const launchAutomation = useCallback(+ (automation: RecommendedAutomation) => {+ if (+ launchInFlightRef.current ||+ createConversation.isPending ||+ isCreatingConversation+ ) {+ return;+ }+ launchInFlightRef.current = true;++ const prompt = buildAutomationPrompt(+ automation.prompt,+ activeBackend.backend.kind,+ activeBackend.backend.host,+ );++ createConversation.mutate(+ {},+ {+ onSuccess: (conversation) => {+ if (+ conversation.conversation_id.startsWith("task-") &&+ conversation.task_id+ ) {+ setPendingTaskDraft(conversation.task_id, prompt);+ } else {+ setConversationState(conversation.conversation_id, {+ draftMessage: prompt,+ });+ }+ onLaunched?.();+ navigate?.(`/conversations/${conversation.conversation_id}`);+ window.setTimeout(() => setMessageToSend(prompt), 0);+ },+ onError: () => {+ launchInFlightRef.current = false;+ },+ },+ );+ },+ [+ activeBackend.backend.kind,+ createConversation,+ isCreatingConversation,+ navigate,+ onLaunched,+ setMessageToSend,+ ],+ );++ const getMissingEntries = useCallback(+ (automation: RecommendedAutomation) =>+ getRequiredEntries(automation).filter(+ (entry) => !findInstalledMatch(entry.template, installedMcpServers),+ ),+ [installedMcpServers],+ );++ const handleSelectAutomation = (automation: RecommendedAutomation) => {+ if (+ launchInFlightRef.current ||+ createConversation.isPending ||+ isCreatingConversation ||+ installQueue.length > 0+ ) {+ return;+ }++ const missingEntries = getMissingEntries(automation);+ if (missingEntries.length === 0) {+ launchAutomation(automation);+ return;+ }++ setPendingAutomation(automation);+ setInstallQueue(missingEntries);+ };++ const cancelInstallFlow = () => {+ if (completedInstallRef.current) {+ completedInstallRef.current = false;+ return;+ }+ setPendingAutomation(null);+ setInstallQueue([]);+ };++ const handleInstallSuccess = () => {+ completedInstallRef.current = true;++ setInstallQueue((currentQueue) => {+ const nextQueue = currentQueue.slice(1);++ if (nextQueue.length === 0) {+ const automation = pendingAutomation;+ window.setTimeout(() => {+ setPendingAutomation(null);+ if (automation) launchAutomation(automation);+ }, 0);+ }++ return nextQueue;+ });+ };++ const installEntry = installQueue[0] ?? null;++ return (+ <>+ <RecommendedAutomationsSection+ backendKind={activeBackend.backend.kind}+ installedServers={installedMcpServers}+ query={query}+ onSelect={handleSelectAutomation}+ />++ {installEntry && (+ <InstallServerModal+ key={installEntry.id}+ entry={installEntry}+ onClose={cancelInstallFlow}+ onSuccess={handleInstallSuccess}+ />+ )}+ </>+ );+}diff --git a/src/components/features/automations/recommended-automations-section.tsx b/src/components/features/automations/recommended-automations-section.tsxnew file mode 100644index 0000000000..ce27b6bc94--- /dev/null+++ b/src/components/features/automations/recommended-automations-section.tsx@@ -0,0 +1,189 @@+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import {+ AUTOMATION_CATALOG,+ type RecommendedAutomation,+} from "@openhands/extensions/automations";+import {+ MCP_CATALOG as MCP_MARKETPLACE,+ type McpCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/mcps";+import { McpLogoBadge } from "#/components/features/mcp-logo-badge";+import { MCPServerConfig } from "#/types/mcp-server";+import {+ findInstalledMatch,+ getMarketplaceEntryById,+ isMarketplaceEntryAvailable,+} from "#/utils/mcp-marketplace-utils";+import ClockIcon from "#/icons/clock.svg?react";+import { StatusBadge } from "./status-badge";++interface RecommendedAutomationsSectionProps {+ backendKind: "local" | "cloud";+ installedServers: MCPServerConfig[];+ query?: string;+ onSelect: (automation: RecommendedAutomation) => void;+}++export function getAutomationsByPopularity(+ catalog: RecommendedAutomation[],+): RecommendedAutomation[] {+ return catalog+ .map((automation, index) => ({ automation, index }))+ .sort((a, b) => {+ const byPopularity =+ (b.automation.popularityRank ?? 0) - (a.automation.popularityRank ?? 0);+ return byPopularity || a.index - b.index;+ })+ .map(({ automation }) => automation);+}++const RECOMMENDED_AUTOMATIONS = getAutomationsByPopularity(AUTOMATION_CATALOG);++function getRequiredEntries(automation: RecommendedAutomation) {+ return automation.requiredMcpIds+ .map((id) => getMarketplaceEntryById(id, MCP_MARKETPLACE))+ .filter((entry): entry is MarketplaceEntry => !!entry);+}++function automationMatchesQuery(+ automation: RecommendedAutomation,+ entries: MarketplaceEntry[],+ rawQuery: string,+) {+ const query = rawQuery.trim().toLowerCase();+ if (!query) return true;+ const haystack = [+ automation.name,+ automation.category,+ automation.description,+ automation.prompt,+ ...entries.map((entry) => entry.name),+ ...entries.flatMap((entry) => entry.keywords ?? []),+ ]+ .join(" ")+ .toLowerCase();+ return haystack.includes(query);+}++function isAutomationAvailable(+ automation: RecommendedAutomation,+ backendKind: "local" | "cloud",+) {+ return getRequiredEntries(automation).every((entry) =>+ isMarketplaceEntryAvailable(entry, backendKind),+ );+}++export function RecommendedAutomationsSection({+ backendKind,+ installedServers,+ query = "",+ onSelect,+}: RecommendedAutomationsSectionProps) {+ const { t } = useTranslation("openhands");++ const visibleAutomations = RECOMMENDED_AUTOMATIONS.filter((automation) => {+ const requiredEntries = getRequiredEntries(automation);+ return (+ isAutomationAvailable(automation, backendKind) &&+ automationMatchesQuery(automation, requiredEntries, query)+ );+ });++ if (visibleAutomations.length === 0) return null;++ return (+ <section data-testid="recommended-automations-section">+ <div className="flex items-center">+ <h2 className="text-sm font-semibold text-white">+ {t(I18nKey.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}+ </h2>+ <StatusBadge count={visibleAutomations.length} />+ </div>+ <p className="mt-1 text-sm text-muted">+ {t(I18nKey.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}+ </p>++ <div className="mt-3 flex flex-col gap-3">+ {visibleAutomations.map((automation) => {+ const requiredEntries = getRequiredEntries(automation);+ const missingCount = requiredEntries.filter(+ (entry) => !findInstalledMatch(entry.template, installedServers),+ ).length;++ return (+ <button+ key={automation.id}+ type="button"+ data-testid={`recommended-automation-card-${automation.id}`}+ onClick={() => onSelect(automation)}+ className="cursor-pointer rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-5 text-left transition-colors hover:border-[var(--oh-border)] focus:outline-none focus:ring-2 focus:ring-primary/50"+ >+ <div className="flex items-start justify-between gap-4">+ <div className="min-w-0 flex-1">+ <div className="text-xs font-medium text-muted">+ {automation.category}+ </div>+ <h3 className="mt-1 truncate text-base font-semibold text-white">+ {automation.name}+ </h3>+ <p className="mt-1 line-clamp-2 text-sm text-muted">+ {automation.description}+ </p>+ </div>+ <div className="flex shrink-0 -space-x-1" aria-hidden="true">+ {requiredEntries.map((entry) => (+ <McpLogoBadge+ key={entry.id}+ entry={entry}+ size="sm"+ className="ring-2 ring-[var(--oh-surface)]"+ />+ ))}+ </div>+ </div>++ <div className="mt-3 flex flex-wrap gap-2">+ {requiredEntries.map((entry) => {+ const installed = !!findInstalledMatch(+ entry.template,+ installedServers,+ );+ return (+ <span+ key={entry.id}+ className="inline-flex items-center gap-1.5 rounded-full border border-[var(--oh-border)] px-3 py-1 text-xs text-muted"+ >+ <McpLogoBadge entry={entry} size="sm" />+ {entry.name}+ {installed && (+ <span className="text-primary">+ {t(I18nKey.RECOMMENDED_AUTOMATIONS$CONNECTED)}+ </span>+ )}+ </span>+ );+ })}+ <span className="inline-flex items-center gap-1.5 rounded-full border border-[var(--oh-border)] px-3 py-1 text-xs text-muted">+ <ClockIcon className="size-3.5" />+ {t(I18nKey.RECOMMENDED_AUTOMATIONS$MINUTES, {+ count: automation.estimatedSetupMinutes,+ })}+ </span>+ </div>++ {missingCount > 0 && (+ <p className="mt-3 text-xs text-muted">+ {t(I18nKey.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT, {+ count: missingCount,+ })}+ </p>+ )}+ </button>+ );+ })}+ </div>+ </section>+ );+}diff --git a/src/components/features/mcp-logo-badge.tsx b/src/components/features/mcp-logo-badge.tsxnew file mode 100644index 0000000000..af4968da98--- /dev/null+++ b/src/components/features/mcp-logo-badge.tsx@@ -0,0 +1,49 @@+import type { ReactNode } from "react";+import type { McpCatalogEntry } from "@openhands/extensions/mcps";+import { MCP_FALLBACK_LOGO, MCP_LOGOS } from "@openhands/extensions/mcps/logos";+import { cn } from "#/utils/utils";++type McpLogoEntry = Pick<+ McpCatalogEntry,+ "id" | "name" | "iconBg" | "iconColor"+>;++interface McpLogoBadgeProps {+ entry?: McpLogoEntry | null;+ size?: "sm" | "md";+ className?: string;+ fallback?: ReactNode;+}++const sizeClassNames = {+ sm: "h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3",+ md: "h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5",+};++export function McpLogoBadge({+ entry,+ size = "md",+ className,+ fallback,+}: McpLogoBadgeProps) {+ return (+ <span+ aria-hidden="true"+ title={entry?.name}+ className={cn(+ "inline-flex shrink-0 items-center justify-center overflow-hidden",+ "border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",+ sizeClassNames[size],+ className,+ )}+ style={{+ backgroundColor: entry?.iconBg ?? "var(--oh-color-tertiary)",+ color: entry?.iconColor ?? "#FFFFFF",+ }}+ >+ {entry+ ? (MCP_LOGOS[entry.id] ?? fallback ?? MCP_FALLBACK_LOGO)+ : (fallback ?? MCP_FALLBACK_LOGO)}+ </span>+ );+}diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsxindex 04e3286868..4ff7d2fcb6 100644--- a/src/components/features/mcp-page/install-server-modal.tsx+++ b/src/components/features/mcp-page/install-server-modal.tsx@@ -5,7 +5,8 @@ import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { BrandButton } from "#/components/features/settings/brand-button";import { SettingsInput } from "#/components/features/settings/settings-input";import { I18nKey } from "#/i18n/declaration";-import { MarketplaceEntry } from "#/constants/mcp-marketplace";+import type { McpCatalogEntry as MarketplaceEntry } from "@openhands/extensions/mcps";+import { McpLogoBadge } from "#/components/features/mcp-logo-badge";import { MCPServerConfig } from "#/types/mcp-server";import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server";import { displaySuccessToast } from "#/utils/custom-toast-handlers";@@ -14,6 +15,7 @@ import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message"interface InstallServerModalProps {entry: MarketplaceEntry;onClose: () => void;+ onSuccess?: (entry: MarketplaceEntry) => void;}interface FieldState {@@ -45,6 +47,7 @@ function makeInitialState(entry: MarketplaceEntry): FieldState {export function InstallServerModal({entry,onClose,+ onSuccess,}: InstallServerModalProps) {const { t } = useTranslation("openhands");const { mutate: addMcpServer, isPending: isAdding } = useAddMcpServer();@@ -68,6 +71,7 @@ export function InstallServerModal({addMcpServer(payload, {onSuccess: () => {displaySuccessToast(t(I18nKey.MCP$INSTALL_SUCCESS));+ onSuccess?.(entry);onClose();},onError: (err: unknown) => {@@ -267,17 +271,7 @@ export function InstallServerModal({className="bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar"><div className="flex items-start gap-3">- <span- aria-hidden="true"- className="shrink-0 inline-flex items-center justify-center h-10 w-10 rounded-lg"- // data-driven icon colors from marketplace entry- style={{- backgroundColor: entry.iconBg,- color: entry.iconColor ?? "#FFFFFF",- }}- >- {entry.logo}- </span>+ <McpLogoBadge entry={entry} /><div className="flex flex-col flex-1"><h2 className="text-lg font-semibold">{entry.name}</h2><p className="text-xs text-tertiary-alt">{entry.description}</p>diff --git a/src/components/features/mcp-page/installed-server-card.tsx b/src/components/features/mcp-page/installed-server-card.tsxindex 222c4fdeb3..fc267a9490 100644--- a/src/components/features/mcp-page/installed-server-card.tsx+++ b/src/components/features/mcp-page/installed-server-card.tsx@@ -1,8 +1,9 @@import { Puzzle, Pencil, Trash2 } from "lucide-react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";+import { McpLogoBadge } from "#/components/features/mcp-logo-badge";import { MCPServerConfig } from "#/types/mcp-server";-import { MCP_MARKETPLACE } from "#/constants/mcp-marketplace";+import { MCP_CATALOG as MCP_MARKETPLACE } from "@openhands/extensions/mcps";import { findCatalogEntryForServer } from "#/utils/mcp-marketplace-utils";import { cn } from "#/utils/utils";@@ -64,17 +65,7 @@ export function InstalledServerCard({"border border-[var(--oh-border)] bg-base-secondary p-4",)}>- <span- aria-hidden="true"- className="shrink-0 inline-flex items-center justify-center h-10 w-10 rounded-lg"- // data-driven icon colors from catalog entry- style={{- backgroundColor: catalog?.iconBg ?? "var(--oh-color-tertiary)",- color: catalog?.iconColor ?? "#FFFFFF",- }}- >- {catalog?.logo ?? <Puzzle className="h-5 w-5" strokeWidth={2.25} />}- </span>+ <McpLogoBadge entry={catalog} fallback={<Puzzle strokeWidth={2.25} />} /><div className="flex flex-col min-w-0 flex-1 gap-0.5"><div className="flex items-center gap-2">diff --git a/src/components/features/mcp-page/marketplace-card.tsx b/src/components/features/mcp-page/marketplace-card.tsxindex 77e89a3657..0f01b0ba3a 100644--- a/src/components/features/mcp-page/marketplace-card.tsx+++ b/src/components/features/mcp-page/marketplace-card.tsx@@ -1,6 +1,7 @@import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";-import { MarketplaceEntry } from "#/constants/mcp-marketplace";+import type { McpCatalogEntry as MarketplaceEntry } from "@openhands/extensions/mcps";+import { McpLogoBadge } from "#/components/features/mcp-logo-badge";import { cn } from "#/utils/utils";interface MarketplaceCardProps {@@ -35,28 +36,20 @@ export function MarketplaceCard({onClick={onClick}data-testid={`mcp-marketplace-card-${entry.id}`}className={cn(- "group flex flex-col text-left",+ "group relative flex min-h-[132px] flex-col overflow-hidden text-left","rounded-xl border border-[var(--oh-border)] bg-base-secondary","p-4 gap-3 cursor-pointer",- "hover:border-[var(--cool-grey-500)] hover:bg-base-tertiary/30 transition-colors",- "focus:outline-none focus:ring-2 focus:ring-[var(--oh-border)]",+ "transition-all duration-200 hover:-translate-y-0.5",+ "hover:border-primary/35 hover:bg-base-tertiary/30",+ "focus:outline-none focus:ring-2 focus:ring-primary/50",)}>+ <div+ aria-hidden="true"+ className="pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/15 to-transparent opacity-0 transition-opacity group-hover:opacity-100"+ /><div className="flex items-start gap-3">- <span- aria-hidden="true"- className={cn(- "shrink-0 inline-flex items-center justify-center",- "h-10 w-10 rounded-lg",- )}- // data-driven icon colors from marketplace entry- style={{- backgroundColor: entry.iconBg,- color: entry.iconColor ?? "#FFFFFF",- }}- >- {entry.logo}- </span>+ <McpLogoBadge entry={entry} /><div className="flex flex-col min-w-0 flex-1"><div className="flex items-center gap-2"><h3 className="text-sm font-semibold truncate">{entry.name}</h3>diff --git a/src/components/features/mcp-page/marketplace-section.tsx b/src/components/features/mcp-page/marketplace-section.tsxindex 3eaedf9982..1727402ae1 100644--- a/src/components/features/mcp-page/marketplace-section.tsx+++ b/src/components/features/mcp-page/marketplace-section.tsx@@ -1,7 +1,11 @@import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";-import { MCP_MARKETPLACE, MarketplaceEntry } from "#/constants/mcp-marketplace";import {+ MCP_CATALOG as MCP_MARKETPLACE,+ type McpCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/mcps";+import {+ getMarketplaceEntriesByPopularity,isMarketplaceEntryAvailable,marketplaceEntryMatchesQuery,} from "#/utils/mcp-marketplace-utils";@@ -23,7 +27,9 @@ export function MarketplaceSection({}: MarketplaceSectionProps) {const { t } = useTranslation("openhands");- const visibleEntries = MCP_MARKETPLACE.filter(+ const visibleEntries = getMarketplaceEntriesByPopularity(+ MCP_MARKETPLACE,+ ).filter((entry) =>isMarketplaceEntryAvailable(entry, backendKind) &&marketplaceEntryMatchesQuery(entry, query),diff --git a/src/components/features/onboarding/steps/say-hello-step.tsx b/src/components/features/onboarding/steps/say-hello-step.tsxindex f88ae6fc05..fc68f65d5f 100644--- a/src/components/features/onboarding/steps/say-hello-step.tsx+++ b/src/components/features/onboarding/steps/say-hello-step.tsx@@ -1,6 +1,7 @@import React from "react";import { useTranslation } from "react-i18next";import { Send } from "lucide-react";+import { RecommendedAutomationsLauncher } from "#/components/features/automations/recommended-automations-launcher";import { BrandButton } from "#/components/features/settings/brand-button";import { useNavigation } from "#/context/navigation-context";import { useCreateConversation } from "#/hooks/mutation/use-create-conversation";@@ -32,12 +33,14 @@ export function SayHelloStep({ onBack, onLaunched }: SayHelloStepProps) {} = useCreateConversation();const isCreatingElsewhere = useIsCreatingConversation();const isLaunching = isPending || isSuccess || isCreatingElsewhere;+ const launchInFlightRef = React.useRef(false);- const canSubmit = message.trim().length > 0 && !isLaunching;+ const canSubmit =+ message.trim().length > 0 && !isLaunching && !launchInFlightRef.current;- const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {- event.preventDefault();- if (!canSubmit) return;+ const launchConversation = () => {+ if (!canSubmit || launchInFlightRef.current) return;+ launchInFlightRef.current = true;// Explicitly omit `repository` and `workingDir` so the// conversation starts with no workspace, per the spec.@@ -48,14 +51,21 @@ export function SayHelloStep({ onBack, onLaunched }: SayHelloStepProps) {onLaunched();navigate(`/conversations/${data.conversation_id}`);},+ onError: () => {+ launchInFlightRef.current = false;+ },},);};+ const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {+ event.preventDefault();+ launchConversation();+ };+return (- <form+ <divdata-testid="onboarding-step-say-hello"- onSubmit={handleSubmit}className="flex flex-col gap-6"><header className="flex flex-col gap-2">@@ -67,18 +77,24 @@ export function SayHelloStep({ onBack, onLaunched }: SayHelloStepProps) {</p></header>- <input- data-testid="onboarding-hello-input"- aria-label={t(I18nKey.ONBOARDING$HELLO_TITLE)}- type="text"- value={message}- onChange={(event) => setMessage(event.target.value)}- placeholder={defaultMessage}- disabled={isLaunching}- className="w-full rounded-xl border border-white/10 bg-base-secondary px-4 py-3 text-base text-white placeholder:text-[var(--oh-text-subtle)] focus:border-primary focus:outline-none disabled:opacity-60"- />+ <form onSubmit={handleSubmit} className="contents">+ <input+ data-testid="onboarding-hello-input"+ aria-label={t(I18nKey.ONBOARDING$HELLO_TITLE)}+ type="text"+ value={message}+ onChange={(event) => setMessage(event.target.value)}+ placeholder={defaultMessage}+ disabled={isLaunching}+ className="w-full rounded-xl border border-white/10 bg-base-secondary px-4 py-3 text-base text-white placeholder:text-[var(--oh-text-subtle)] focus:border-primary focus:outline-none disabled:opacity-60"+ />+ </form>- <div className="sticky bottom-0 flex items-center justify-end gap-2 bg-base-secondary pt-4 pb-7">+ <div data-testid="onboarding-recommended-automations">+ <RecommendedAutomationsLauncher onLaunched={onLaunched} />+ </div>++ <div className="sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7"><BrandButtontestId="onboarding-hello-back"type="button"@@ -90,9 +106,10 @@ export function SayHelloStep({ onBack, onLaunched }: SayHelloStepProps) {</BrandButton><BrandButtontestId="onboarding-hello-launch"- type="submit"+ type="button"variant="primary"isDisabled={!canSubmit}+ onClick={launchConversation}startContent={<Send className="size-4" aria-hidden />}>{isLaunching@@ -100,6 +117,6 @@ export function SayHelloStep({ onBack, onLaunched }: SayHelloStepProps) {: t(I18nKey.ONBOARDING$HELLO_LAUNCH)}</BrandButton></div>- </form>+ </div>);}diff --git a/src/constants/mcp-marketplace.tsx b/src/constants/mcp-marketplace.tsxdeleted file mode 100644index 3f6fdba025..0000000000--- a/src/constants/mcp-marketplace.tsx+++ /dev/null@@ -1,1147 +0,0 @@-// Curated catalog of well-known MCP servers exposed in the marketplace-// section of the MCP settings page. Order matters — GitHub is the most-// commonly-installed entry per product design, with Slack and Tavily-// pinned right after.-//-// Cloud vs Agent Server differences are expressed via `availability`:-// most entries are "all", but a small subset that only makes sense-// against a local runtime (filesystem, host postgres, host sqlite) is-// gated to "local".-//-// The catalog is intentionally a flat array of `MarketplaceEntry`-// values rather than something more dynamic — it doubles as the data-// source for the marketplace search bar, and keeping it static keeps-// the search trivially fast even with 50+ entries.--import type { ReactNode } from "react";-import {- BookOpen,- Bot,- Brain,- Clock,- Database,- Flame,- Folder,- GitBranch,- Globe,- ListTree,- MousePointerClick,- Search,- Sparkles,- Telescope,- TestTube,-} from "lucide-react";-import {- SiAirtable,- SiAtlassian,- SiBrave,- SiClickhouse,- SiCloudflare,- SiElevenlabs,- SiFigma,- SiGithub,- SiGitlab,- SiGooglemaps,- SiHuggingface,- SiKagi,- SiLinear,- SiMongodb,- SiNotion,- SiObsidian,- SiPaypal,- SiPostgresql,- SiPuppeteer,- SiRedis,- SiResend,- SiSentry,- SiSlack,- SiSqlite,- SiStripe,- SiSupabase,-} from "react-icons/si";--export type MarketplaceFieldType = "text" | "password";--export interface MarketplaceField {- key: string;- label: string;- type?: MarketplaceFieldType;- placeholder?: string;- helperText?: string;- required?: boolean;-}--export type MarketplaceTemplate =- | {- kind: "shttp";- url: string;- apiKeyOptional?: boolean;- }- | {- kind: "sse";- url: string;- apiKeyOptional?: boolean;- }- | {- kind: "stdio";- // Stable name persisted into the SDK mcp_config map.- serverName: string;- command: string;- args: string[];- envFields?: MarketplaceField[];- /**- * Fields whose values are appended to `args` at install time- * (each non-empty whitespace-separated token becomes its own- * arg). Useful for templates like Postgres / Filesystem where- * the user input is a positional argument, not an env var.- */- argFields?: MarketplaceField[];- };--export interface MarketplaceEntry {- id: string;- name: string;- description: string;- /** URL pointing at upstream docs/setup instructions. */- docsUrl?: string;- /**- * Brand-correct logo rendered inside the icon tile. Sized to fit- * the 40×40 tile (rendered at h-5/w-5 inside it). Use- * `currentColor` where possible so the parent's `iconColor`- * controls the fill.- */- logo: ReactNode;- /** Background color for the icon tile. */- iconBg: string;- /**- * Foreground color for the logo when the icon supports- * `currentColor`. Defaults to white; tiles on light brand colors- * (e.g. Notion, HuggingFace) override this.- */- iconColor?: string;- /**- * Extra free-text keywords used by the search bar in addition to- * `name` and `description`. Lower-case only.- */- keywords?: string[];- /** "all" by default; "local" hides the entry on cloud backends. */- availability?: "all" | "local";- /** Short helpful prose shown in the install modal under the title. */- installHint?: string;- template: MarketplaceTemplate;-}--const LOGO = "h-5 w-5";--// ----------------------------------------------------------------------// Order in this array IS the order users see in the marketplace grid.-// GitHub, Slack, and Tavily are pinned to the front intentionally.-// -----------------------------------------------------------------------export const MCP_MARKETPLACE: MarketplaceEntry[] = [- // -- Pinned ----------------------------------------------------------- {- id: "github",- name: "GitHub",- description:- "Search code, manage issues and pull requests, and inspect repos via the GitHub API.",- docsUrl: "https://github.com/github/github-mcp-server",- logo: <SiGithub className={LOGO} />,- iconBg: "var(--oh-surface)",- keywords: ["git", "pr", "repo", "issues", "code"],- template: {- kind: "stdio",- serverName: "github",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-github"],- envFields: [- {- key: "GITHUB_PERSONAL_ACCESS_TOKEN",- label: "Personal access token",- type: "password",- placeholder: "github_pat_...",- required: true,- },- ],- },- },- {- id: "slack",- name: "Slack",- description:- "Read channels, post messages, and search workspace history from your agent.",- logo: <SiSlack className={LOGO} />,- iconBg: "#4A154B",- keywords: ["chat", "messaging", "team"],- installHint:- "Create a Slack app with the required scopes, then paste its bot token below.",- template: {- kind: "stdio",- serverName: "slack",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-slack"],- envFields: [- {- key: "SLACK_BOT_TOKEN",- label: "Bot token",- type: "password",- placeholder: "xoxb-...",- required: true,- },- {- key: "SLACK_TEAM_ID",- label: "Team / Workspace ID",- type: "text",- placeholder: "T01234567",- helperText:- "Find this in Slack under Workspace settings → About this workspace.",- required: true,- },- ],- },- },- {- id: "tavily",- name: "Tavily",- description:- "Production-grade web search optimized for LLM agents. Free tier available.",- docsUrl: "https://github.com/tavily-ai/tavily-mcp",- // Tavily isn't in the simple-icons set; use a search glyph on- // their brand blue tile so the marketplace stays icon-consistent.- logo: <Search className={LOGO} strokeWidth={2.5} />,- iconBg: "#2563EB",- keywords: ["search", "web", "browsing", "research"],- installHint:- "Paste your Tavily API key — the official tavily-mcp package runs via npx.",- template: {- kind: "stdio",- serverName: "tavily",- command: "npx",- args: ["-y", "tavily-mcp"],- envFields: [- {- key: "TAVILY_API_KEY",- label: "Tavily API key",- type: "password",- placeholder: "tvly-...",- required: true,- },- ],- },- },-- // -- Hosted, first-party --------------------------------------------- {- id: "linear",- name: "Linear",- description:- "Browse and update Linear issues, cycles, and projects from the agent.",- docsUrl: "https://linear.app/changelog/2025-05-01-mcp",- logo: <SiLinear className={LOGO} />,- iconBg: "#5E6AD2",- keywords: ["issues", "project management", "tasks", "tickets"],- installHint:- "Linear's hosted MCP server uses your Linear OAuth login — no key required.",- template: {- kind: "sse",- url: "https://mcp.linear.app/sse",- apiKeyOptional: true,- },- },- {- id: "notion",- name: "Notion",- description:- "Read and edit Notion pages, databases, and blocks via Notion's MCP server.",- docsUrl: "https://developers.notion.com/docs/mcp",- logo: <SiNotion className={LOGO} />,- iconBg: "#FFFFFF",- iconColor: "#000000",- keywords: ["docs", "notes", "wiki", "knowledge base"],- template: {- kind: "stdio",- serverName: "notion",- command: "npx",- args: ["-y", "@notionhq/notion-mcp-server"],- envFields: [- {- key: "NOTION_API_KEY",- label: "Internal integration token",- type: "password",- placeholder: "ntn_...",- required: true,- },- ],- },- },- {- id: "atlassian",- name: "Atlassian (Jira & Confluence)",- description:- "Search Jira issues and Confluence pages via Atlassian's hosted MCP server.",- docsUrl: "https://www.atlassian.com/platform/remote-mcp-server",- logo: <SiAtlassian className={LOGO} />,- iconBg: "#0052CC",- keywords: ["jira", "confluence", "tickets", "wiki", "issues"],- template: {- kind: "sse",- url: "https://mcp.atlassian.com/v1/sse",- apiKeyOptional: true,- },- },- {- id: "sentry",- name: "Sentry",- description:- "Triage issues, inspect events, and run Seer fixes against your Sentry org.",- docsUrl: "https://docs.sentry.io/product/sentry-mcp/",- logo: <SiSentry className={LOGO} />,- iconBg: "#362D59",- keywords: ["errors", "observability", "monitoring", "crash"],- template: {- kind: "shttp",- url: "https://mcp.sentry.dev/mcp",- apiKeyOptional: true,- },- },- {- id: "stripe",- name: "Stripe",- description:- "Query customers, payments, subscriptions, and invoices via Stripe's hosted MCP server.",- docsUrl: "https://stripe.com/docs/mcp",- logo: <SiStripe className={LOGO} />,- iconBg: "#635BFF",- keywords: ["payments", "billing", "subscriptions", "finance"],- template: {- kind: "shttp",- url: "https://mcp.stripe.com/",- apiKeyOptional: true,- },- },- {- id: "paypal",- name: "PayPal",- description:- "Manage transactions and merchant data via PayPal's MCP server.",- docsUrl: "https://developer.paypal.com/tools/mcp-server/",- logo: <SiPaypal className={LOGO} />,- iconBg: "#003087",- keywords: ["payments", "billing", "finance"],- template: {- kind: "sse",- url: "https://mcp.paypal.com/sse",- apiKeyOptional: true,- },- },- {- id: "cloudflare-docs",- name: "Cloudflare Docs",- description:- "Search and reference Cloudflare's developer documentation directly from the agent.",- docsUrl: "https://developers.cloudflare.com/agents/model-context-protocol/",- logo: <SiCloudflare className={LOGO} />,- iconBg: "#F38020",- keywords: ["cloudflare", "docs", "reference", "workers"],- template: {- kind: "sse",- url: "https://docs.mcp.cloudflare.com/sse",- apiKeyOptional: true,- },- },- {- id: "cloudflare-bindings",- name: "Cloudflare Workers Bindings",- description:- "Inspect and manage KV, D1, R2, and Durable Object bindings on your Cloudflare account.",- docsUrl: "https://developers.cloudflare.com/agents/model-context-protocol/",- logo: <SiCloudflare className={LOGO} />,- iconBg: "#F38020",- keywords: ["cloudflare", "workers", "kv", "d1", "r2", "durable objects"],- template: {- kind: "sse",- url: "https://bindings.mcp.cloudflare.com/sse",- apiKeyOptional: true,- },- },- {- id: "cloudflare-observability",- name: "Cloudflare Observability",- description:- "Tail Workers logs and query observability data from your Cloudflare account.",- docsUrl: "https://developers.cloudflare.com/agents/model-context-protocol/",- logo: <SiCloudflare className={LOGO} />,- iconBg: "#F38020",- keywords: ["cloudflare", "logs", "tail", "observability", "workers"],- template: {- kind: "sse",- url: "https://observability.mcp.cloudflare.com/sse",- apiKeyOptional: true,- },- },- {- id: "huggingface",- name: "Hugging Face",- description:- "Search models, datasets, and Spaces on the Hugging Face Hub from your agent.",- docsUrl: "https://huggingface.co/docs/huggingface_hub/en/guides/mcp",- logo: <SiHuggingface className={LOGO} />,- iconBg: "#FFD21E",- iconColor: "#000000",- keywords: ["ml", "models", "datasets", "ai", "hub"],- template: {- kind: "shttp",- url: "https://huggingface.co/mcp",- apiKeyOptional: true,- },- },- {- id: "deepwiki",- name: "DeepWiki",- description:- "Ask grounded questions about any public GitHub repository via Devin's DeepWiki MCP.",- docsUrl: "https://docs.devin.ai/work-with-devin/deepwiki-mcp",- logo: <BookOpen className={LOGO} />,- iconBg: "var(--oh-color-base)",- keywords: ["devin", "code", "wiki", "github", "docs", "qa"],- template: {- kind: "sse",- url: "https://mcp.deepwiki.com/sse",- apiKeyOptional: true,- },- },-- // -- Source control & code intelligence ------------------------------- {- id: "gitlab",- name: "GitLab",- description:- "Search projects, browse merge requests, and update issues on GitLab.",- logo: <SiGitlab className={LOGO} />,- iconBg: "#FC6D26",- keywords: ["git", "mr", "repo", "issues", "code"],- template: {- kind: "stdio",- serverName: "gitlab",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-gitlab"],- envFields: [- {- key: "GITLAB_PERSONAL_ACCESS_TOKEN",- label: "Personal access token",- type: "password",- required: true,- },- {- key: "GITLAB_API_URL",- label: "API URL (optional)",- type: "text",- placeholder: "https://gitlab.example.com/api/v4",- helperText: "Leave blank to use gitlab.com.",- },- ],- },- },- {- id: "git",- name: "Git",- description:- "Local git repository operations: log, diff, blame, status, and more.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/git",- logo: <GitBranch className={LOGO} strokeWidth={2.25} />,- iconBg: "#F1502F",- availability: "local",- keywords: ["version control", "log", "diff", "blame"],- installHint:- "Runs the official Python server via uvx — no setup beyond the path.",- template: {- kind: "stdio",- serverName: "git",- command: "uvx",- // The repo path is appended as the value of `--repository`; the- // flag belongs on the base command so it lands immediately- // before the user-supplied path when the modal concatenates- // them.- args: ["mcp-server-git", "--repository"],- argFields: [- {- key: "repo_path",- label: "Repository path",- type: "text",- placeholder: "/Users/me/code/my-repo",- required: true,- helperText: "Appended as --repository <path>.",- },- ],- },- },-- // -- Search & browsing ------------------------------------------------ {- id: "brave-search",- name: "Brave Search",- description:- "Privacy-first web and local search using the Brave Search API.",- docsUrl: "https://github.com/brave/brave-search-mcp-server",- logo: <SiBrave className={LOGO} />,- iconBg: "#FB542B",- keywords: ["search", "web"],- template: {- kind: "stdio",- serverName: "brave_search",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-brave-search"],- envFields: [- {- key: "BRAVE_API_KEY",- label: "Brave API key",- type: "password",- required: true,- },- ],- },- },- {- id: "exa",- name: "Exa",- description:- "Neural web search with semantic ranking, content extraction, and similar-page lookup.",- docsUrl: "https://docs.exa.ai/reference/exa-mcp",- logo: <Telescope className={LOGO} strokeWidth={2.25} />,- iconBg: "var(--oh-surface)",- keywords: ["search", "web", "research", "neural"],- template: {- kind: "stdio",- serverName: "exa",- command: "npx",- args: ["-y", "exa-mcp-server"],- envFields: [- {- key: "EXA_API_KEY",- label: "Exa API key",- type: "password",- required: true,- },- ],- },- },- {- id: "firecrawl",- name: "Firecrawl",- description:- "Crawl any site and return clean markdown, structured data, or screenshots.",- docsUrl: "https://docs.firecrawl.dev/mcp",- logo: <Flame className={LOGO} strokeWidth={2.25} />,- iconBg: "#F97316",- keywords: ["scraping", "crawl", "web", "markdown"],- template: {- kind: "stdio",- serverName: "firecrawl",- command: "npx",- args: ["-y", "firecrawl-mcp"],- envFields: [- {- key: "FIRECRAWL_API_KEY",- label: "Firecrawl API key",- type: "password",- required: true,- },- ],- },- },- {- id: "apify",- name: "Apify Actors",- description:- "Run any of Apify's 5,000+ Actors (scrapers, automations) from the agent.",- docsUrl: "https://docs.apify.com/platform/integrations/mcp",- logo: <Bot className={LOGO} strokeWidth={2.25} />,- iconBg: "#10b981",- keywords: ["scraping", "automation", "crawl", "actors"],- template: {- kind: "stdio",- serverName: "apify",- command: "npx",- args: ["-y", "@apify/actors-mcp-server"],- envFields: [- {- key: "APIFY_TOKEN",- label: "Apify token",- type: "password",- required: true,- },- ],- },- },- {- id: "fetch",- name: "Fetch",- description:- "Plain HTTP fetcher: download a URL and convert HTML to readable markdown.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",- logo: <Globe className={LOGO} strokeWidth={2.25} />,- iconBg: "var(--oh-interactive-hover)",- keywords: ["http", "web", "url", "scrape"],- template: {- kind: "stdio",- serverName: "fetch",- command: "uvx",- args: ["mcp-server-fetch"],- },- },- {- id: "browser-mcp",- name: "Browser MCP",- description:- "Control your local browser tab — navigate, click, type, and read DOM contents.",- docsUrl: "https://browsermcp.io/",- logo: <MousePointerClick className={LOGO} strokeWidth={2.25} />,- iconBg: "#0EA5E9",- availability: "local",- keywords: ["browser", "automation", "chrome", "playwright"],- template: {- kind: "stdio",- serverName: "browser_mcp",- command: "npx",- args: ["-y", "@browsermcp/mcp"],- },- },- {- id: "playwright",- name: "Playwright",- description: "Headless-browser automation backed by Microsoft Playwright.",- docsUrl: "https://github.com/microsoft/playwright-mcp",- logo: <TestTube className={LOGO} strokeWidth={2.25} />,- iconBg: "#2EAD33",- keywords: ["browser", "automation", "e2e", "testing", "scrape"],- template: {- kind: "stdio",- serverName: "playwright",- command: "npx",- args: ["-y", "@playwright/mcp"],- },- },- {- id: "puppeteer",- name: "Puppeteer",- description:- "Headless Chrome via Puppeteer — navigate, screenshot, and scrape pages.",- logo: <SiPuppeteer className={LOGO} />,- iconBg: "#40B5A4",- keywords: ["browser", "automation", "scrape", "chrome"],- template: {- kind: "stdio",- serverName: "puppeteer",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-puppeteer"],- },- },- {- id: "google-maps",- name: "Google Maps",- description:- "Geocoding, directions, places search, and distance matrix lookups.",- logo: <SiGooglemaps className={LOGO} />,- iconBg: "#4285F4",- keywords: ["maps", "geocode", "directions", "places"],- template: {- kind: "stdio",- serverName: "google_maps",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-google-maps"],- envFields: [- {- key: "GOOGLE_MAPS_API_KEY",- label: "Google Maps API key",- type: "password",- required: true,- },- ],- },- },-- // -- Databases -------------------------------------------------------- {- id: "postgres",- name: "Postgres",- description:- "Read-only SQL queries and schema introspection against any Postgres database.",- logo: <SiPostgresql className={LOGO} />,- iconBg: "#336791",- availability: "local",- keywords: ["sql", "database", "postgresql"],- template: {- kind: "stdio",- serverName: "postgres",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-postgres"],- argFields: [- {- key: "connection_string",- label: "Connection string",- type: "password",- placeholder: "postgresql://user:pass@host:5432/dbname",- required: true,- helperText: "Passed to the server as a single positional argument.",- },- ],- },- },- {- id: "supabase",- name: "Supabase",- description:- "Query and manage your Supabase project, including database, auth, and storage.",- docsUrl: "https://supabase.com/docs/guides/getting-started/mcp",- logo: <SiSupabase className={LOGO} />,- iconBg: "#3ECF8E",- keywords: ["database", "auth", "storage", "postgres"],- template: {- kind: "stdio",- serverName: "supabase",- command: "npx",- args: ["-y", "@supabase/mcp-server-supabase@latest"],- envFields: [- {- key: "SUPABASE_ACCESS_TOKEN",- label: "Supabase access token",- type: "password",- required: true,- helperText: "Personal access token from your Supabase dashboard.",- },- ],- },- },- {- id: "neon",- name: "Neon",- description:- "Serverless Postgres: list projects, run queries, manage branches.",- docsUrl: "https://neon.com/docs/ai/neon-mcp-server",- logo: <Database className={LOGO} strokeWidth={2.25} />,- iconBg: "#00E599",- iconColor: "var(--oh-surface-deep)",- keywords: ["database", "postgres", "serverless"],- template: {- kind: "stdio",- serverName: "neon",- command: "npx",- args: ["-y", "@neondatabase/mcp-server-neon", "start"],- envFields: [- {- key: "NEON_API_KEY",- label: "Neon API key",- type: "password",- required: true,- },- ],- },- },- {- id: "mongodb",- name: "MongoDB",- description:- "Query MongoDB collections, inspect schemas, and run aggregation pipelines.",- docsUrl: "https://www.mongodb.com/docs/mcp-server/",- logo: <SiMongodb className={LOGO} />,- iconBg: "#00684A",- keywords: ["database", "nosql", "atlas"],- template: {- kind: "stdio",- serverName: "mongodb",- command: "npx",- args: ["-y", "mongodb-mcp-server"],- envFields: [- {- key: "MDB_MCP_CONNECTION_STRING",- label: "MongoDB connection string",- type: "password",- placeholder: "mongodb+srv://user:[email protected]",- required: true,- },- ],- },- },- {- id: "redis",- name: "Redis",- description:- "Get, set, scan, and inspect data on a Redis or Redis-compatible instance.",- docsUrl: "https://github.com/redis/mcp-redis",- logo: <SiRedis className={LOGO} />,- iconBg: "#DC382D",- availability: "local",- keywords: ["cache", "kv", "database"],- template: {- kind: "stdio",- serverName: "redis",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-redis"],- argFields: [- {- key: "redis_url",- label: "Redis URL",- type: "password",- placeholder: "redis://localhost:6379",- required: true,- helperText: "Passed as a single positional argument.",- },- ],- },- },- {- id: "sqlite",- name: "SQLite",- description:- "Open a SQLite database file and run queries, schema dumps, and explorations.",- logo: <SiSqlite className={LOGO} />,- iconBg: "#003B57",- availability: "local",- keywords: ["database", "sql", "local"],- template: {- kind: "stdio",- serverName: "sqlite",- command: "uvx",- // `--db-path` is the flag the official mcp-server-sqlite expects- // before the user-supplied path; keeping it on the base command- // means the modal can concatenate the path verbatim.- args: ["mcp-server-sqlite", "--db-path"],- argFields: [- {- key: "db_path",- label: "Database file path",- type: "text",- placeholder: "/Users/me/my.db",- required: true,- helperText: "Appended as --db-path <path>.",- },- ],- },- },-- // -- Agent toolbelt --------------------------------------------------- {- id: "filesystem",- name: "Filesystem",- description:- "Give the agent secure, scoped filesystem access outside the workspace.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",- logo: <Folder className={LOGO} strokeWidth={2.25} />,- iconBg: "var(--oh-interactive-hover)",- availability: "local",- keywords: ["files", "local", "disk"],- installHint:- "Each path is exposed read/write. Add as many as you need, separated by spaces.",- template: {- kind: "stdio",- serverName: "filesystem",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-filesystem"],- argFields: [- {- key: "paths",- label: "Paths (space separated)",- type: "text",- placeholder: "/Users/me/Documents /Users/me/Projects",- required: true,- helperText:- "Each whitespace-separated token is appended as its own argument.",- },- ],- },- },- {- id: "memory",- name: "Memory",- description:- "Persistent key-value memory for the agent across conversations.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/memory",- logo: <Brain className={LOGO} strokeWidth={2.25} />,- iconBg: "#7C3AED",- keywords: ["memory", "kv", "state", "persistence"],- template: {- kind: "stdio",- serverName: "memory",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-memory"],- },- },- {- id: "sequential-thinking",- name: "Sequential Thinking",- description:- "Lets the agent emit and revise a chain of structured thoughts.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",- logo: <ListTree className={LOGO} strokeWidth={2.25} />,- iconBg: "var(--oh-color-base)",- keywords: ["reasoning", "planning", "thoughts"],- template: {- kind: "stdio",- serverName: "sequential_thinking",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],- },- },- {- id: "time",- name: "Time",- description:- "Timezone-aware current time, conversions, and timestamp formatting.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/time",- logo: <Clock className={LOGO} strokeWidth={2.25} />,- iconBg: "var(--oh-surface)",- keywords: ["clock", "timezone", "date"],- template: {- kind: "stdio",- serverName: "time",- command: "uvx",- args: ["mcp-server-time"],- },- },-- {- id: "everything",- name: "Everything (demo)",- description:- "Reference server exercising every MCP capability — useful for testing.",- docsUrl:- "https://github.com/modelcontextprotocol/servers/tree/main/src/everything",- logo: <Sparkles className={LOGO} strokeWidth={2.25} />,- iconBg: "#6366F1",- keywords: ["demo", "test", "reference"],- template: {- kind: "stdio",- serverName: "everything",- command: "npx",- args: ["-y", "@modelcontextprotocol/server-everything"],- },- },- // -- Productivity / design / media ------------------------------------ {- id: "figma",- name: "Figma",- description:- "Read Figma frames, components, and styles to ground UI work in your designs.",- docsUrl: "https://github.com/GLips/Figma-Context-MCP",- logo: <SiFigma className={LOGO} />,- iconBg: "var(--oh-surface)",- keywords: ["design", "ui", "frames", "components"],- template: {- kind: "stdio",- serverName: "figma",- command: "npx",- args: ["-y", "figma-developer-mcp", "--stdio"],- envFields: [- {- key: "FIGMA_API_KEY",- label: "Figma personal access token",- type: "password",- required: true,- },- ],- },- },- {- id: "airtable",- name: "Airtable",- description:- "List bases, query records, and update fields across your Airtable workspace.",- docsUrl: "https://github.com/domdomegg/airtable-mcp-server",- logo: <SiAirtable className={LOGO} />,- iconBg: "#FCB400",- iconColor: "var(--oh-surface-deep)",- keywords: ["spreadsheet", "database", "records", "bases"],- template: {- kind: "stdio",- serverName: "airtable",- command: "npx",- args: ["-y", "airtable-mcp-server"],- envFields: [- {- key: "AIRTABLE_API_KEY",- label: "Airtable personal access token",- type: "password",- required: true,- },- ],- },- },- {- id: "obsidian",- name: "Obsidian",- description:- "Read and edit Markdown notes inside an Obsidian vault on the local disk.",- docsUrl: "https://github.com/MarkusPfundstein/mcp-obsidian",- logo: <SiObsidian className={LOGO} />,- iconBg: "#7C3AED",- availability: "local",- keywords: ["notes", "knowledge", "markdown", "vault"],- template: {- kind: "stdio",- serverName: "obsidian",- command: "uvx",- args: ["mcp-obsidian"],- envFields: [- {- key: "OBSIDIAN_API_KEY",- label: "Local REST API key",- type: "password",- required: true,- helperText: "From the Obsidian 'Local REST API' community plugin.",- },- ],- },- },- {- id: "elevenlabs",- name: "ElevenLabs",- description:- "Generate speech, clone voices, and transcribe audio via ElevenLabs.",- docsUrl: "https://elevenlabs.io/docs/api-reference/mcp",- logo: <SiElevenlabs className={LOGO} />,- iconBg: "var(--oh-color-base)",- keywords: ["tts", "speech", "voice", "audio"],- template: {- kind: "stdio",- serverName: "elevenlabs",- command: "uvx",- args: ["elevenlabs-mcp"],- envFields: [- {- key: "ELEVENLABS_API_KEY",- label: "ElevenLabs API key",- type: "password",- required: true,- },- ],- },- },- {- id: "resend",- name: "Resend",- description: "Send transactional and marketing emails via the Resend API.",- docsUrl: "https://resend.com/docs/mcp",- logo: <SiResend className={LOGO} />,- iconBg: "var(--oh-surface-deep)",- keywords: ["email", "transactional", "smtp"],- template: {- kind: "stdio",- serverName: "resend",- command: "npx",- args: ["-y", "mcp-send-email"],- envFields: [- {- key: "RESEND_API_KEY",- label: "Resend API key",- type: "password",- required: true,- },- {- key: "SENDER_EMAIL_ADDRESS",- label: "From address",- type: "text",- placeholder: "[email protected]",- required: true,- },- ],- },- },- {- id: "cloudflare-builds",- name: "Cloudflare Builds",- description:- "Inspect Workers Builds — logs, statuses, and rerun failed deploys.",- docsUrl: "https://developers.cloudflare.com/agents/model-context-protocol/",- logo: <SiCloudflare className={LOGO} />,- iconBg: "#F38020",- keywords: ["cloudflare", "workers", "ci", "builds", "deploys"],- template: {- kind: "sse",- url: "https://builds.mcp.cloudflare.com/sse",- apiKeyOptional: true,- },- },- {- id: "cloudflare-browser-rendering",- name: "Cloudflare Browser Rendering",- description:- "Fetch and screenshot pages using Cloudflare's hosted browser rendering.",- docsUrl: "https://developers.cloudflare.com/agents/model-context-protocol/",- logo: <SiCloudflare className={LOGO} />,- iconBg: "#F38020",- keywords: ["cloudflare", "browser", "rendering", "screenshots"],- template: {- kind: "sse",- url: "https://browser.mcp.cloudflare.com/sse",- apiKeyOptional: true,- },- },- {- id: "kagi",- name: "Kagi Search",- description:- "Paid, privacy-first search with high signal-to-noise — great for research.",- docsUrl: "https://github.com/kagisearch/kagimcp",- logo: <SiKagi className={LOGO} />,- iconBg: "#FFB319",- iconColor: "var(--oh-surface-deep)",- keywords: ["search", "web", "privacy"],- template: {- kind: "stdio",- serverName: "kagi",- command: "uvx",- args: ["kagimcp"],- envFields: [- {- key: "KAGI_API_KEY",- label: "Kagi API key",- type: "password",- required: true,- },- ],- },- },- {- id: "clickhouse",- name: "ClickHouse",- description: "Run analytical SQL queries against a ClickHouse cluster.",- docsUrl: "https://github.com/ClickHouse/mcp-clickhouse",- logo: <SiClickhouse className={LOGO} />,- iconBg: "#FFFF00",- iconColor: "var(--oh-surface-deep)",- keywords: ["analytics", "olap", "database", "sql"],- template: {- kind: "stdio",- serverName: "clickhouse",- command: "uvx",- args: ["mcp-clickhouse"],- envFields: [- {- key: "CLICKHOUSE_HOST",- label: "Host",- type: "text",- placeholder: "clickhouse.example.com",- required: true,- },- {- key: "CLICKHOUSE_USER",- label: "Username",- type: "text",- required: true,- },- {- key: "CLICKHOUSE_PASSWORD",- label: "Password",- type: "password",- required: true,- },- ],- },- },-];diff --git a/src/hooks/query/use-task-polling.ts b/src/hooks/query/use-task-polling.tsindex ec08a2d3ac..fa2a7e446f 100644--- a/src/hooks/query/use-task-polling.ts+++ b/src/hooks/query/use-task-polling.ts@@ -3,6 +3,10 @@ import { useQuery } from "@tanstack/react-query";import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";import { useNavigation } from "#/context/navigation-context";import { useOptionalConversationId } from "#/hooks/use-conversation-id";+import {+ consumePendingTaskDraft,+ setConversationState,+} from "#/utils/conversation-local-storage";/*** Hook that polls V1 conversation start tasks and navigates when ready.@@ -56,10 +60,17 @@ export const useTaskPolling = () => {useEffect(() => {const task = taskQuery.data;if (task?.status === "READY" && task.app_conversation_id) {+ const pendingDraft = consumePendingTaskDraft(taskId);+ if (pendingDraft) {+ setConversationState(task.app_conversation_id, {+ draftMessage: pendingDraft,+ });+ }+// Replace the URL with the actual conversation IDnavigate(`/conversations/${task.app_conversation_id}`, { replace: true });}- }, [taskQuery.data, navigate]);+ }, [taskQuery.data, navigate, taskId]);return {isTask,diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex e4aa666cbd..aa1070137c 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -27420,6 +27420,295 @@"uk": "Відкривайте навички для додавання до вашого робочого простору. Відкрийте картку для запитів, curl та процесів встановлення. Шукайте на бічній панелі, щоб фільтрувати список. Увімкніть або вимкніть навички за замовчуванням. Вимкнені навички не завантажуватимуться в контекст агента.","ca": "Descobreix habilitats per afegir al teu espai de treball. Obre una targeta per veure indicacions, curl i fluxos d'instal·lació. Cerca des de la barra lateral per filtrar la llista. Activeu o desactiveu les habilitats predeterminades. Les habilitats desactivades no es carregaran al context de l'agent."},+ "RECOMMENDED_AUTOMATIONS$SECTION_LABEL": {+ "en": "Recommended automations",+ "ja": "おすすめの自動化",+ "zh-CN": "推荐的自动化",+ "zh-TW": "推薦的自動化",+ "ko-KR": "추천 자동화",+ "no": "Anbefalte automatiseringer",+ "ar": "الأتمتات الموصى بها",+ "de": "Empfohlene Automatisierungen",+ "fr": "Automatisations recommandées",+ "it": "Automazioni consigliate",+ "pt": "Automações recomendadas",+ "es": "Automatizaciones recomendadas",+ "ca": "Automatitzacions recomanades",+ "tr": "Önerilen otomasyonlar",+ "uk": "Рекомендовані автоматизації"+ },+ "RECOMMENDED_AUTOMATIONS$SECTION_TITLE": {+ "en": "Start from a proven workflow",+ "ja": "実績のあるワークフローから始める",+ "zh-CN": "从经过验证的工作流开始",+ "zh-TW": "從經過驗證的工作流程開始",+ "ko-KR": "검증된 워크플로에서 시작하기",+ "no": "Start med en utprøvd arbeidsflyt",+ "ar": "ابدأ من سير عمل مجرّب",+ "de": "Mit einem bewährten Workflow starten",+ "fr": "Démarrer avec un flux de travail éprouvé",+ "it": "Inizia da un flusso di lavoro collaudato",+ "pt": "Comece com um fluxo de trabalho comprovado",+ "es": "Empieza con un flujo de trabajo probado",+ "ca": "Comença amb un flux de treball provat",+ "tr": "Kanıtlanmış bir iş akışıyla başlayın",+ "uk": "Почніть із перевіреного робочого процесу"+ },+ "RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION": {+ "en": "Each template bundles an agent prompt, an implementation sketch, and the MCPs needed to make it useful. Pick one to open a pre-filled conversation and finish the details with the agent.",+ "ja": "各テンプレートには、エージェント用プロンプト、実装のたたき台、それを役立てるために必要な MCP が含まれています。1 つ選ぶと入力済みの会話が開き、エージェントと詳細を仕上げられます。",+ "zh-CN": "每个模板都包含代理提示、实现草图,以及让它发挥作用所需的 MCP。选择一个即可打开预填充的对话,并与代理一起完成细节。",+ "zh-TW": "每個範本都包含代理提示、實作草圖,以及讓它發揮作用所需的 MCP。選擇一個即可開啟預先填好的對話,並與代理一起完成細節。",+ "ko-KR": "각 템플릿에는 에이전트 프롬프트, 구현 초안, 유용하게 만드는 데 필요한 MCP가 포함됩니다. 하나를 선택하면 미리 채워진 대화를 열고 에이전트와 세부 사항을 마무리할 수 있습니다.",+ "no": "Hver mal samler en agent-instruks, en implementasjonsskisse og MCP-ene som trengs for å gjøre den nyttig. Velg en for å åpne en forhåndsutfylt samtale og fullføre detaljene med agenten.",+ "ar": "يجمع كل قالب مطالبة للوكيل ومخطط تنفيذ وواجهات MCP اللازمة لجعله مفيدًا. اختر واحدًا لفتح محادثة مملوءة مسبقًا وإكمال التفاصيل مع الوكيل.",+ "de": "Jede Vorlage bündelt einen Agenten-Prompt, eine Implementierungsskizze und die MCPs, die sie nützlich machen. Wähle eine aus, um eine vorausgefüllte Unterhaltung zu öffnen und die Details mit dem Agenten abzuschließen.",+ "fr": "Chaque modèle regroupe une invite pour l’agent, une esquisse d’implémentation et les MCP nécessaires pour le rendre utile. Choisissez-en un pour ouvrir une conversation préremplie et finaliser les détails avec l’agent.",+ "it": "Ogni modello include un prompt per l'agente, uno schema di implementazione e gli MCP necessari per renderlo utile. Scegline uno per aprire una conversazione precompilata e completare i dettagli con l'agente.",+ "pt": "Cada modelo reúne um prompt para o agente, um esboço de implementação e os MCPs necessários para torná-lo útil. Escolha um para abrir uma conversa pré-preenchida e concluir os detalhes com o agente.",+ "es": "Cada plantilla reúne un prompt para el agente, un boceto de implementación y los MCP necesarios para que sea útil. Elige una para abrir una conversación prerrellenada y terminar los detalles con el agente.",+ "ca": "Cada plantilla agrupa una indicació per a l'agent, un esbós d'implementació i els MCP necessaris perquè sigui útil. Tria'n una per obrir una conversa emplenada prèviament i acabar els detalls amb l'agent.",+ "tr": "Her şablon bir ajan istemini, uygulama taslağını ve onu kullanışlı kılan MCP'leri içerir. Önceden doldurulmuş bir konuşma açmak ve ayrıntıları ajanla tamamlamak için birini seçin.",+ "uk": "Кожен шаблон містить запит для агента, ескіз реалізації та MCP, потрібні, щоб зробити його корисним. Виберіть один, щоб відкрити попередньо заповнену розмову й завершити деталі з агентом."+ },+ "RECOMMENDED_AUTOMATIONS$POPULARITY_SORTED": {+ "en": "Popularity sorted",+ "ja": "人気順",+ "zh-CN": "按热度排序",+ "zh-TW": "依熱門程度排序",+ "ko-KR": "인기순 정렬",+ "no": "Sortert etter popularitet",+ "ar": "مرتبة حسب الشعبية",+ "de": "Nach Beliebtheit sortiert",+ "fr": "Trié par popularité",+ "it": "Ordinato per popolarità",+ "pt": "Ordenado por popularidade",+ "es": "Ordenado por popularidad",+ "ca": "Ordenat per popularitat",+ "tr": "Popülerliğe göre sıralı",+ "uk": "Відсортовано за популярністю"+ },+ "RECOMMENDED_AUTOMATIONS$MINUTES": {+ "en": "{{count}} min",+ "ja": "{{count}} 分",+ "zh-CN": "{{count}} 分钟",+ "zh-TW": "{{count}} 分鐘",+ "ko-KR": "{{count}}분",+ "no": "{{count}} min",+ "ar": "{{count}} دقيقة",+ "de": "{{count}} Min.",+ "fr": "{{count}} min",+ "it": "{{count}} min",+ "pt": "{{count}} min",+ "es": "{{count}} min",+ "ca": "{{count}} min",+ "tr": "{{count}} dk",+ "uk": "{{count}} хв"+ },+ "RECOMMENDED_AUTOMATIONS$MISSING_CONNECT": {+ "en": "{{count}} MCPs to connect before launch",+ "ja": "起動前に接続する MCP: {{count}} 件",+ "zh-CN": "启动前需连接 {{count}} 个 MCP",+ "zh-TW": "啟動前需連接 {{count}} 個 MCP",+ "ko-KR": "시작하기 전에 연결할 MCP {{count}}개",+ "no": "{{count}} MCP-er må kobles til før start",+ "ar": "يجب توصيل {{count}} من MCP قبل التشغيل",+ "de": "{{count}} MCPs vor dem Start verbinden",+ "fr": "{{count}} MCP à connecter avant le lancement",+ "it": "{{count}} MCP da collegare prima dell'avvio",+ "pt": "{{count}} MCPs para conectar antes de iniciar",+ "es": "{{count}} MCP por conectar antes del inicio",+ "ca": "{{count}} MCP per connectar abans de l'inici",+ "tr": "Başlatmadan önce bağlanacak {{count}} MCP",+ "uk": "{{count}} MCP потрібно підключити перед запуском"+ },+ "RECOMMENDED_AUTOMATIONS$MODAL_AGENT_PROMPT": {+ "en": "Agent prompt",+ "ja": "エージェントプロンプト",+ "zh-CN": "代理提示",+ "zh-TW": "代理提示",+ "ko-KR": "에이전트 프롬프트",+ "no": "Agent-instruks",+ "ar": "مطالبة الوكيل",+ "de": "Agenten-Prompt",+ "fr": "Invite de l’agent",+ "it": "Prompt dell'agente",+ "pt": "Prompt do agente",+ "es": "Prompt del agente",+ "ca": "Indicació de l'agent",+ "tr": "Ajan istemi",+ "uk": "Запит агента"+ },+ "RECOMMENDED_AUTOMATIONS$MODAL_EXAMPLE_IMPLEMENTATION": {+ "en": "Example implementation sketch",+ "ja": "実装例のたたき台",+ "zh-CN": "示例实现草图",+ "zh-TW": "範例實作草圖",+ "ko-KR": "예시 구현 초안",+ "no": "Eksempel på implementasjonsskisse",+ "ar": "مخطط تنفيذ نموذجي",+ "de": "Beispielhafte Implementierungsskizze",+ "fr": "Esquisse d’implémentation exemple",+ "it": "Schema di implementazione di esempio",+ "pt": "Esboço de implementação de exemplo",+ "es": "Boceto de implementación de ejemplo",+ "ca": "Esbós d'implementació d'exemple",+ "tr": "Örnek uygulama taslağı",+ "uk": "Приклад ескізу реалізації"+ },+ "RECOMMENDED_AUTOMATIONS$MODAL_REQUIRED_MCPS": {+ "en": "Required MCPs",+ "ja": "必須 MCP",+ "zh-CN": "必需的 MCP",+ "zh-TW": "必要的 MCP",+ "ko-KR": "필수 MCP",+ "no": "Påkrevde MCP-er",+ "ar": "واجهات MCP المطلوبة",+ "de": "Erforderliche MCPs",+ "fr": "MCP requis",+ "it": "MCP richiesti",+ "pt": "MCPs obrigatórios",+ "es": "MCP requeridos",+ "ca": "MCP obligatoris",+ "tr": "Gerekli MCP'ler",+ "uk": "Обов’язкові MCP"+ },+ "RECOMMENDED_AUTOMATIONS$MODAL_REQUIRED_MCPS_DESCRIPTION": {+ "en": "Connect every MCP below, then OpenHands will launch a conversation with the prompt on the left.",+ "ja": "下のすべての MCP を接続すると、OpenHands が左側のプロンプトで会話を開始します。",+ "zh-CN": "连接下面的每个 MCP 后,OpenHands 将使用左侧的提示启动对话。",+ "zh-TW": "連接下方每個 MCP 後,OpenHands 會使用左側的提示啟動對話。",+ "ko-KR": "아래의 모든 MCP를 연결하면 OpenHands가 왼쪽의 프롬프트로 대화를 시작합니다.",+ "no": "Koble til alle MCP-ene nedenfor, så starter OpenHands en samtale med instruksen til venstre.",+ "ar": "صِل كل MCP أدناه، ثم سيبدأ OpenHands محادثة باستخدام المطالبة الموجودة على اليسار.",+ "de": "Verbinde alle unten aufgeführten MCPs, dann startet OpenHands eine Unterhaltung mit dem Prompt links.",+ "fr": "Connectez chaque MCP ci-dessous, puis OpenHands lancera une conversation avec l’invite à gauche.",+ "it": "Collega ogni MCP qui sotto; poi OpenHands avvierà una conversazione con il prompt a sinistra.",+ "pt": "Conecte cada MCP abaixo e o OpenHands iniciará uma conversa com o prompt à esquerda.",+ "es": "Conecta todos los MCP siguientes y OpenHands iniciará una conversación con el prompt de la izquierda.",+ "ca": "Connecta tots els MCP següents i OpenHands iniciarà una conversa amb la indicació de l'esquerra.",+ "tr": "Aşağıdaki her MCP'yi bağlayın; ardından OpenHands soldaki istemle bir konuşma başlatır.",+ "uk": "Підключіть усі MCP нижче, після чого OpenHands запустить розмову із запитом ліворуч."+ },+ "RECOMMENDED_AUTOMATIONS$MODAL_CLOSE_ARIA": {+ "en": "Close recommended automation setup",+ "ja": "おすすめ自動化のセットアップを閉じる",+ "zh-CN": "关闭推荐自动化设置",+ "zh-TW": "關閉推薦自動化設定",+ "ko-KR": "추천 자동화 설정 닫기",+ "no": "Lukk oppsett for anbefalt automatisering",+ "ar": "إغلاق إعداد الأتمتة الموصى بها",+ "de": "Einrichtung der empfohlenen Automatisierung schließen",+ "fr": "Fermer la configuration de l’automatisation recommandée",+ "it": "Chiudi la configurazione dell'automazione consigliata",+ "pt": "Fechar configuração da automação recomendada",+ "es": "Cerrar configuración de automatización recomendada",+ "ca": "Tanca la configuració de l'automatització recomanada",+ "tr": "Önerilen otomasyon kurulumunu kapat",+ "uk": "Закрити налаштування рекомендованої автоматизації"+ },+ "RECOMMENDED_AUTOMATIONS$ADD_MCP": {+ "en": "Add {{name}}",+ "ja": "{{name}} を追加",+ "zh-CN": "添加 {{name}}",+ "zh-TW": "新增 {{name}}",+ "ko-KR": "{{name}} 추가",+ "no": "Legg til {{name}}",+ "ar": "إضافة {{name}}",+ "de": "{{name}} hinzufügen",+ "fr": "Ajouter {{name}}",+ "it": "Aggiungi {{name}}",+ "pt": "Adicionar {{name}}",+ "es": "Añadir {{name}}",+ "ca": "Afegeix {{name}}",+ "tr": "{{name}} ekle",+ "uk": "Додати {{name}}"+ },+ "RECOMMENDED_AUTOMATIONS$CONNECTED": {+ "en": "Connected",+ "ja": "接続済み",+ "zh-CN": "已连接",+ "zh-TW": "已連接",+ "ko-KR": "연결됨",+ "no": "Tilkoblet",+ "ar": "متصل",+ "de": "Verbunden",+ "fr": "Connecté",+ "it": "Connesso",+ "pt": "Conectado",+ "es": "Conectado",+ "ca": "Connectat",+ "tr": "Bağlandı",+ "uk": "Підключено"+ },+ "RECOMMENDED_AUTOMATIONS$NEEDS_SETUP": {+ "en": "Needs setup",+ "ja": "セットアップが必要",+ "zh-CN": "需要设置",+ "zh-TW": "需要設定",+ "ko-KR": "설정 필요",+ "no": "Krever oppsett",+ "ar": "يحتاج إلى إعداد",+ "de": "Einrichtung erforderlich",+ "fr": "Configuration requise",+ "it": "Configurazione richiesta",+ "pt": "Requer configuração",+ "es": "Requiere configuración",+ "ca": "Requereix configuració",+ "tr": "Kurulum gerekiyor",+ "uk": "Потрібне налаштування"+ },+ "RECOMMENDED_AUTOMATIONS$LAUNCHING": {+ "en": "Launching…",+ "ja": "起動中…",+ "zh-CN": "正在启动…",+ "zh-TW": "正在啟動…",+ "ko-KR": "시작 중…",+ "no": "Starter…",+ "ar": "جارٍ التشغيل…",+ "de": "Wird gestartet…",+ "fr": "Lancement…",+ "it": "Avvio in corso…",+ "pt": "Iniciando…",+ "es": "Iniciando…",+ "ca": "S'està iniciant…",+ "tr": "Başlatılıyor…",+ "uk": "Запуск…"+ },+ "RECOMMENDED_AUTOMATIONS$LAUNCH_CONVERSATION": {+ "en": "Launch conversation",+ "ja": "会話を開始",+ "zh-CN": "启动对话",+ "zh-TW": "啟動對話",+ "ko-KR": "대화 시작",+ "no": "Start samtale",+ "ar": "بدء المحادثة",+ "de": "Unterhaltung starten",+ "fr": "Lancer la conversation",+ "it": "Avvia conversazione",+ "pt": "Iniciar conversa",+ "es": "Iniciar conversación",+ "ca": "Inicia la conversa",+ "tr": "Konuşmayı başlat",+ "uk": "Запустити розмову"+ },+ "RECOMMENDED_AUTOMATIONS$REQUIRED_REMAINING": {+ "en": "{{count}} required MCPs remaining.",+ "ja": "残りの必須 MCP: {{count}} 件。",+ "zh-CN": "还剩 {{count}} 个必需的 MCP。",+ "zh-TW": "還剩 {{count}} 個必要的 MCP。",+ "ko-KR": "남은 필수 MCP {{count}}개.",+ "no": "{{count}} påkrevde MCP-er gjenstår.",+ "ar": "يتبقى {{count}} من MCP المطلوبة.",+ "de": "{{count}} erforderliche MCPs verbleiben.",+ "fr": "{{count}} MCP requis restants.",+ "it": "Restano {{count}} MCP richiesti.",+ "pt": "Restam {{count}} MCPs obrigatórios.",+ "es": "Quedan {{count}} MCP requeridos.",+ "ca": "Queden {{count}} MCP obligatoris.",+ "tr": "{{count}} gerekli MCP kaldı.",+ "uk": "Залишилося обов’язкових MCP: {{count}}."+ },"BACKEND$NAME_REQUIRED": {"en": "Name is required","ja": "名前は必須です",diff --git a/src/routes/automations-list.tsx b/src/routes/automations-list.tsxindex e03f6dbae5..6baee83253 100644--- a/src/routes/automations-list.tsx+++ b/src/routes/automations-list.tsx@@ -17,6 +17,7 @@ import { BackendNotConfigured } from "#/components/features/automations/backend-import { DeleteConfirmationModal } from "#/components/features/automations/delete-confirmation-modal";import { EditAutomationModal } from "#/components/features/automations/detail/edit-automation-modal";import { CreateInstructions } from "#/components/features/automations/create-instructions";+import { RecommendedAutomationsLauncher } from "#/components/features/automations/recommended-automations-launcher";import type { Automation } from "#/types/automation";const PAGE_SIZE = 50;@@ -207,6 +208,10 @@ export default function AutomationsList() {)}</div>+ <div className="mt-6">+ <RecommendedAutomationsLauncher query={searchQuery} />+ </div>+{/* Delete confirmation modal */}<DeleteConfirmationModalautomationName={deleteTarget?.name ?? ""}diff --git a/src/routes/mcp.tsx b/src/routes/mcp.tsxindex 9cbf475da2..53e689dd03 100644--- a/src/routes/mcp.tsx+++ b/src/routes/mcp.tsx@@ -20,9 +20,12 @@ import {findInstalledMatch,installedServerMatchesQuery,} from "#/utils/mcp-marketplace-utils";-import { MCP_MARKETPLACE, MarketplaceEntry } from "#/constants/mcp-marketplace";-import { MCPConfig } from "#/types/settings";+import {+ MCP_CATALOG as MCP_MARKETPLACE,+ type McpCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/mcps";import { MCPServerConfig } from "#/types/mcp-server";+import { flattenMcpConfig } from "#/utils/mcp-installed-servers";import {InstalledServersSection,MarketplaceSearch,@@ -31,48 +34,15 @@ import {CustomServerEditor,} from "#/components/features/mcp-page";-function flattenMcpConfig(config: MCPConfig): MCPServerConfig[] {- return [- ...config.sse_servers.map((server, index) => ({- id: `sse-${index}`,- type: "sse" as const,- url: typeof server === "string" ? server : server.url,- api_key: typeof server === "object" ? server.api_key : undefined,- })),- ...config.stdio_servers.map((server, index) => ({- id: `stdio-${index}`,- type: "stdio" as const,- name: server.name,- command: server.command,- args: server.args,- env: server.env,- })),- ...config.shttp_servers.map((server, index) => ({- id: `shttp-${index}`,- type: "shttp" as const,- url: typeof server === "string" ? server : server.url,- api_key: typeof server === "object" ? server.api_key : undefined,- timeout: typeof server === "object" ? server.timeout : undefined,- })),- ];-}-// ACP guard: the ACP sub-agent owns its own MCP server configuration —-// the SDK explicitly rejects ``mcp_config`` on ACPAgent init-// (``acp_agent.py:845``) and ``agent-server-adapter`` already strips-// it from start payloads. The Settings → Agent page is where the user-// configures the ACP server, so bouncing there is consistent with how-// ``/settings`` and ``/settings/condenser`` already behave under ACP.+// the SDK explicitly rejects `mcp_config` on ACPAgent init, and+// `agent-server-adapter` already strips it from start payloads. The+// Settings → Agent page is where the user configures the ACP server, so+// bouncing there is consistent with how `/settings` and+// `/settings/condenser` already behave under ACP.//-// Declared with no parameters (rather than typed as-// ``Route.ClientLoaderArgs``) so the lib build doesn't pull the-// generated ``./+types/mcp`` types out of ``rootDir``. The lib's-// ``tsconfig.lib.json`` reaches this file via the-// ``components/settings/index.ts`` re-export → ``routes/mcp-settings`` →-// ``routes/mcp`` chain; importing the React Router-generated type-// breaks ``rootDir: "src"`` because the types live under-// ``.react-router/types``. ``index-redirect`` and-// ``mcp-settings-redirect`` use the same no-args pattern.+// Declared with no parameters (rather than typed as Route.ClientLoaderArgs)+// so the lib build doesn't pull generated React Router types out of rootDir.export const clientLoader = async () => redirectIfAcpActive();export default function MCPPage() {diff --git a/src/utils/conversation-local-storage.ts b/src/utils/conversation-local-storage.tsindex 8a1b3f5305..fd9106d500 100644--- a/src/utils/conversation-local-storage.ts+++ b/src/utils/conversation-local-storage.ts@@ -7,6 +7,7 @@ import type { ViewMode } from "#/components/features/files-tab/view-mode";export const LOCAL_STORAGE_KEYS = {CONVERSATION_STATE: "conversation-state",+ PENDING_TASK_DRAFT: "pending-task-draft",} as const;const CONVERSATION_STATE_UPDATED_EVENT = "conversation-state-updated";@@ -200,6 +201,37 @@ export function setConversationState(}}+function getPendingTaskDraftKey(taskId: string): string {+ return `${LOCAL_STORAGE_KEYS.PENDING_TASK_DRAFT}-${taskId}`;+}++export function setPendingTaskDraft(+ taskId: string | null | undefined,+ draftMessage: string,+): void {+ if (!taskId) return;+ try {+ localStorage.setItem(getPendingTaskDraftKey(taskId), draftMessage);+ } catch (err) {+ console.warn("Failed to store pending task draft", err);+ }+}++export function consumePendingTaskDraft(+ taskId: string | null | undefined,+): string | null {+ if (!taskId) return null;+ try {+ const key = getPendingTaskDraftKey(taskId);+ const draft = localStorage.getItem(key);+ localStorage.removeItem(key);+ return draft;+ } catch (err) {+ console.warn("Failed to consume pending task draft", err);+ return null;+ }+}+export function clearConversationLocalStorage(conversationId: string) {try {const key = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;diff --git a/src/utils/mcp-installed-servers.ts b/src/utils/mcp-installed-servers.tsnew file mode 100644index 0000000000..403402b13d--- /dev/null+++ b/src/utils/mcp-installed-servers.ts@@ -0,0 +1,28 @@+import { MCPServerConfig } from "#/types/mcp-server";+import { MCPConfig } from "#/types/settings";++export function flattenMcpConfig(config: MCPConfig): MCPServerConfig[] {+ return [+ ...config.sse_servers.map((server, index) => ({+ id: `sse-${index}`,+ type: "sse" as const,+ url: typeof server === "string" ? server : server.url,+ api_key: typeof server === "object" ? server.api_key : undefined,+ })),+ ...config.stdio_servers.map((server, index) => ({+ id: `stdio-${index}`,+ type: "stdio" as const,+ name: server.name,+ command: server.command,+ args: server.args,+ env: server.env,+ })),+ ...config.shttp_servers.map((server, index) => ({+ id: `shttp-${index}`,+ type: "shttp" as const,+ url: typeof server === "string" ? server : server.url,+ api_key: typeof server === "object" ? server.api_key : undefined,+ timeout: typeof server === "object" ? server.timeout : undefined,+ })),+ ];+}diff --git a/src/utils/mcp-marketplace-utils.ts b/src/utils/mcp-marketplace-utils.tsindex 3274fddbf2..6913268c32 100644--- a/src/utils/mcp-marketplace-utils.ts+++ b/src/utils/mcp-marketplace-utils.ts@@ -1,8 +1,8 @@import { MCPServerConfig } from "#/types/mcp-server";-import {- MarketplaceEntry,+import type {+ McpCatalogEntry as MarketplaceEntry,MarketplaceTemplate,-} from "#/constants/mcp-marketplace";+} from "@openhands/extensions/mcps";const tryUrl = (raw: string): URL | null => {try {@@ -92,6 +92,26 @@ function normalize(query: string): string {* user-visible identity (name, description, id, keywords). Empty* queries always match.*/+export function getMarketplaceEntriesByPopularity(+ catalog: MarketplaceEntry[],+): MarketplaceEntry[] {+ return catalog+ .map((entry, index) => ({ entry, index }))+ .sort((a, b) => {+ const byPopularity =+ (b.entry.popularityRank ?? 0) - (a.entry.popularityRank ?? 0);+ return byPopularity || a.index - b.index;+ })+ .map(({ entry }) => entry);+}++export function getMarketplaceEntryById(+ id: string,+ catalog: MarketplaceEntry[],+): MarketplaceEntry | undefined {+ return catalog.find((entry) => entry.id === id);+}+export function marketplaceEntryMatchesQuery(entry: MarketplaceEntry,rawQuery: string,diff --git a/tests/e2e/snapshots/mcp-page.snapshot.spec.ts b/tests/e2e/snapshots/mcp-page.snapshot.spec.tsindex bc39a23821..eb0f2d62be 100644--- a/tests/e2e/snapshots/mcp-page.snapshot.spec.ts+++ b/tests/e2e/snapshots/mcp-page.snapshot.spec.ts@@ -4,7 +4,7 @@ import { seedLocalStorage } from "./support/seed-local-storage";/*** Visual snapshot tests for the MCP page (/mcp).*- * The MCP marketplace catalog is hardcoded in src/constants/mcp-marketplace.ts,+ * The MCP marketplace catalog is imported from @openhands/extensions/mcps,* so it never requires an API call. Installed servers are read from* settings.agent_settings.mcp_config (SDK format: { mcpServers: { ... } }).*