mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
refactor: auto create mcp images folder if not exist
This commit is contained in:
+5
-1
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
import sqlbot_xpack
|
||||
from alembic.config import Config
|
||||
from fastapi import FastAPI
|
||||
@@ -56,7 +58,9 @@ app = FastAPI(
|
||||
|
||||
mcp_app = FastAPI()
|
||||
# mcp server, images path
|
||||
mcp_app.mount("/images", StaticFiles(directory=settings.MCP_IMAGE_PATH), name="images")
|
||||
images_path = settings.MCP_IMAGE_PATH
|
||||
os.makedirs(images_path, exist_ok=True)
|
||||
mcp_app.mount("/images", StaticFiles(directory=images_path), name="images")
|
||||
|
||||
mcp = FastApiMCP(
|
||||
app,
|
||||
|
||||
Reference in New Issue
Block a user