fix: replace _tool_manager with local_provider for FastMCP 3.x tool-filter compat#396
Open
sdeonvacation wants to merge 2 commits intotirth8205:mainfrom
Open
fix: replace _tool_manager with local_provider for FastMCP 3.x tool-filter compat#396sdeonvacation wants to merge 2 commits intotirth8205:mainfrom
sdeonvacation wants to merge 2 commits intotirth8205:mainfrom
Conversation
Keep only the semantic FastMCP 3.x compatibility edits: - main.py: enumerate tools via mcp.local_provider._components instead of _tool_manager._tools - main.py: remove via mcp.local_provider.remove_tool() instead of mcp.remove_tool() - tests/test_main.py: fixture snapshot/restore via local_provider._components - tests/test_main.py: sync _tool_names() helper replacing async get_tools() path - tests/test_main.py: docstring update to local_provider.remove_tool() Reverts: one-arg-per-line call reflows, blank line near asyncio import, set-literal reformat, extra blank line before class, EOF whitespace churn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
FastMCP 3.x removed
_tool_managerfrom theFastMCPinstance. Code-review-graph usedmcp._tool_managerto enumerate and filter tools viaCRG_TOOLS, causing anAttributeErrorstartup crash on FastMCP ≥ 3.0.Fix
Switch the tool-filter implementation to use
mcp.local_provider:mcp.local_provider._components(keys prefixedtool:)mcp.local_provider.remove_tool(name)This is API-stable in FastMCP 3.x and fully backwards-compatible with the existing
CRG_TOOLSenv-var contract.Testing
Updated
tests/test_main.pyto patchlocal_providerinstead of_tool_manager.Related
Split from PR #394 (
fix/get-minimal-context-async) to keep concerns separate.