Skip to content

Running FastAPI-MCP remotely #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quantotto opened this issue May 13, 2025 · 0 comments · May be fixed by #141
Open

Running FastAPI-MCP remotely #136

quantotto opened this issue May 13, 2025 · 0 comments · May be fixed by #141
Labels
enhancement New feature or request

Comments

@quantotto
Copy link

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!

@quantotto quantotto added the enhancement New feature or request label May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant