-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(mcp): handle tools/list_changed notifications #5913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mcp): handle tools/list_changed notifications #5913
Conversation
|
/review |
|
okay cool, ty! I appreciate u looking into mcp support have a few other prs to merge in too so we can be more up to date w spec |
|
lgtm |
|
Take your time! The refresh is working now. |
|
ill take a look at this tonight, will test but at a glance it lgtm |
30943fc to
6b0746b
Compare
Subscribe to MCP server notifications for tool list changes and publish events to the internal bus. This allows consumers to refresh their tool cache when servers dynamically add, remove, or modify tools.
6b0746b to
850af90
Compare
|
Okay so this publishes an event but what's the purpose? Just opencode sdk stuff? Or just tryign to make sure we both understand what this will do |
|
The IDE (the client) listen to the notification and follow the spec. If you install the mcp with cargo and mount it.
Previously you had to stop the session and reset opencode respawrn the new tools. I wrote a small Article, currently Charm and VScode support the spec. If this PR get merged opencode will too. The MCP i shared is just a linter and you can install it from source. |
a3c5381 to
4f1fb32
Compare
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Summary
notifications/tools/list_changedfrom MCP serversmcp.tools.list_changedevent to the internal bus when receivedContext
MCP servers can dynamically add, remove, or modify tools at runtime. The official SDK provides
ToolListChangedNotificationSchemafor clients to subscribe to these changes, but opencode wasn't utilizing it.Test plan
cargo install dictator(the tool will swap the tools once initalized from 1 -> 3 )mcp.tools.list_changedevent is published to the bus