Skip to content

feat(mcp): support resource update notifications#31398

Open
rekram1-node wants to merge 1 commit into
devfrom
feat/mcp-resource-updated
Open

feat(mcp): support resource update notifications#31398
rekram1-node wants to merge 1 commit into
devfrom
feat/mcp-resource-updated

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

  • subscribe to MCP resources when they are read if the server advertises resources.subscribe
  • publish mcp.resource.updated events with the server name and updated URI
  • ignore notifications from disconnected or replaced clients and expose the event in generated SDK types

OpenCode does not cache MCP resource contents, so this intentionally does not add cache invalidation. Consumers can use the event to re-read the identified resource.

Tests

  • bun test test/mcp/lifecycle.test.ts --timeout 30000 (from packages/opencode)
  • bun typecheck (from packages/opencode)
  • ./packages/sdk/js/script/build.ts

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