Skip to content

Conversation

@fredericbarthelet
Copy link
Contributor

@fredericbarthelet fredericbarthelet commented Jan 8, 2026

Fixes #203

Motivation and Context

Implement bi-directionality on UI termination.
Until now ui/resource-teardown was the only way for Host to initiate UI teardown.
This methods enable UI to initiate its own teardown

Items that might require discussion in this PR:

  • naming. Similarly to open-link, message, request-display-mode, the name of the request should be action-first/verb-first. Even if we implement a fire and forget pattern (see next point), I would not include notifications in the name. What do you think of ui/close-resource?
  • should this new ui/close-resource message implements a request/response pattern or a fire and forget type of pattern (where UI fires the event like it would fire a notification without ever expecting an answer). I'm leaning towards fire and forget because the host won't be able to send a response if it proceeds accordingly and does indeed terminates the UI
  • should we provide a way for the host to refuse terminating the UI or should all ui/close-resource requests be fulfilled? this can be achieved only if we go for a request/response pattern, so I'd not account for this scenario just yet

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@215

commit: 52fff75

@fredericbarthelet fredericbarthelet force-pushed the add-close-resource branch 3 times, most recently from 3d419b4 to df4c168 Compare January 8, 2026 13:38
@fredericbarthelet fredericbarthelet marked this pull request as ready for review January 8, 2026 13:57
@fredericbarthelet
Copy link
Contributor Author

Hey @liady @idosal
Would love to get your feedback on this first shot at ui/close-resource before going further and adding tests and examples.
Let me know what you think (I raised 3 main points in the PR description worth discussion IMHO) :)

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.

SEP: Add resource-close

1 participant