Skip to content
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

AI SDK tool wrapper for MCP #3891

Open
wong2 opened this issue Nov 26, 2024 · 3 comments
Open

AI SDK tool wrapper for MCP #3891

wong2 opened this issue Nov 26, 2024 · 3 comments
Labels
ai/core enhancement New feature or request

Comments

@wong2
Copy link
Contributor

wong2 commented Nov 26, 2024

Feature Description

Today, Anthropic released the Model Context Protocol (MCP) https://modelcontextprotocol.io

Naturally, I think we should be able to turn them into a tool in the AI SDK for easier integration.

@wong2 wong2 added the enhancement New feature or request label Nov 26, 2024
@grabbou
Copy link

grabbou commented Nov 28, 2024

I am currently working on exposing my tool to MCP and I am using AI SDK tools. After I am done, I'll cross-link the snippet here. From what it appears, it should not be too hard!

@grabbou
Copy link

grabbou commented Dec 2, 2024

Here it is: https://github.com/callstackincubator/cali/blob/v0.3.1/packages/mcp-server/src/index.ts

Overall, very easy. Some edge cases yet, but it is looking good. I think I may eventually rewrite all my tools to MCP standard and write "toAISDKTool" helper instead.

@rockywangxiaolei
Copy link

Here it is: https://github.com/callstackincubator/cali/blob/v0.3.1/packages/mcp-server/src/index.ts

Overall, very easy. Some edge cases yet, but it is looking good. I think I may eventually rewrite all my tools to MCP standard and write "toAISDKTool" helper instead.
@grabbou cool, i went through your code and i saw you import all pre-defined tools in MCP-Server/index.ts,and revise them to a MCP-server request and response which follow the protocol.
but just curious, i didnt find any MCP-Client to call this MCP-server, is it not yet finished?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants