Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MCP prompts/list failure wipes the cached prompt list and announces it as empty

Open Beginner friendly
#50,918 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
devtools

Research direction

The bug is in packages/core/src/mcp/index.ts around lines 305-312, where refreshPrompts handles a failed prompts/list call. Compare with refreshTools above it. The failing test is in packages/core/test/mcp.test.ts using the resourceServer fixture. Run the test to see the failure, then modify the Effect.orElseSucceed logic to preserve the existing prompts on error, similar to refreshTools.

Written by the indexing model from the issue text.

Description

Description

refreshPrompts turns a failed prompts/list into an empty list and then commits it: Effect.orElseSucceed(() => []) at packages/core/src/mcp/index.ts:307, and the Effect.map below it assigns entry.prompts from that empty result before publishing PromptsChanged (:305-312). refreshTools directly above (:298-303) has no such swallow, so a failed tools refresh leaves the registered tools alone. The two listings behave differently on the same failure.

So one transient error on a server that is still connected wipes its prompts, and the event that follows tells every reader the list is now legitimately empty — packages/core/src/plugin/command.ts:18-24 reacts to PromptsChanged by re-reading mcp.prompts() and calling ctx.command.reload(). The server's slash commands disappear and nothing indicates why: servers() still reports status: "connected".

Plugins

None.

OpenCode version

v2 at 681ea07a9.

Steps to reproduce

Using the resourceServer fixture in packages/core/test/mcp.test.ts, with prompts capability advertising listChanged and a responder that answers prompts/list with a JSON-RPC error once armed:

  1. Connect; the initial listing succeeds and service.prompts() contains greet.
  2. The server sends prompts/list_changed; the client re-lists and the server answers with the error.
  3. service.prompts() is now [], while service.servers() still reports { status: "connected" }.

Expected: the failed refresh keeps the prompts it already had, as refreshTools does. The regression test in the PR fails on 681ea07a9 with prompts were [] and passes with the one-line change.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
9h 42m
Merged PRs (30d)
389

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.