feat(app): FastAPI REST + WS + MCP HTTP transport

Implements build_app() with REST endpoints (/api/state, /api/games,
/api/settings, /api/new-game, /api/agent-binding), WebSocket /ws for
realtime events, and custom JSON-RPC MCP transport at /mcp/{side}
supporting initialize, tools/list, and tools/call with proper
content-wrapping and isError flag. Static UI mount guarded by
PUBLIC_DIR existence check. All 5 e2e tests pass.
This commit is contained in:
ai-chess
2026-05-14 23:18:57 +03:00
parent 4f096953d7
commit 83e2fb8765
3 changed files with 268 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from __future__ import annotations
import uvicorn
from ai_chess.app import build_app
from ai_chess.state import state
def main() -> None:
app = build_app(state)
uvicorn.run(app, host="127.0.0.1", port=7833, log_level="info")
if __name__ == "__main__":
main()