-
Notifications
You must be signed in to change notification settings - Fork 27
break: dramatically simplify interface, add tool name prefixes #38
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
Conversation
* | ||
* @default true | ||
*/ | ||
prefixToolNameWithServerName?: boolean; |
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.
should this be opt-in? not sure if i want this if i have only one server
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.
there was also a discussion on this briefly in py langchain-ai/langchain-mcp-adapters#18
it's probably good to add this as an option!
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.
yeah, good point - I was mostly just following the convention that I saw in claude code (it always prefixes MCP tools this way by default)
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.
Made this default to opt-in rather than opt-out.
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.
So actually, I think this should default to opt-in for direct use of loadMcpTools
and opt-out for MultiServerMcpClient
, as the latter case is more likely to benefit from differentiation of tools by server namespace
Feedback, not criticism: It seems like every other tool takes an mcp.json config, and they're all the same format. Whether or not it is stored in a .json file doesn't matter to me, but being able to go to a tool like smithery.ai and grab the json config so I don't have to try and infer the implementation details is going to open up the usability to a lot more developers. The new API does look much easier to grok. Coming in fresh to MCP the main hurdle at this point would be knowing what transport to use. Other tools don't seem to need to have it explicitly defined. Are there technical limitations preventing that, or just a matter of having the time? |
Massively appreciated feedback, @CuriouslyCory! I think you've touched on two important things here.
Based on this, I think a simple resolution to this feedback would be to get rid of the discriminator key in our I'll definitely take this opportunity to act on that - it's good feedback for sure! Please don't hesitate if you have more of it in the future - I wish we had a thousand more engaged users who would be this proactive! |
b278cdf
to
dbfbc34
Compare
Unfortunately there doesn't seem to be any authoritative source for the emerging config "standard." I did some experiments with the I'm also seeing some cases where the discriminator is required as |
dbfbc34
to
36c82d8
Compare
Description
Dramatically simplifies the interface of this library.
Removes features that should be implemented at the application level, like config file loading. The (now removed) default config file loading was especially problematic, as it's unexpected that a library like this would attempt to access the filesystem, especially on construction.
The former
connectToServerViaX
methods were especially confusing, as they were instance methods that would overwrite any existing connection config without closing, etc.Also includes related test clean-up, README and examples changes, and a few project config changes that bring this more in line with how packages in the langchainjs monorepo are managed/configured.
Type of change
How Has This Been Tested?
Via the included test suite.
Checklist: