Skip to content

Running FastAPI-MCP remotely #136

Open
@quantotto

Description

@quantotto

Is your feature request related to a problem? Please describe.

I would like to run MCP server separately (on a different machine or inside a dedicated docker container) from Fast API.

Describe the solution you'd like

Ability to configure FastAPIMCP to point to a remote Fast API. While a custom httpx.AsyncClient can be provided to FastApiMCP, it is not enough because FastApiMCP.setup_server creates openapi_schema locally and doesn't try to retrieve openapi.json from remote FastAPI using the provided AsyncClient object.

Describe alternatives you've considered

I have a workaround where I patch get_openapi with ,y own implementation and it all works. It would be nice to allow retrieval of the openapi spec from remote API (if http_client was provided) without any patching.

Additional context

Here is my current implementation / workaround:

https://gist.github.com/quantotto/637169d26e2268456296ebc9ed54a304

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions