Skip to content

fix(mothership): keep integration discovery working when a tagged mcp server fails or lists no tools - #9260

Open
waleedlatif1 wants to merge 1 commit into
stagingfrom
fix/mcp-discovery-resilience
Open

waleedlatif1 wants to merge 1 commit into
stagingfrom
fix/mcp-discovery-resilience

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • One broken /-tagged MCP server no longer breaks integration discovery for the whole chat. Tagged servers are discovered with Promise.all and a server with no tools throws, and the catalog includes MCP on every unfiltered request. So a deleted, disabled, down or reconnect-needed server, or one with no tools, failed every integrations list --query and search call for every integration, for the rest of the chat (tagging is sticky).
  • Each tagged server now settles on its own. Unfiltered and query results drop failed or empty servers and log them; a request that explicitly targets the server (mcp:<id> service, or one of its toolIds) still fails with that server's own error. Authorization is unchanged.
  • Removes stale Go-era leftovers: the "tools ride the tool array" comment, the defer_loading/executeLocally/params fields nothing reads, and two builders only tests referenced.

Type of Change

  • Bug fix

Testing

  • catalog.test.ts now exercises the real mcp-tools module. With deleted, failing, zero-tool and healthy tagged servers, unfiltered and query requests return native operations plus the healthy server's (these failed before with MCP server not found). Targeting each bad server still fails with its own error.
  • mcp-tools.test.ts: a failing or tool-less server is reported without discarding the others.
  • 270/270 in the affected vitest files; CI runs the rest.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

… server fails or lists no tools

buildTaggedMcpToolSchemas discovered tagged servers with Promise.all and threw
when a server listed no tools, and the integration catalog includes MCP on every
unfiltered request. One deleted, disabled, unreachable, truncated or tool-less
/-tagged server therefore failed every unfiltered integrations list, grep and
search_integration_tools call for the rest of the chat.

Discovery now settles per server and returns { tools, failures }. The catalog
drops failed servers from unfiltered and query results, logging each server id
and reason, and still throws that server's own error when the request targets it
(service mcp:<id>, or a tool id on it that no healthy server provides). The MCP
permission-group check still runs once up front and still throws.

Also removes the unread defer_loading/executeLocally/params fields on MCP
catalog operations, the test-only buildSelectedMcpToolSchemas and
buildOrganizationTaggedMcpToolSchemas with their tests and stale mocks, and
corrects the post.ts comment that said tagged MCP tools ride the tool array.
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 20, 2026 11:46pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/mothership/integrations/application/catalog.ts
@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Tagged MCP servers now fail independently, so one broken or empty server no longer removes healthy servers and native operations from broad discovery.

  • Tagged MCP discovery keeps healthy results when another server fails.
  • Unused MCP builders and their old test wiring are removed.

The PR description from waleedlatif1 explicitly keeps authorization unchanged.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Discover tagged servers] --> B[Settle each server separately]
  B --> C[Collect healthy tools]
  B --> D[Collect failed servers]
  D --> E{Request targets a failed server?}
  E -->|Yes| F[Throw that server's error]
  E -->|No| G[Log and omit failed servers]
  C --> H[Return matching operations]
  G --> H
Loading

Reviews (1) · Last reviewed commit: "fix(mothership): keep integration discov..." · Reviewed by Greptile

This branch was previously deployed

1 inactive deployment
Preview — ab652c94 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant