Skip to content

Resource-template query values include URI fragments #5129

Closed

Description

@Harsh23Kashyap

Resource-template query parameters include the URI fragment in their value. I expected fragments to stay separate from the query, as they do in standard URI parsing.

from fastmcp.resources.template import match_uri_template

print(
    match_uri_template(
        "test://items?filter=active#section",
        "test://items{?filter}",
    )
)

This prints:

{"filter": "active#section"}

Expected:

{"filter": "active"}

Version: FastMCP 4.0.4, Python 3.12.13, Linux.

Activity

  1. added
    bug
    server
    on Sep 16, 2026
  2. ege-arhan commented on Sep 20, 2026

    @ege-arhan

    Would you mind assigning this to me? I have a fix ready in #5133.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugserver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions