Show server version in logs and UI

This commit is contained in:
Brandon Zhang
2026-03-27 18:16:30 +08:00
parent 8d4392ee5a
commit 7a8dd14bd3
11 changed files with 34 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ from fastapi.staticfiles import StaticFiles
from app.api import routes_config, routes_instructions, routes_status
from app.api.auth import TokenAuthMiddleware
from app.config import settings
from app.config import APP_VERSION, settings
from app.database import init_db
from app.logging_setup import configure_logging
from app.mcp_server import mcp, mcp_asgi_app
@@ -37,11 +37,12 @@ logger = logging.getLogger(__name__)
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup
logger.info("local-mcp starting up initialising database …")
logger.info("local-mcp v%s starting up initialising database …", APP_VERSION)
init_db(settings.db_path)
await instruction_service.init_wakeup()
logger.info(
"local-mcp ready http://%s:%d | MCP http://%s:%d/mcp (stateless=%s)",
"local-mcp v%s ready http://%s:%d | MCP http://%s:%d/mcp (stateless=%s)",
APP_VERSION,
settings.host, settings.http_port,
settings.host, settings.http_port,
settings.mcp_stateless,
@@ -57,7 +58,7 @@ def create_app() -> FastAPI:
app = FastAPI(
title="local-mcp",
description="Localhost MCP server with instruction queue management UI",
version="1.0.0",
version=APP_VERSION,
lifespan=lifespan,
)