MCP Grand Prix
MCP Grand Prix
LLM駆動型の3DレーシングゲームのMVPです。LLMエージェントが共有サーキット上でFormula 1カーを走らせ、ハイブリッドレースループ(戦略立案、物理シミュレーション、短いリアクティブな意思決定ウィンドウ)を経て進みます。その間、ブラウザの観戦クライアントがレースをライブで見守ります。
このプロジェクトは、ゲームの状態と戦略ツールをLLMエージェントに公開するMCPサーバーであり、加えてThree.jsの観戦ダッシュボードと、少数のスクリプト/LLMエージェント群から構成されます。
アーキテクチャ
┌────────────┐ MCP (SSE) ┌───────────────┐ tool calls ┌──────────────┐
│ LLM agents│ ────────────▶ │ src/mcp │ ◀───────────── │ RaceEngine │
│ (LLM or │ │ server.ts │ JSON-RPC │ (authoritative)
│ scripted) │ └───────────────┘ └──────┬───────┘
│ │ │ push
│ │ ┌───────────────┐ │ snapshot
│ │ │ src/server │◀─────────────┘
│ │ HTTP + WS (/ws) │ index.ts │
└────────────┘ ◀────────────────── │ spectator │
Browser spectator └───────────────┘
(Three.js, www/client.js)src/game/raceEngine.ts— サーバー権威型のゲームコア。すべてのゲーム状態を保持し、決定的かつ冪等なツールメソッド(startRace、submitPhaseStrategy、reactToEvent、step)を公開します。同じメソッドはMCP経由で実際のLLMにも提供され、プロセス内のスクリプトエージェントにも提供されるため、呼び出し元に関わらず挙動は同一です。src/mcp/server.ts— エンジンのツールをエージェントに公開するMCP(JSON-RPC/SSE)サーバー。src/game/raceRunner.ts— ハイブリッドレースループ(戦略 → シミュレーション → リアクティブウィンドウ)をティックごとに駆動します。src/server/— HTTP + WebSocketサーバーと観客向けフィード。www/— ブラウザ上の観戦クライアント(Three.js)。
Related MCP server: fastf1-mcp
レースループ
戦略フェーズ — 各ラップで、全エージェントが
StrategyPacket(タイヤコンパウンド、ドライブモード、燃料、任意のピットラップ)を提出します。シミュレーションフェーズ — エンジンはティックごとに物理演算を進めます。
リアクティブウィンドウ — トリガーイベント(接戦、セーフティカー、天候、タイヤの摩耗)がラップ途中の短いウィンドウを開き、関係するエージェントが(
push/save/pit_now/attack/defend)で応答します。
クイックスタート
npm install
npm run build # prebuild copies three.js into www/lib
npm start # serves the spectator app + MCP server観戦ダッシュボードを http://localhost:3000 で開き、レースを開始します:
curl -X POST http://localhost:3000/raceブラウザはWebSocket(/ws)で同じホスト/ポートに接続し、ライブ更新を受け取ります。
CLIからスクリプトレースを実行する
npm run agents # launches 4 scripted agents in a full race (demo)設定(環境変数)
変数 | デフォルト | 目的 |
|
| HTTP + 観戦用WebSocketポート |
|
| MCP JSON-RPC/SSEポート |
| — | HTTPポートのフォールバック( |
PORTはサーバーレスプラットフォームとの互換性のために使用されます(例:Vercel がPORTを設定します)。
スクリプト
スクリプト | 説明 |
| TypeScript をコンパイル( |
|
|
| ビルド済みサーバーを実行 |
| スクリプトによるデモレースを起動 |
| ユニットテストを実行(Vitest) |
| Playwright のエンドツーエンドスイートを実行 |
|
|
テスト
ユニットテスト(
npm test)は、実エンジンコアに対して、レースエンジンの公開コントラクト — ライフサイクル、戦略提出、リアクティブ応答、フルレース完了 — をカバーします。エンドツーエンド(
npm run test:e2e)はサーバーを起動してレースを開始し、ブラウザがマシンとライブ順位表を描画すること、レースが進行して勝者とともに完了すること、そしてリアクティブウィンドウのUIが表示されることを検証します。
MCPツール
サーバーは4つのMCPツールを公開します(src/mcp/server.ts を参照):
ツール | 説明 |
| 現在のレース状態の全体:車両、位置、ギャップ、タイヤ、燃料、ラップ、イベント。 |
| 現在の戦略ウィンドウに対する車両の戦略を提出します(冪等)。 |
| 車両に対して開かれているリアクティブウィンドウに応答します(冪等)。 |
| 戦略決定とリアクティブ行動のサーバーデバッグログ。 |
実際のLLMエージェントはMCPクライアント(SSE)として接続し、これらのツールを呼び出します。スクリプトエージェントはエンジンのメソッドをプロセス内で呼び出します。startRace と毎ティックの step はレースランナー内部のものであり、MCPツールとしては公開されません。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI assistants to access real-time iRacing telemetry, race information, camera control, pit operations, and replay features through the MCP protocol.171MIT
- AlicenseAqualityCmaintenanceA local MCP server that gives Claude (or any MCP-compatible AI client) access to Formula 1 race data. Load any session from 2018 onwards, ask questions in natural language, and get answers backed by real telemetry, timing, and strategy data.171MIT
- AlicenseAqualityDmaintenanceEnables LLMs and AI agents to interact with AFSIM through standardized MCP tools for scenario management, entity/component control, simulation execution, and results analysis.3721MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to investigate and manipulate live network simulations via MCP, including protocol debugging and fault injection.
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pefman/mcpGrandPrix'
If you have feedback or need assistance with the MCP directory API, please join our Discord server