-
Notifications
You must be signed in to change notification settings - Fork 5
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: @gensx/mcp #358
base: main
Are you sure you want to change the base?
feat: @gensx/mcp #358
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bb1a85f
to
fd1c65e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that was required to make this work that I'm not super stoked about: Needed to add an onComplete to the Provider interface, so that we can perform tasks after the children of a provider have full resolved. This is necessary for us to close the connection (aka shutdown) the MCP server once that part of the workflow has finished.
Can we handle the lifecycle via node.js process hooks? This thing is a singleton across the node process, so can we just add a process.on(exit, ...)
handler? (maybe other hooks/handler we need to attach to as well...).
c4b77ea
to
e4d4a6c
Compare
@EvanBoyle I tidied this up, but opted to keep the |
e4d4a6c
to
5c3df97
Compare
580ee28
to
4206ada
Compare
4206ada
to
978d6b1
Compare
Proposed changes
Add a new package,
@gensx/mcp
, that enables the creation of MCP contexts with a provider and auseContext
helper. This provider manages the lifecycle of the server (spinning it up and shutting it down).One thing that was required to make this work that I'm not super stoked about: Needed to add an
onComplete
to theProvider
interface, so that we can perform tasks after the children of a provider have full resolved. This is necessary for us to close the connection (aka shutdown) the MCP server once that part of the workflow has finished.