Skip to content

Conversation

threepointone
Copy link
Collaborator

Moved MCP server connection logic from the Agent's startup process to dedicated methods connectMCPServers and disconnectMCPServers. This improves code organization and allows explicit control over MCP server connections.

TODO: rewrite client demo //cc @cmsparks

Moved MCP server connection logic from the Agent's startup process to dedicated methods `connectMCPServers` and `disconnectMCPServers`. This improves code organization and allows explicit control over MCP server connections.
Copy link

changeset-bot bot commented May 29, 2025

🦋 Changeset detected

Latest commit: e96edda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Patch
hono-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@threepointone threepointone requested review from courtney-sims and cmsparks and removed request for courtney-sims May 29, 2025 16:19
Copy link
Collaborator

@cmsparks cmsparks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I can push up some changes changing the client demo to support this.

@threepointone
Copy link
Collaborator Author

ok cool, I'll wait to land this until you make the client demo changes

Copy link
Contributor

@courtney-sims courtney-sims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@threepointone
Copy link
Collaborator Author

sigh, this is going to be a serious breaking change, need a better way of messaging this before releasing...

@courtney-sims
Copy link
Contributor

What about a migration guide? We could link it in Discord.

@cmsparks cmsparks force-pushed the explicit-mcp-connect branch from 64fb3f4 to 258b4af Compare May 30, 2025 16:06
@cmsparks
Copy link
Collaborator

Yeah.. I guess if we're going to make a breaking change to this interface, is there any other MCP breaking changes we'd want to bundle in with this? I don't think there are, but probably a good thing to consider

@cmsparks
Copy link
Collaborator

Pushed some changes to:

  • update the client demo and swap to using RPC
  • fix state propogation for disconnection

Comment on lines 68 to 70
console.log("connecting!");
console.log(id);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, just removed

@cmsparks cmsparks force-pushed the explicit-mcp-connect branch from 258b4af to e96edda Compare June 2, 2025 16:58

@unstable_callable()
async connectServers() {
await this.connectMCPServers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any situation where a user might want to connect only one or some set of servers rather than all that have been added?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this and the answer is probably yes. But we could always add that as a option in the future

@threepointone
Copy link
Collaborator Author

ok I thought this through and spoke to some folks, and it'll just break too many existing users. Instead I'm just going to mark it as deprecated and add a new method or two. (maybe registerMCPAServer)

@threepointone threepointone marked this pull request as draft July 17, 2025 08:02
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.

3 participants