emptysock-mcp
emptysock-mcp
EmptySock ゲームエンジン用の Model Context Protocol サーバー。エンジンのシステム — NavMesh、Physics、Scene、Save、Actor — を MCP ツールとして公開し、Claude Desktop、AI エージェント、Claude API から利用できます。
要件
Node.js 20+
npm 9+
Related MCP server: Hayba
インストール
git clone https://github.com/eleferrets/emptysock-mcp.git
cd emptysock-mcp
npm install
npm run build設定
サンプルの env ファイルをコピーし、必要な値を入カしてください:
cp .env.example .env変数 | 必須 | 説明 |
| 任意 | 認証付きエンジン API 呼び出し用の Bearer トークン |
| 任意 | SSE トランスポートのリクエストに必要な Bearer トークン。空欄にすると認証が無効になります。 |
| 任意 | セーブツールが読み書きできる絶対パス。デフォルトはプロセスの作業ディレクトリです。本番環境では明示的に設定してください。 |
.envは決してコミットしないでください — gitignore されています。シークレットはリポジトリではなく CI/CD のシークレットマネージャーに保存してください。
サーバーの実行
stdio (ローカルでの利用と Claude Desktop に推奨)
npm run dev # development — tsx, no build step
# or after building:
node dist/server.jsサーバーは stdin/stdout で通信します。ネッとワークポートはなく、認証インターフェースもありません。
Claude Desktop
Claude Desktop の設定ファイル (~/Library/Application Support/Claude/claude_desktop_config.json、macOS の場合) にサーバーを追加します:
{
"mcpServers": {
"emptysock": {
"command": "node",
"args": ["/absolute/path/to/emptysock-mcp/dist/server.js"],
"env": {
"SAVE_BASE_DIR": "/absolute/path/to/your/saves"
}
}
}
}Claude Desktop を再起動してください。EmptySock ツールがツールピッカーに表示されます。
利用可能なツール
NavMesh
ツール | 説明 |
| 読み込まれた navmesh 上の 2D ワールド座標 2 点間の A* 経路。順序付けられたウェイポイントを返し、経路が存在しない場合は |
| 指定されたワールドポイントに最も近い、歩行可能な navmesh ノード。 |
例 — 経路検索:
{
"from": { "x": 0, "y": 0 },
"to": { "x": 100, "y": 50 },
"mapId": "level1"
}Physics
ツール | 説明 |
| 2D 物理空間にレイを投射し、最初にヒットしたエンティティ、ヒットポイント、法線を返します。 |
| 3D 物理空間 (Rapier3D) にレイを投射し、最初のヒットを返します。 |
| 2D コライダーが円と重なるすべてのエンティティ ID。 |
| エンティティ ID で指定された物理ボディの現在の位置、速度、角速度。 |
例 — 円とのオーバーラップ:
{
"center": { "x": 50, "y": 50 },
"radius": 20,
"layerMask": 3
}Scene
ツール | 説明 |
| シーン内でアクティブなすべてのエンティティ ID。 |
| 特定のエンティティのタグ、アクティブ状態、コンポーネント一覧。 |
| エンティティ上の特定コンポーネントのシリアライズ済み状態。 |
例 — コンポーネントの取得:
{
"sceneId": "gameplay",
"entityId": "player-001",
"componentType": "Transform"
}Save
すべてのセーブツールは SAVE_BASE_DIR 内にサンドボッス化されます。パストラバーサル (..、絶対パス) はスキーマ層と解決時の両方で拒否されます。
ツール | 説明 |
| セーブスロッとをディスから読取み、その JSON データを返します。 |
| JSON オブジェクトを指定した名前のセーブスロットに書き込みます。 |
| セーブスロットを削除します。 |
| 利用可能なすべてのセーブスロットを一覧表示します。 |
例 — 書き込み:
{
"slot": "autosave",
"data": { "level": 3, "score": 4200, "checkpoint": "bridge" }
}スロット名は英数字とダッシュ/アンダースコアのみ使用できます (例: slot1、autosave、new-game-plus)。
Actor
ツール | 説明 |
| 特定のアクターの受信箱にメッセージをエンキューします。次の ActorSystem フラッシュ時に処理されます。 |
| 登録済みのすべてのアクターにメッセージをブロードキャストします。 |
| アクターの受信箱にある保留中メッセージの数。 |
例 — メッセージの送信:
{
"actorId": "enemy-spawner",
"message": { "type": "SPAWN_WAVE", "payload": { "wave": 3 } }
}順序に関する注記: ActorSystem は
update()を呼び出す前に各アクターの受信箱を空にします。フレーム N の間に送信されたメッセージは、フレーム N の更新ロジックが実行される前に完全に処理されます。
開発
npm run lint # TypeScript type-check (no emit)
npm test # run Vitest suite
npm run test:watch # watch modeテストは src/tests/ にあります。入力検証、ツールディスパッチ、セキュリティ不変条件 (パストラバーサル、シェルメタキャラクターインジェクション、未知のツール名) をカバーしています。
ツールの追加
src/tools/<domain>.tsを作成 —toolDef配列エントリとhandler関数をエクスポートします。buildRegistry()内のregister()呼び出しで、その両方をsrc/tools/index.tsに登録します。emptysock-engineのapi-reference.jsonにエントリを追加します。eleferrets/emptysock-ai-skillsにスキルファイルを追加します。
src/lib/ の共有ヘルパーを使用します:
parse(schema, raw)— 失敗時にMcpError(InvalidParams)をスローする Zod パースSafeRelPath,SafeId,Vec2,Vec3,GameNum— 再利用可能な Zod スキーマtextResponse(data)— 標準の MCP テキストコンテンツレスポンスを構築するwrapError(err)— stderr にログを記録し、McpError(InternalError)として再スローする
セキュリティモデル
懸念事項 | 対策 |
不正な引数 | すべての入力で Zod |
パストラバーサル |
|
シェルインジェクション | テンプレート文字列による |
認証情報の漏えい | シークレットは |
過大な入力 | すべてのスキーマフィールドで文字列長を制限 |
未知のツール |
|
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM-driven text game state management by exposing MCP tools for managing players, locations, items, entities, and abstract concepts.MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server enabling AI agents to author Unreal Engine 5 scenes directly, with tools for spawning actors, building PCG graphs, validating physics, generating terrain, and more through a single MCP connection.13MIT
- FlicenseNot gradedqualityDmaintenanceConnects Claude Code to the Unity Editor via MCP, enabling AI-driven control of scenes, assets, components, UI, animations, and more through 91 tools.2-
- AlicenseCqualityAmaintenanceEnables AI-driven game development by providing MCP tools to interact with the Godot editor, including scene editing, node manipulation, script attachment, and scene execution.2827MIT
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/eleferrets/emptysock-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server