--- name: add-mcp-from-catalog description: Add a reviewed MCP Catalogue server to an explicit AICP project through the Speakeasy AI Control Plane Platform MCP. --- # Add an MCP from the catalog If this connection lists `call_platform_tool` instead of the tools this workflow names, find each named tool with `search_platform_tools`, describe it with `describe_platform_tool`, then run it with `call_platform_tool` and the same arguments. Whether a tool exists for you is decided by `describe_platform_tool` with its exact name, not by `tools/list` or one page of search results: a name returned in `not_found` is unavailable to you, so say so rather than guess. The call itself still checks your access. When `execute` is also listed, a multi-step read may run in `execute` with `tools.search`, `tools.describe` and `tools.call` on `platform--` paths. End each `execute` run at a confirmation point and ask the user before any write. Use this workflow only through the authenticated Speakeasy AI Control Plane (AICP) Platform MCP. It follows the same guarded outcome a user would complete manually in the AICP dashboard: select a reviewed MCP, configure it for an explicit project, finish secure setup, and verify readiness. The package itself grants no organization access. If the user instead supplies a remote MCP URL outside the reviewed catalogue, use the `add-mcp-from-remote-url` workflow. ## Safety rules - Never ask the user to paste API keys, passwords, access or refresh tokens, OAuth codes, client secrets, secret headers, or MCP credentials into chat. - Never ask the user to supply an MCP endpoint. Use the server-owned catalog candidate and registration workflow. - Show non-secret provider and setup URLs only when a Platform MCP tool returns them. - Keep the chosen project and catalog candidate explicit. Do not infer either from a previous conversation or silently substitute another target. - Registration is private and does not distribute or publish the MCP. The person who added it can use it once it is ready; sharing it through a plugin is optional. - Use `send_platform_mcp_feedback` only after asking for consent, and never include identifiers, URLs, credentials, payloads, headers, logs, or attachments. ## Workflow 1. Call `list_projects` to verify that the Platform MCP is authenticated and obtain the eligible projects. If authenticated discovery is unavailable, stop and follow the `platform-sign-in` workflow to sign this client in; do not claim that installation succeeded. 2. Call `search_mcp_catalog`. Present the eligible projects and reviewed candidates, then ask the user to choose one exact candidate and one exact project. Only when `create_project` is in your tool list may you also offer a new project if no listed project fits, or none exists yet; do not create it yet. A managed project assistant has no `create_project` tool and always registers in its own project, so never offer it there. 3. Call `inspect_mcp_candidate` for the selected candidate. Explain the bounded change and collect only the non-secret configuration fields declared by that result. 4. If the user chose a new project and still wants this candidate after inspection, agree the project's exact name and choose one idempotency key for this create; pass that same key on the preview and on the confirmed call. Call `create_project` with that name, that key, and `confirmed: false` to preview it: nothing is created, and the `confirmation_required` result returns the exact slug the project would get. Do not work the slug out yourself. Show that slug to the user as the project's permanent address in dashboard links; it does not change on rename. After the user confirms the name and slug, call `create_project` again with the same name, the same key, and `confirmed: true`. Use the project it returns; it starts empty. Use a fresh key only for a new attempt after a refusal. A `conflict` refusal means a project already holds that slug and nothing was created: offer that existing project or a different name. Creating a project needs organization administrator access; if it is refused, say so rather than choosing another project. Then, after explicit confirmation of the exact project, candidate, and configuration, call `register_catalog_mcp` with the exact selected project, reviewed candidate, declared non-secret configuration, and a fresh idempotency key. Keep the `mcp_id` it returns: that is the added server's ID, and every later step names the server by it. Do not distribute it. When the result has `already_registered: true`, the MCP was already in that project and nothing new was added: tell the user it was already there, that its existing configuration is unchanged and the values just confirmed were not applied, and continue with its readiness and setup. 5. Call `get_mcp_readiness` with the returned project and `mcp_id` to inspect persisted readiness. For a connected external Platform MCP client, a newly registered MCP is checked once on this first read. Only when it comes back unchecked (`readiness_unavailable`, freshness `unavailable`) because that check was refused or failed, call `get_mcp_readiness` once with `force: true`; it shares the forced-check limit, so if that returns `rate_limited`, wait at least a minute before forcing again. An unchecked result is not a reason to stop. 6. Route secure setup from the exact readiness evidence: - For `upstream_identity_provider_not_configured`, when registration returned a `sign_in_url`, present that exact URL as a clickable link and wait for the user to sign in there: it sets up sign-in for an organization admin and takes them to the provider, and it is the same link as the card's Connect button. If the page reports an error, or the person opening it is not an organization admin, present the `dashboard_setup_url` instead. Without one, explain that AICP can attach the one authorization server discovered from the persisted reviewed MCP source. Ask for explicit confirmation, then call `attach_platform_mcp_identity_provider`, present its exact Inspect authorization URL, and wait for the user to use Connect or Authorize. - For `upstream_authorization_required`, call `attach_platform_mcp_identity_provider` again with confirmation to retrieve the current server-issued Inspect authorization URL. Present that exact clickable URL and wait for the user to use Connect or Authorize. - For `identity_chaining_configured`, the organization's identity provider is configured to supply this server's access, which it does on the user's first call through the server; this is not provider evidence yet, so do not report it as ready. Ask the user to make one call through the server: when `get_my_mcp_connection_status` is in your tool list, call it with the `mcp_id` registration returned and give the user its `connection_url`. Then call `get_mcp_readiness` again (`force: true` for a connected external client): once that call has obtained access it reports `ready` with evidence `identity_chaining_active`. Fall back to the `upstream_authorization_required` route only if the user asks to connect manually or their call fails. If the chained call fails and `get_xaa_readiness` is in your tool list, call it with the same `project_slug` and the `mcp_id` registration returned as `mcp_server_id`, and report its `identity_chaining` binding state and remediation, and its `federated_callback_url` when sign-in through the identity provider is what failed. - For any other secure dashboard setup result, present only its exact server-returned setup URL. The user completes OAuth or secret entry outside the agent. Never request the resulting code, token, or secret in chat. 7. After the user completes any secure handoff, branch by caller surface: - For a connected external Platform MCP client, call `get_mcp_readiness` with `force: true`. Do not rely on stale or inferred readiness. If it returns `rate_limited`, do not retry the forced probe: call `get_mcp_readiness` without `force`, report the last stored readiness, and wait at least a minute before forcing again. - For a managed project assistant, call `get_mcp_readiness` without `force` and report only the persisted actor-scoped evidence. A forced provider probe stays with connected external clients; identity-provider attachment does not. 8. When readiness is current and ready, report the server-returned evidence. Setup is complete. Ask the user how they want to use it. The person who added it needs no plugin. To use it from their own MCP client, when `get_my_organization_gateway` is in your tool list, call it. When it returns `available: true`, give the user its `url`, the Organization Gateway that reaches every server they can use; otherwise report its `unavailable_reason` and relay its `next_action` as written. To install it in another app, first call `get_mcp_client_admission` for the same project and `mcp_id` and keep the result for step 9; when its mode is `presets` (known clients only), warn the user that sign-in is refused unless that app is one of the server's known clients, which the result does not list, so never claim the app is admitted. Then call `get_my_install_instructions` with the selected project, the `mcp_id` setup returned, and the app as `client_family`; show each step's link as a clickable link and each snippet verbatim. A managed project assistant has neither path: tell the user the server is ready for them in their own MCP client. 9. Unless step 8 already read it, call `get_mcp_client_admission` for the same project and `mcp_id`. Report the mode it returns together with the custom client ID metadata URLs it lists, which together decide which MCP clients may authorize against this server. Change it only when the user asks: explain what the proposed mode admits and refuses, ask for explicit confirmation, then call `set_mcp_client_admission` with that exact mode and `confirmed: true`. Known clients (`presets`) refuses an unlisted client at authorization with no fallback, so confirm the user accepts that before selecting it. Custom client ID metadata URLs are still added from the MCP server's Authentication settings in the AICP dashboard. 10. Only when the user wants other people to have this MCP, share it through a plugin. Do not make this a required step, and stop here when they only want it for themselves. Call `list_plugins` for the selected project and follow `next_cursor` until it is absent, so every plugin is in hand; then present the plugins and ask the user which one should carry this MCP. Do not choose for them and do not assume the default plugin. Only when `create_plugin` is in your tool list may you offer a new plugin if no listed plugin fits. A managed project assistant has no `create_plugin` tool, so never offer or call it there: if no listed plugin fits, ask the user to create the plugin in the AICP dashboard or from an external MCP client, then call `list_plugins` again and continue with the plugin they created. If the user wants a new plugin and `create_plugin` is available, agree its name (and a slug only if they want to choose one), choose one idempotency key for this create, and call `create_plugin` for the selected project with that key and `confirmed: false`. Nothing is created and no receipt is stored; the `confirmation_required` refusal carries the exact `slug` the plugin would get. Show the user that slug as the plugin's permanent install name, which does not change on rename; never work a slug out yourself. Say that in the organization's default project a new plugin reaches every member, while elsewhere it reaches no one until people are assigned to it. After they confirm the name and slug, call `create_plugin` again with the same name, slug and description, the same idempotency key, and `confirmed: true`, and use the plugin it returns. If it refuses with `slug_taken`, another plugin already holds that slug: call `list_plugins` again, then ask whether to use that existing plugin or create one with a different slug, and preview and confirm the new slug as a new create, with a fresh idempotency key used for both its calls. If it refuses with `idempotency_key_reused`, the key was already spent on a different request: repeat the original request exactly with its original key, and use a new key only for a request the user has newly confirmed. If it refuses with `feature_unavailable`, creating a plugin is not available on this server: report that, stop creating, and do not retry or substitute another plugin. Instead ask the user to create the plugin in the AICP dashboard or from an external MCP client, then call `list_plugins` again and continue with the plugin they created. Never treat any of these refusals as having created a plugin. 11. After the user names a plugin, state its complete audience back to the user as `list_plugins` reports it (everyone, or the roles and people assigned) and get explicit confirmation of that reach. When client admission is `presets`, say in the same breath that recipients whose MCP client is not one of the server's known clients are refused at sign-in, so do not imply every recipient can use it. Then call `distribute_mcp_to_plugin` with that exact plugin. Pass the server as the `mcp_id` setup returned. Never pass the ID of a different server, even one added earlier in the same chat. A name matching nothing is refused as `not_found` and a name matching more than one as `ambiguous_target`; an `mcp_not_found` refusal means that ID is not a server added through setup in that project, so call `find_mcp` again rather than guessing. A `not_ready` refusal names the server in `mcp_server`; report it and return to its readiness check. Report the refusal and ask again rather than retrying with a different plugin, creating a plugin the user did not ask for, or distributing to another project. On success, report `message`, which says whether the package reached people yet. When `awaiting_manual_sync` is true, the plugin's auto sync is off: the server is in the plugin, but people get it only after the project is synced by hand, so never say they already have it. Only in that waiting case, offer `republish_plugin` on an external Platform MCP client for that project. Call it first with `project_slug` set to the selected project's slug, `plugin` set to the exact plugin selected for distribution, a new caller-generated `idempotency_key`, and `confirmed: false`: nothing is published, and its `confirmation_required` answer says what to show the user, that it republishes every plugin in the project. After the user explicitly confirms that, call it again with the same inputs, the same `idempotency_key`, and `confirmed: true`; reuse that key only to retry the same request. A managed project assistant cannot call it, so point the user to Sync changes in the AICP dashboard instead. OAuth consent and approved secret entry are the expected out-of-agent stops. Project and catalog selection and identity-provider attachment confirmation stay in the conversation. Sharing through a plugin is the only optional stage.