Sypha AI Docs
Mcp

MCP Marketplace Changes

Sypha-specific changes to the MCP Marketplace rendering and installation flow.

MCP Marketplace: Rendering and Installation (Sypha changes)

Marketplace rendering flow

  • Data source: src/services/mcp/MarketplaceDataService.ts retrieves catalog JSON from S3 at https://sypha-mcp-images.s3.us-east-1.amazonaws.com/mcp-marketplace.json.
  • Caching: Implements in-memory cache (cachedCatalog, lastFetchTime) featuring a 5-minute timeout for network call reduction.
  • Parsing and normalization:
    • Accommodates either an array ([{...}]) or an object containing items ({ items: [...] }).
    • When the response is a string, it normalizes frequent JSON problems:
      • Adds quotes to unquoted logoUrl values while maintaining separators (comma/brace).
      • Eliminates trailing commas.
      • Removes double commas.
      • Adds missing commas between object boundaries (}{ -> },{).
    • Comprehensive logging for raw/cleaned data and post-parse structure facilitates debugging.
  • Output: Produces a McpMarketplaceCatalog containing items for UI layer rendering of MCP entries (name, author, description, icon, tags, etc.).

Installation flow

  • Server selection: Upon user selection of an MCP from the marketplace, the controller invokes downloadMcp() in src/core/controller/mcp/downloadMcp.ts.
  • Details fetch: downloadMcp() utilizes MarketplaceDataService.getInstance().getMcpById(mcpId) to acquire metadata (GitHub URL, README, etc.).
  • Validation: Confirms presence of githubUrl and readmeContent.
  • Task orchestration:
    • Constructs a guided task for MCP installation, incorporating README and llmsInstallationContent.
    • References sypha_mcp_settings.json for installation/configuration details.
    • Transitions to "act" mode when necessary, initializes the task, and launches the chat view to execute installation procedures.
  • Response: Delivers a McpDownloadResponse (or a structured error upon failure).

Changes implemented

src/services/mcp/MarketplaceDataService.ts

  • JSON parsing hardening:
    • Corrected unquoted logoUrl values without compromising JSON separators by maintaining the subsequent comma/brace.
    • Preserved safe cleanups (eliminate trailing commas, correct double commas, add commas between objects).
  • Flexible format support: Processes both array root and { items: [...] } structures; consistently returns { items }.
  • Caching + timeouts: 10s request timeout; 5-minute cache duration.
  • Diagnostics: Enhanced console logs for raw responses, cleaned content, type verification, item tallies.

src/core/controller/mcp/downloadMcp.ts

  • Marketplace integration: Extracts MCP metadata from MarketplaceDataService replacing the previous external API.
  • Settings filename: Installation task text modified to reference sypha_mcp_settings.json.

Follow-ups

  • UI text alignment: Modify any UI references still mentioning sypha_mcp_settings.json (e.g., webview-ui/src/components/mcp/configuration/tabs/add-server/AddLocalServerForm.tsx) to sypha_mcp_settings.json for consistency maintenance.

On this page