Skip to content

feat: Agent as mcp in chatagent #2272

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 9 commits into
base: master
Choose a base branch
from

Conversation

MuggleJinx
Copy link
Collaborator

Description

Implement to_mcp in chatAgent.

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@MuggleJinx
Copy link
Collaborator Author

MuggleJinx commented Apr 24, 2025

@lightaime, Hi Guohao, this is the draft PR I extend #2144, add the to_mcp method in ChatAgent module. It can work finally, but I found this approach is not good (at least for my current implementation), because

  1. It contains whole python scripts in string format, it will be warm bed for bugs since it is very hard to maintain, and static tool checks cannot work,
  2. It needs to create the python code of creating agent from run time, to determine what's the current model, platform, api_key etc. It's not so straightforward and it's hard to do it runtime... for example you need to know where the agent stores the api_key, and it's not directly exposed..
  3. User would have less control or hard to customize of the whole scripts since it's generated at runtime, such as loggings, prints, etc.

What do you think? Any better approach to do this? Personally I would still prefer the easy and straightforward approach in #2144.

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.

1 participant