Skip to content

MCP server auto search and add to toolkit #562

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

ZiTao-Li
Copy link
Collaborator

@ZiTao-Li ZiTao-Li commented Mar 25, 2025


name: Pull Request
about: Create a pull request

Description

Add new methods in ServiceToolkit to automatically discover and add MCP servers.

  • The ServiceToolkit.search_new_tool requires a key functionality description (using keywords) as input. With the functionality keywords, The search_new_tool first searches via https://registry.npmjs.org/-/v1/search API for a list of related MCP servers.
  • The ServiceToolkit.get_mcp_server_config_template to obtain the MCP server configuration to guide the user or agent.
  • The ServiceToolkit.remove_auto_added_tool is for an agent to delete the auto-added server if there are errors (e.g., missing API keys or invalid arguments).

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@ZiTao-Li ZiTao-Li changed the title [WIP] MCP server auto search and add to toolkit MCP server auto search and add to toolkit Apr 1, 2025
@ZiTao-Li ZiTao-Li requested review from DavdGao and zhijianma April 1, 2025 07:56
Copy link
Collaborator

@rayrayraykk rayrayraykk left a comment

Choose a reason for hiding this comment

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

Great job, please see the inline comments for details.

Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

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

The implementation needs to be further discussed, and a configuration of the service toolkit maybe better. For example

toolkit = ServiceToolkit(
    mcp_search_allow=True, 
    mcp_search_model_config="xxx",
)

If mcp_search_allow is True, then we add the search function to the toolkit automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants