Support for path convertor {value:path} in FastMCP #220
Copy link
Copy link
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Description
Currently we do not allow for matching paths in resource templates, meaning that
@app.resource("test://{foo}")
will not match test://foo/bar. This is intended. However at times people want to explicitly match paths. FastAPI offers in this case a path convertor, such that
@app.resource("test://{foo:path}")
would match test://foo/bar.
We should consider adding a convertor approach or something similar to resource templates.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Activity
beaterblank commentedon Oct 7, 2025
Hello, I'd like to work on this issue.
FastAPI uses starlette converters for this, like here: https://github.com/Kludex/starlette/blob/main/starlette/convertors.py
will implement something similar.
Feature Added:
beaterblank commentedon Oct 7, 2025
Hello, I've addressed this in the pull request above.
The URI matching logic now supports multiple parameter types, not just
{foo : path}, but also{foo : int},{foo : float},{foo : str}and{foo : uuid}. (defaults to{foo : str})The design is also easily extensible to support additional types in the future.
Please review it.
Thank you!
fernando-torres-blip-ai commentedon Dec 29, 2025
Any updates on this ?
beaterblank commentedon Dec 29, 2025
please check #1439