anomalyco / anomalyco/opencode
/ command list blocks on all MCP servers connecting (multi-second delay before file-based commands show up)
@kitlangton is already working on this.
Since Sep 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Problem
GET /command (the data source for the TUI / autocomplete) waits for every enabled MCP server to finish connecting before returning anything, because Command.init awaits mcp.prompts() alongside config/skill loading, and the MCP InstanceState init blocks on all servers settling (30s timeout each).
With a handful of MCP servers configured, the / menu lacks file-based commands and prompts for several seconds after startup, even though the commands themselves come from local files.
Numbers
Measured with opencode serve + time curl /command (9 MCP servers enabled, cold instance):
- as-is: 5.6s (slowest chain: an
npx-launched server + a heavy node CLI) - with all MCP disabled: 0.65s — file commands + 56 skills load entirely within this budget
So the file-based command listing itself is sub-second; the entire remaining delay is MCP connect waiting.
Expected
File-based commands should be available immediately; MCP prompts can join the list asynchronously once their servers connect (e.g. via an event that lets clients re-fetch).
One trade-off worth naming: a client that fetches /command exactly once without subscribing to events would miss MCP prompts from its first response during the connection window — fine for autocomplete, but it should be a stated decision rather than an accident.
Happy to send a PR if this direction sounds right — I have a working implementation with tests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.