update
This commit is contained in:
@@ -40,9 +40,7 @@ app = FastAPI(
|
||||
)
|
||||
|
||||
# Global settings and audit logger
|
||||
# Note: auth_validator is fetched dynamically in middleware to support test resets
|
||||
settings = get_settings()
|
||||
audit = get_audit_logger()
|
||||
# Note: access settings/audit logger dynamically to support test resets.
|
||||
|
||||
|
||||
# Tool dispatcher mapping
|
||||
@@ -115,6 +113,7 @@ async def authenticate_request(request: Request, call_next):
|
||||
@app.on_event("startup")
|
||||
async def startup_event() -> None:
|
||||
"""Initialize server on startup."""
|
||||
settings = get_settings()
|
||||
logger.info(f"Starting AegisGitea MCP Server on {settings.mcp_host}:{settings.mcp_port}")
|
||||
logger.info(f"Connected to Gitea instance: {settings.gitea_base_url}")
|
||||
logger.info(f"Audit logging enabled: {settings.audit_log_path}")
|
||||
@@ -180,6 +179,7 @@ async def call_tool(request: MCPToolCallRequest) -> JSONResponse:
|
||||
Returns:
|
||||
JSON response with tool execution result
|
||||
"""
|
||||
audit = get_audit_logger()
|
||||
correlation_id = request.correlation_id or audit.log_tool_invocation(
|
||||
tool_name=request.tool,
|
||||
params=request.arguments,
|
||||
@@ -312,6 +312,7 @@ async def sse_message_handler(request: Request) -> JSONResponse:
|
||||
JSON response acknowledging the message
|
||||
"""
|
||||
try:
|
||||
audit = get_audit_logger()
|
||||
body = await request.json()
|
||||
logger.info(f"Received MCP message via SSE POST: {body}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user