Skip to content

Why synchronous @mcp.tool definition is not supported for parallelism? #1646

Closed

Description

@MikeBai523

Question

In mcp.server.fastmcp.utilities.func_metadata.FuncMetadata.call_fn_with_arg_validation

if fn_is_async:
    return await fn(**arguments_parsed_dict)
else:
    return fn(**arguments_parsed_dict)

In FastMCP, if a tool is defined as a synchronous function, it will block the whole running loop instead of using to_thread().

May I know the consideration for it's different from FastAPI's concurrency model?

Additional Context

No response

Activity

  1. Kludex commented on Dec 3, 2025

    @Kludex
    Member

    This is a bug.

    It's not "FastAPI concurrency model".

  2. added
    bugSomething isn't working
    needs confirmationNeeds confirmation that the PR is actually required or needed.
    and removed
    questionFurther information is requested
    on Dec 9, 2025
  3. maxisbey commented on May 18, 2026

    @maxisbey
    Contributor

    Fixed on main (v2): #1909 routes sync @mcp.tool functions through anyio.to_thread.run_sync so they no longer block the event loop, and #2380 extends the same to sync resource and prompt handlers. Closing — if you need this backported to the v1.x line, please say so.

    AI Disclaimer

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

    bugSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions