Skip to content

Conversation

@ww-jermaine
Copy link

@ww-jermaine ww-jermaine commented May 19, 2025

Feature: Add support for fetching OpenAPI schema from a remote FastAPI server

Describe your changes

  • Added a fetch_openapi_from_remote flag to FastApiMCP.
  • When enabled and a custom http_client is provided, the MCP server will fetch the OpenAPI schema from /openapi.json on the remote FastAPI server instead of generating it locally.
  • Falls back to local OpenAPI generation if the remote fetch fails.
  • Added a test (test_remote_openapi.py) to verify this feature.

Issue ticket number and link (if applicable)

Closes #136

Screenshots of the feature / bugfix

N/A (feature is backend, but see test for usage example)


Checklist before requesting a review

  • Added relevant tests (test_remote_openapi.py)
  • Run ruff (no lint errors)
  • Run mypy (type errors are only due to missing stubs for external/test dependencies, not this feature)
  • All tests pass (feature test passes, global coverage is a separate project-wide issue)
ww-jermaine and others added 4 commits May 19, 2025 11:22
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant