Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bassilkhilo-ag2
Copy link
Contributor

@bassilkhilo-ag2 bassilkhilo-ag2 commented Aug 12, 2025

Why are these changes needed?
The FastMCP class in newer versions no longer accepts a title keyword argument.
This was causing a TypeError in MCPProxy.get_mcp when trying to initialize FastMCP.
This change updates the call to use name= instead, which matches the current constructor signature,
allowing MCP clients to initialize without error.

Related issue number
Closes #
(No existing issue found — discovered during local testing.)

Checks

I've reviewed whether any doc changes are needed for https://docs.ag2.ai/. (No doc changes required.)

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2025

CLA assistant check
All committers have signed the CLA.

@qingyun-wu
Copy link
Collaborator

Does this require us to specify the version of the fastmcp package it is depending on?

@qingyun-wu
Copy link
Collaborator

@bassilkhilo-ag2
Copy link
Contributor Author

No pin needed. I updated get_mcp to be version-agnostic: it tries FastMCP(name=...) and on TypeError falls back to FastMCP(title=...).

This keeps compatibility with both newer mcp releases (where the ctor uses name) and older ones (that used title).

If you’d still prefer a lower bound, I can add mcp ≥ the first release with name, but the current patch works without changing dependencies.

@bassilkhilo-ag2
Copy link
Contributor Author

Updated get_mcp to only use name= after discussing with @marklysze. Change has been committed and pushed.

Copy link
Collaborator

@marklysze marklysze left a comment

Choose a reason for hiding this comment

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

Thanks @bassilkhilo-ag2, that attribute aligns with MCP's FastMCP implementation with our minimum version of the package, so looks good to me.

@marklysze marklysze added this pull request to the merge queue Aug 12, 2025
Merged via the queue into ag2ai:main with commit 7d8ee67 Aug 12, 2025
12 checks passed
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
autogen/mcp/mcp_proxy/mcp_proxy.py 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
autogen/mcp/mcp_proxy/mcp_proxy.py 22.85% <0.00%> (ø)

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants