Skip to content

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

@MikeBai523

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions