Upgrade FastMCP to patched 3.x and remove deprecated/vulnerable JWT auth path usage#294
Merged
Merged
Conversation
4 tasks
… warning Agent-Logs-Url: https://github.com/docToolchain/dacli/sessions/d4af1677-2bef-4bf7-8454-5421fe1a7398 Co-authored-by: rdmueller <1856308+rdmueller@users.noreply.github.com>
Agent-Logs-Url: https://github.com/docToolchain/dacli/sessions/d4af1677-2bef-4bf7-8454-5421fe1a7398 Co-authored-by: rdmueller <1856308+rdmueller@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate from deprecated authlib.jose to joserfc in fastmcp
Upgrade FastMCP to patched 3.x and remove deprecated/vulnerable JWT auth path usage
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the project to FastMCP 3.2.x (patched line) and updates the test suite to use FastMCP’s public tool lookup API, while bumping dacli’s version metadata.
Changes:
- Bump FastMCP dependency to
>=3.2.0,<4(lock to3.2.4) and refreshuv.lockfor new transitive deps. - Update MCP-related tests to replace private
_tool_manager._toolsintrospection withasyncio.run(mcp.get_tool(...)). - Add a regression test ensuring importing FastMCP’s JWT provider does not emit the
authlib.josedeprecation warning; bump project version to0.4.38.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks FastMCP 3.2.4 and updates transitive dependencies accordingly. |
pyproject.toml |
Updates declared dependency constraints (FastMCP 3.x; pydocket range) and bumps project version. |
src/dacli/__init__.py |
Bumps __version__ to 0.4.38. |
tests/test_project_setup.py |
Adds subprocess-based import test to guard against authlib.jose deprecation warning. |
tests/test_mcp_negative_params_220.py |
Uses mcp.get_tool(...) public API for tool retrieval in negative-param tests. |
tests/test_mcp_insert_blank_lines_232.py |
Migrates tool lookup to mcp.get_tool(...) for blank-line insertion tests. |
tests/test_mcp_insert_after_229.py |
Migrates tool lookup to mcp.get_tool(...) for insert-after behavior tests. |
tests/test_manipulation_bugs_244_245.py |
Updates helper to retrieve insert_content via mcp.get_tool(...). |
tests/test_get_dependencies_67.py |
Updates tool existence check to use mcp.get_tool(...). |
tests/test_elements_help_types_259.py |
Updates tool lookup to use mcp.get_tool(...) for docstring assertions. |
tests/test_circular_include_validation_251.py |
Updates validate tool lookup to use mcp.get_tool(...). |
Comments suppressed due to low confidence (1)
tests/test_mcp_insert_after_229.py:82
- This test calls
insert_tool.fn(...)without first asserting thatmcp.get_tool("insert_content")returned a tool. Add an explicit assertion/guard (consistent with the other test in this file) so failures are clearer if tool registration changes.
insert_tool = asyncio.run(mcp.get_tool("insert_content"))
# Insert after "Child Section" (no children)
result = insert_tool.fn(
path="test:parent-section.child-section",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
75
| insert_tool = asyncio.run(mcp.get_tool("insert_content")) | ||
|
|
||
| # Insert content after Section 1 | ||
| result = insert_tool.fn( |
| "fastmcp>=3.2.0,<4", | ||
| "pathspec>=1.0.3", | ||
| "pydocket<0.17", # Pin to avoid breaking change in 0.17 (fastmcp compatibility) | ||
| "pydocket>=0.17.2,<0.19", # Required by fastmcp 2.14.7 |
Comment on lines
+68
to
+69
| validate_tool = asyncio.run(mcp.get_tool("validate_structure")) | ||
| result = validate_tool.fn() |
Comment on lines
+86
to
+87
| validate_tool = asyncio.run(mcp.get_tool("validate_structure")) | ||
| result = validate_tool.fn() |
Comment on lines
+104
to
+105
| validate_tool = asyncio.run(mcp.get_tool("validate_structure")) | ||
| result = validate_tool.fn() |
Comment on lines
+119
to
+120
| validate_tool = asyncio.run(mcp.get_tool("validate_structure")) | ||
| result = validate_tool.fn() |
Comment on lines
+43
to
46
| insert_tool = asyncio.run(mcp.get_tool("insert_content")) | ||
|
|
||
| # Insert content before Section 2 | ||
| result = insert_tool.fn( |
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.
This PR resolves the
authlib.josedeprecation fallout and addresses newly reported FastMCP security advisories affecting<3.2.0. It moves the project to a patched FastMCP line while preserving MCP behavior and test coverage.Dependency/security updates
>=2.14.7,<3to>=3.2.0,<4(locked to3.2.4).0.4.38in package metadata.MCP test compatibility with FastMCP 3 API
mcp._tool_manager._tools) with FastMCP’s public async tool lookup API (mcp.get_tool(...)).Regression guard for deprecated auth path warning
authlib.josedeprecation warning.