Is there support for Notifications? #139
-
Hey 👋 I was working on writing an MCP server that dynamically creates Resources. After these Resources are created, I send a ResourceListChanged notification to let the client know that there are new Resources. I was testing this by using the It's probably possible that the UI just didn't update but I didn't see where this would be implemented in the code. I can also confirm that when I pressed Thanks for all the work on this project! Links: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
@PatOConnor43 Thank you. It is supposed to work without "r" refreshing. I remember testing it with puppeteer and stagehand where on taking a screenshot we get the new screenshots resources. I have pointed out locations where we handle these notifications both in In In mcphub.nvim plugin, we listen for resource list changed events here: mcphub.nvim/lua/mcphub/utils/handlers.lua Lines 65 to 83 in fec8c2d And update the state in mcphub.nvim/lua/mcphub/hub.lua Lines 794 to 828 in fec8c2d Ideally, this part should update the UI, mcphub.nvim/lua/mcphub/hub.lua Lines 824 to 827 in fec8c2d For debugging, you can add some Please let me know your findings. I suggest you also read contributing.md for more info on dev setup. Lines 62 to 80 in fec8c2d |
Beta Was this translation helpful? Give feedback.
-
Now that I think about it, would it help if we have a |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the info! Very helpful! After fixing a separate issue in my server, I have confirmed with logging in my server that
I believe that log is coming from this line: I'll have to take a closer look at this in the morning. Thanks!
It was pretty simple to just toggle the server off and on to run the built server with changes. I'll leave that up to you. |
Beta Was this translation helpful? Give feedback.
-
Short story: Good news! It works now 👍 Long story: I uninstalled mcp-hub and installed a local version to start debugging the issue. It turns out it works fine now. I believe I should have been on mcp-hub 3.2.0 but I don't see anything in your most recent release that would have fixed it. Something I did while getting the dev environment set up was kill the running mcp-hub instance so I could I installed 3.2.0 recently because I updated mcp-hub.nvim but now I'm wondering if I've had an older version of the server still running. I don't know what you do to determine when you need to restart mcp-hub if the npm package is updated. Regardless, thanks for the help debugging this! |
Beta Was this translation helpful? Give feedback.
@PatOConnor43 Thank you. It is supposed to work without "r" refreshing. I remember testing it with puppeteer and stagehand where on taking a screenshot we get the new screenshots resources. I have pointed out locations where we handle these notifications both in
mcp-hub
andmcphub.nvim
repos.In
mcp-hub
repo, we propagate notifications fromMCPConnection.js
toMCPHub.js
toserver.js
https://github.com/ravitemer/mcp-hub/blob/87e87598a982df18cb6e5d3a7bc8d866deaa86e7/src/MCPConnection.js#L239-L260
https://github.com/ravitemer/mcp-hub/blob/87e87598a982df18cb6e5d3a7bc8d866deaa86e7/src/MCPHub.js#L73-L77
https://github.com/ravitemer/mcp-hub/blob/87e87598a982df18cb6e5d3a7bc8d866deaa86e7/src/serve…