Skip to content

Load MCP in parallel and cache MCP tools#1350

Closed
mpazik wants to merge 1 commit into
anomalyco:devfrom
mpazik:cache-mcp
Closed

Load MCP in parallel and cache MCP tools#1350
mpazik wants to merge 1 commit into
anomalyco:devfrom
mpazik:cache-mcp

Conversation

@mpazik

@mpazik mpazik commented Jul 27, 2025

Copy link
Copy Markdown

The remote MCP servers are painfully slow to load, especially since I am currently in China and coding over VPN.

I noticed that loading sequentially doesn't help. After conducting a few tests, I found that the initial client was the slowest.

Test Results

Config

  "mcp": {
    "context7": {
      "type": "remote",
      "url": "https://mcp.context7.com/sse"
    },
    "coin": {
      "type": "remote",
      "url": "https://mcp.api.coingecko.com/sse"
    },
    "fetch": {
      "type": "remote",
      "url": "https://remote.mcpservers.org/fetch/mcp"
    }
  }

Below are the results from my simple benchmark of three runs:

Original implementation:

  • Clients load: 8436ms - 12622ms
  • Tools load (per message): 1192ms - 1387ms

Parallel client and tool loading:

  • Clients load: 2437ms - 3412ms
  • Tools load (per message): 367ms - 569ms

After caching:

  • Clients and tools load together
  • No additional loading per message
  • Drawback: Need to restart opencode on MCP server changes but as it is API I assume it will change very infrequently.

@mpazik
mpazik marked this pull request as ready for review July 27, 2025 07:29
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Feb 2, 2026
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
* fix(app): remove more dead settings shell code

* fix(app): prune more dead helpers and props
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