Skip to content

feat: upgrade fastmcp to v3#1749

Open
Copilot wants to merge 1 commit into
mainfrom
copilot/update-fastmcp-major-version
Open

feat: upgrade fastmcp to v3#1749
Copilot wants to merge 1 commit into
mainfrom
copilot/update-fastmcp-major-version

Conversation

Copy link
Copy Markdown

Copilot AI commented May 22, 2026

Summary

Updates the fastmcp dependency from v2 (>=2.13.0,<3) to v3 (>=3.0.0) and fixes the breaking API changes introduced in the major version bump.

Changes

Dependency update

  • pyproject.toml: Updated version constraint in both [project.optional-dependencies] and [dependency-groups] sections to fastmcp>=3.0.0.

Source code fixes (src/robocop/mcp/)

  • tools/documentation.py: _list_prompts_impl was using the private internal API mcp._prompt_manager._prompts which was removed in fastmcp v3. Replaced with the public await mcp.list_prompts() and made the function async.
  • tools/registration.py: Updated the list_prompts tool to await _list_prompts_impl(mcp) since it is now async.

Test fixes (tests/mcp/)

fastmcp v3 changed several method names and return types:

v2 API v3 API Notes
mcp.get_tools() mcp.list_tools() Returns list[Tool] instead of dict; use mcp.get_tool(name) for FunctionTool with .fn
mcp.get_resources() mcp.list_resources() Returns list[Resource] with .uri attribute
mcp.get_prompts() mcp.list_prompts() Returns list[Prompt]; use mcp.get_prompt(name) for FunctionPrompt with .fn
  • test_server.py: Updated to use list_tools(), list_resources(), list_prompts().
  • test_prompts.py: Updated fixture to use list_prompts() + get_prompt() to retrieve FunctionPrompt objects with .fn callable.
  • test_resources.py: Updated to use list_resources() and adjusted assertions for list-of-objects format.
  • test_integration.py: Updated fixture to use list_tools() + get_tool() to retrieve FunctionTool objects with .fn callable.
  • test_tools.py: Added asyncio import and updated calls to asyncio.run(_list_prompts_impl(mcp)) since the function is now async.

Copilot finished work on behalf of bhirsz May 22, 2026 13:14
Copilot AI requested a review from bhirsz May 22, 2026 13:14
@bhirsz bhirsz marked this pull request as ready for review May 22, 2026 13:16
@bhirsz bhirsz changed the title Upgrade fastmcp to v3 feat: upgrade fastmcp to v3 May 22, 2026
Copilot AI requested a review from bhirsz May 22, 2026 13:22
Copilot stopped work on behalf of bhirsz due to an error May 22, 2026 13:22
@bhirsz bhirsz force-pushed the copilot/update-fastmcp-major-version branch from c6cb805 to d9157aa Compare May 22, 2026 13:33
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.

2 participants