1
0

merge aigpt

This commit is contained in:
2025-06-02 18:24:43 +09:00
parent 6dbe630b9d
commit 6cd8014f80
16 changed files with 850 additions and 368 deletions

@@ -1,17 +1,24 @@
"""FastAPI application entry point"""
import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.core.config import settings
from app.routes import cards, auth, sync
from app.mcp_server import AICardMcpServer
# Create FastAPI app
app = FastAPI(
title=settings.app_name,
version=settings.app_version,
docs_url="/docs",
redoc_url="/redoc",
)
# Initialize MCP server
enable_mcp = os.getenv("ENABLE_MCP", "true").lower() == "true"
mcp_server = AICardMcpServer(enable_mcp=enable_mcp)
# Get FastAPI app from MCP server
app = mcp_server.get_app()
# Update app configuration
app.title = settings.app_name
app.version = settings.app_version
app.docs_url = "/docs"
app.redoc_url = "/redoc"
# CORS middleware
app.add_middleware(
@@ -41,7 +48,11 @@ async def root():
@app.get("/health")
async def health_check():
"""Health check endpoint"""
return {"status": "healthy"}
return {
"status": "healthy",
"mcp_enabled": enable_mcp,
"mcp_endpoint": "/mcp" if enable_mcp else None
}
if __name__ == "__main__":