Skip to content

Feature add support for fetching OpenAPI schema from a remote FastAPI server #141

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
wants to merge 1 commit into
base: main
Choose a base branch
from

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running FastAPI-MCP remotely
1 participant