[PR #127] [CLOSED] feat: Add create_app function #180

Closed
opened 2026-10-18 21:12:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/mcpo/pull/127
Author: @billben-net
Created: 5/10/2025
Status: ❌ Closed

Base: dev ← Head: binchick-in/add_create_app_function


📝 Commits (2)

📊 Changes

1 file changed (+14 additions, -4 deletions)

View changed files

📝 src/mcpo/main.py (+14 -4)

📄 Description

Changelog Entry

Description

This change refactors the FastAPI application construction logic out of the run function in mcpo/main.py into a new public function, create_app. The new create_app function encapsulates all logic for building and configuring the main FastAPI app and any sub-apps, making the codebase more modular, testable, and reusable. The run function now simply calls create_app to obtain the app instance and passes it to Uvicorn for serving.

Added

  • create_app function

Moved the code that creates the FastAPI instance to its own function so that it may be used elsewhere outside the context of MCPO.

Additional Information

I would like to utilize the proxy functionality in my own monolith application, being able to just return the FastAPI will allow me to mount it to my own FastAPI parent app.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/mcpo/pull/127 **Author:** [@billben-net](https://github.com/billben-net) **Created:** 5/10/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `binchick-in/add_create_app_function` --- ### 📝 Commits (2) - [`e37d0eb`](https://github.com/open-webui/mcpo/commit/e37d0ebd27934378364f534bd8ee6ae82a370536) Merge pull request #108 from open-webui/dev - [`cc8cc67`](https://github.com/open-webui/mcpo/commit/cc8cc674c3bffa99b11ddc2489ee664e07b46f5d) Add create_app function ### 📊 Changes **1 file changed** (+14 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/mcpo/main.py` (+14 -4) </details> ### 📄 Description # Changelog Entry ## Description This change refactors the FastAPI application construction logic out of the `run` function in `mcpo/main.py` into a new public function, `create_app`. The new `create_app` function encapsulates all logic for building and configuring the main FastAPI app and any sub-apps, making the codebase more modular, testable, and reusable. The `run` function now simply calls `create_app` to obtain the app instance and passes it to Uvicorn for serving. ## Added - `create_app` function Moved the code that creates the FastAPI instance to its own function so that it may be used elsewhere outside the context of MCPO. ## Additional Information I would like to utilize the proxy functionality in my own monolith application, being able to just return the FastAPI will allow me to mount it to my own FastAPI parent app. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:12:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#180
No description provided.