# Plugin distribution and sharing Status: partly built. The catalog source, the build, the Apps tab of the Marketplace, install and uninstall, the public pages and the deep link exist. The served catalog does not: steps 3 to 5 of [Order of work](#8-order-of-work) are open. This document records the decisions. The catalog has no GitHub plugin. The built-in GitHub connector is the GitHub app, in Marketplace › Apps. An MCP row that the retired plugin saved stays, and the Marketplace shows it as a server that the user added. While that row is named `github`, it hides the connector's MCP server from agents (`src/backend/agent/mcp-gateway.ts`), so the user must remove it. ## Why this document exists The marketplace modal had a Plugins tab with a catalog list and a detail page (`MarketplacePluginDetail.tsx`, now the Apps tab and the app page in `packages/ui/src/features/marketplace/`). The tab had an agent picker beside `Install plugin`, and a `Copy link` button. When this document was written, all of it read story fixtures. Two things are not decided: - where the list of available plugins comes from; - what a shared plugin link opens. `Copy link` also copies `https://openbot.app/plugins/`. That host does not exist. The canonical site is `https://openbot.run` (`packages/contracts/src/invite-links.ts`). This document answers three questions: 1. How does the catalog of available plugins get to the app? 2. What does a shared plugin link open, in the browser and in the app? 3. What does "Install plugin" do, when an MCP server is host-global and a skill is per agent? ## Decisions already made | Decision | Value | | --- | --- | | Catalog source | A static catalog on `openbot.run`. The app gets it and keeps a copy. | | Not used | The Worker and D1 route that the skills and agents marketplaces use. | | Submissions | Out of scope in this round. A plugin is added in the repository. | | Install target | The app (the MCP server) is host-global. The skills go to the agent whose chat is open, else to the first agent. | | Scope | Catalog delivery and the public share link. | `projection_mcp_servers` does not change. No migration is necessary for this work. ## 1. What a plugin is A plugin is one developer's bundle. It contains: - one **app**: an MCP server; - the **skills** that tell an agent how to use that app; - the listing text: name, tagline, description, example prompts, icon, category, version, and the developer's website, privacy policy and terms links. The types in `packages/ui/src/features/settings/marketplace-plugins.ts` are the start shape. `@openbot/ui` owns them today, and the renderer imports them from there. They are not in `packages/contracts`. ## 2. Catalog delivery ### 2.1 Source in the repository The source mirrors `marketplace/production-catalog/`, which the skills catalog already uses: ``` marketplace/plugin-catalog/ README.md catalog.json # the order of the slugs, and the featured flags plugins//plugin.json # listing text, links, prompts, the app, the skill pins plugins//icon.svg plugins//creator.png # optional ``` ### 2.2 What the app gets The Account Worker (`apps/auth-api`) serves the catalog from its own bundle. The catalog is public, so requests do not use a session token. | URL | Content | Cache-Control | | --- | --- | --- | | `https://openbot.run/plugins/catalog.json` | The index: one summary for each plugin, with `detailSha256` | `public, max-age=300, stale-while-revalidate=3600, stale-if-error=86400`, and a strong `ETag` | | `https://openbot.run/plugins//.json` | One detail: prompts, apps, skills, links | `public, max-age=31536000, immutable` | | `https://openbot.run/plugins/assets/..` | Icons and avatars | `public, max-age=31536000, immutable` | The version is in the detail path and the content hash is in the asset name. Thus `immutable` is correct: a change to the content gives a different URL. Each file has a `schemaVersion`. The index also has a `catalogVersion`, which always increases. If the `schemaVersion` is higher than the app knows, the app ignores the whole file and shows "Update OpenBot to see the newest plugins." The app must not read a part of a file it does not know. ### 2.3 The detail shape The detail gives the shape of the MCP server. It never gives a secret value. ```jsonc { "schemaVersion": 1, "slug": "linear", "version": "1.4.0", "prompts": [{ "id": "p1", "text": "What is assigned to me this week?" }], "apps": [ { "id": "linear-mcp", "name": "linear", "description": "Linear's MCP server.", "server": { "transport": "http", "url": "https://mcp.linear.app/mcp", "auth": [ { "id": "api-key", "kind": "key", "label": "API key", "docsUrl": "https://linear.app/settings/api", "fields": [ { "id": "token", "label": "Linear API key", "header": "Authorization", "prefix": "Bearer " } ] } ] } } ], "skills": [ { "id": "skill-linear-triage", "versionId": "skill-linear-triage-3-8f14e45f", "slug": "linear-triage", "description": "Triage and update Linear issues." } ] } ``` `auth` lists the ways into the server, as `McpConnectFlow[]` in `packages/contracts/src/mcp-connect-flows.ts` declares them: a `"link"` flow signs in through the browser, a `"key"` flow names each field and where its value goes, and a `"local"` flow lists the steps that turn on a server that another app runs on this computer. Only a `"local"` flow can use a plain `http` address, and only on a loopback host. It is the only flow of its server. The user types the value in the existing MCP server form. A secret is never in a public file, in a log, or in an export. The skills are pins into the skills marketplace. They are `marketplace_skills` identifiers and version identifiers. Thus the install reuses `installVersion` in `src/main/skill-marketplace-service.ts`. The catalog carries no bundle bytes. ### 2.4 How the catalog is published A new `scripts/build-plugin-catalog.ts` reads `marketplace/plugin-catalog/`. It follows `scripts/build-production-catalog.ts`. It hashes the icons and the details, and it writes: - a generated module in `apps/auth-api`, which the routes import. The module is committed; - the offline snapshot in `resources/plugin-catalog/`. The existing `scripts/deploy-auth-api.ts` then ships the catalog with the Worker. There is no D1 step, no R2 step and no admin token. This is the reason for the static route. The build script refuses: | Condition | Reason | | --- | --- | | A value that looks like a secret | A public file must hold no secret. | | `workingDirectory` in a server | ACP drops a server that has one (`src/backend/mcp-provider-shapes.ts`). | | A name in `RESERVED_MCP_SERVER_NAMES` | The machine keeps those names. | | A config that `mcpConfigErrors(normalizeMcpConfig(config))` rejects | The catalog must not describe a server that the settings form refuses. | | A skill `versionId` that is not published | The install would fail for all users. | | More than one app in a plugin | Version 1 keeps the install simple. The array stays for later. | A `--check` mode fails when the generated module is not the same as a fresh build. No CI job runs it now, so CI does not stop a hand-edited generated file. Publish order: publish the skills first with `scripts/publish-production-catalog.ts`, then deploy the Worker. The build script tests that each pinned skill version exists. ### 2.5 Integrity Two controls protect the catalog: - HTTPS to `openbot.run`, which is a Cloudflare custom domain; - `detailSha256` in the index. The main process compares the hash after each detail download. This is the control that `src/main/skill-marketplace-service.ts` already uses for a skill bundle (`sha256(bundle) === detail.bundleSha256`). There is **no signature**. The party that holds a signing key would also be the party that deploys the Worker that serves the file. Thus a signature would protect against nothing new. Add a signature only if the catalog moves to a host that OpenBot does not control. ### 2.6 Fetch and cache in the app A new `src/main/plugin-catalog-service.ts` owns this. `src/main/application-services.ts` builds it. It does not use `CentralAuthManager`, because the browse path must work when the user is not signed in. | Item | Decision | | --- | --- | | Cache file | `userData/plugin-catalog.json`, written to a temporary file and then renamed. It holds the `ETag`, `fetchedAt`, the index, and the last 100 details. | | No new table | The catalog is a remote cache. The database is the source of truth, not a cache. A migration is irreversible, and a cache file can be deleted and built again. | | Freshness | `If-None-Match` with the stored `ETag`. A soft limit of 6 hours. A timeout of 10 seconds. | | Refresh | On the first list after the app starts, on a list when the copy is old, and when the user asks. There is no background timer. | | Details | Read when the user opens a listing. The hash is checked. A wrong hash is a hard failure. | | First run offline | The snapshot in `resources/plugin-catalog/` ships with the app through `extraResources` in `electron-builder.yml`. The app uses the newer of the snapshot and the cache, by `catalogVersion`. | | Logs | Status codes and `catalogVersion` only. Never a response body. | The renderer shows three failure states: - stale: "Showing the catalog from