π OpenHands: AI-Driven Development
chore: clean up MCP catalog assumptions (#657)
Engel Nyst5edf3f7f8fe6
diff --git a/AGENTS.md b/AGENTS.mdindex 9d6d0cf684..cfd4e688af 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -401,7 +401,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 data and MCP logo mappings live in `@openhands/extensions/mcps`; the Slack catalog entry there should point at `https://github.com/zencoderai/slack-mcp-server` and use `@zencoderai/slack-mcp-server`. Deprecated marketplace entries removed upstream (for example GitLab / Google Maps / Postgres / Puppeteer / SQLite) should disappear from the marketplace grid, but existing installed servers with those names must still render in the Installed section and stay searchable/editable/deletable via the raw server `name` / `command` fallback in `src/utils/mcp-marketplace-utils.ts` + `InstalledServerCard`. Tavily is a regular stdio MCP entry (`tavily-mcp` + `TAVILY_API_KEY`), not a special built-in sentinel anymore. 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`; the Slack catalog entry there should point at `https://github.com/zencoderai/slack-mcp-server` and use `@zencoderai/slack-mcp-server`. Deprecated marketplace entries removed upstream (for example GitLab / Google Maps / Postgres / Puppeteer / SQLite) should disappear from the marketplace grid. The Installed section still needs to render and search arbitrary non-catalog custom servers via the raw server `name` / `command` fallback in `src/utils/mcp-marketplace-utils.ts` + `InstalledServerCard`. Tavily is a regular stdio MCP entry (`tavily-mcp` + `TAVILY_API_KEY`), not a special built-in sentinel anymore. 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__/routes/mcp-page.test.tsx b/__tests__/routes/mcp-page.test.tsxindex 3587ea2ca9..73f8f5f66b 100644--- a/__tests__/routes/mcp-page.test.tsx+++ b/__tests__/routes/mcp-page.test.tsx@@ -111,16 +111,16 @@ describe("MCPPage", () => {).not.toBeInTheDocument();});- it("keeps installed legacy servers visible even after their marketplace entries are removed", async () => {+ it("keeps installed custom servers visible and searchable even when they are not in the marketplace catalog", async () => {vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings({agent_settings: {...MOCK_DEFAULT_USER_SETTINGS.agent_settings,mcp_config: {mcpServers: {- gitlab: {+ acme_internal: {command: "npx",- args: ["-y", "@modelcontextprotocol/server-gitlab"],+ args: ["-y", "@acme/internal-mcp-server"],},},},@@ -131,16 +131,16 @@ describe("MCPPage", () => {renderPage();await screen.findByTestId("mcp-installed-list");- expect(screen.getByText("gitlab")).toBeInTheDocument();+ expect(screen.getByText("acme_internal")).toBeInTheDocument();expect(- screen.queryByTestId("mcp-marketplace-card-gitlab"),+ screen.queryByTestId("mcp-marketplace-card-acme_internal"),).not.toBeInTheDocument();const search = screen.getByTestId("mcp-search-input");- fireEvent.change(search, { target: { value: "gitlab" } });+ fireEvent.change(search, { target: { value: "internal-mcp-server" } });await waitFor(() => {- expect(screen.getByText("gitlab")).toBeInTheDocument();+ expect(screen.getByText("acme_internal")).toBeInTheDocument();});expect(screen.getByTestId("mcp-marketplace-empty")).toBeInTheDocument();});diff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsxindex ac64b5b02e..8df395d3a4 100644--- a/src/components/features/mcp-page/custom-server-editor.tsx+++ b/src/components/features/mcp-page/custom-server-editor.tsx@@ -17,9 +17,9 @@ interface CustomServerEditorProps {}/**- * Modal wrapper around the legacy `MCPServerForm` so power users can- * still hand-author arbitrary stdio / SSE / SHTTP entries without- * reaching for raw JSON. An empty `server.id` means "Add new".+ * Modal wrapper around `MCPServerForm` so users can hand-author+ * arbitrary stdio / SSE / SHTTP entries without reaching for raw JSON.+ * An empty `server.id` means "Add new".*/export function CustomServerEditor({server,diff --git a/src/routes/mcp.tsx b/src/routes/mcp.tsxindex 53e689dd03..a337ff9223 100644--- a/src/routes/mcp.tsx+++ b/src/routes/mcp.tsx@@ -179,9 +179,8 @@ export default function MCPPage() {/>)}- {/* Custom (or non-marketplace) server editor β falls back to the- legacy MCPServerForm for full control. The empty-id sentinel- (`{ id: "", type: "sse" }`) means "add new". */}+ {/* Custom (or non-marketplace) server editor. The empty-id+ sentinel (`{ id: "", type: "sse" }`) means "add new". */}{editingServer && (<CustomServerEditorserver={editingServer}