emptysock-mcp
emptysock-mcp
Model Context Protocol-Server für die EmptySock-Spiel-Engine. Stellt die Engine-Systeme — NavMesh, Physics, Scene, Save und Actor — als MCP-Tools bereit, die von Claude Desktop, KI-Agenten und der Claude-API genutzt werden können.
Voraussetzungen
Node.js 20+
npm 9+
Related MCP server: Hayba
Installation
git clone https://github.com/eleferrets/emptysock-mcp.git
cd emptysock-mcp
npm install
npm run buildKonfiguration
Kopiere die Beispiel-Umgebungsdatei und fülle alle benötigten Werte aus:
cp .env.example .envVariable | Erforderlich | Beschreibung |
| Nein | Bearer-Token für authentifizierte Engine-API-Aufrufe |
| Nein | Erforderliches Bearer-Token für SSE-Transportanfragen. Leer lassen, um die Authentifizierung zu deaktiveren. |
| Nein | Absoluter Pfad, den die Speicher-Tools lesen/schreiben dürfen. Standardmäßig das Arbeitsverzeichnis des Prozesses. In der Produktion explizit festlegen. |
Commite
.envniemals — es ist in der.gitignoreenthalten. Speichere Geheimnisse in deinem CI/CD-Secret-Manager auf, nicht im Repository.
Den Server starten
stdio (empfohlen für die lokale Verwendung und Claude Desktop)
npm run dev # development — tsx, no build step
# or after building:
node dist/server.jsDer Server kommuniziert über stdin/stdout. Es gibt keinen Netzwerkport und keine Authentisierungsschnittstelle.
Claude Desktop
Füge den Server zu deiner Claude-Desktop-Konfiguration hinzu (~/Library/Application Support/Claude/claude_desktop_config.json unter macOS):
{
"mcpServers": {
"emptysock": {
"command": "node",
"args": ["/absolute/path/to/emptysock-mcp/dist/server.js"],
"env": {
"SAVE_BASE_DIR": "/absolute/path/to/your/saves"
}
}
}
}Starte Claude Desktop neu. Die EmptySock-Tools erscheinen dann in der Tool-Auswahl.
Verfügbare Tools
NavMesh
Tool | Beschreibung |
| A*-Pfad zwischen zwei 2D-Weltpunkten auf einem geladenen NavMesh. Gibt geordnete Wegpunkte oder |
| Nächstgelegener begehbaer NavMesh-Knoten zu einem gegebenen Weltpunkt. |
Beispiel — Pfad finden:
{
"from": { "x": 0, "y": 0 },
"to": { "x": 100, "y": 50 },
"mapId": "level1"
}Physics
Tool | Beschreibung |
| Wirft einen Strahl im 2D-Physikraum; gibt die erste getrofene Entität, den Treffpunkt und die Normale zurück. |
| Wirft einen Strahl im 3D-Physikraum (Rapier3D); gibt den ersten Treffer zurück. |
| Alle Entitäts-IDs, deren 2D-Collider einen Kreis überlappen. |
| Aktuelle Position, Geschwindigkeit und Winkelgeschwindigkeit eines Physik-Körpers anhand der Entitäts-ID. |
Beispiel — Kreisüberlappung:
{
"center": { "x": 50, "y": 50 },
"radius": 20,
"layerMask": 3
}Scene
Tool | Beschreibung |
| Alle in einer Szene aktiven Entitäts-IDs. |
| Tag, Aktivzustand und Komponentenliste für eine bestimmte Entität. |
| Serialsierter Zustand einer bestimmten Komponente auf einer Entität. |
Beispiel — Komponente abrufen:
{
"sceneId": "gameplay",
"entityId": "player-001",
"componentType": "Transform"
}Save
Alle Speicher-Tools sind per Sandbox auf SAVE_BASE_DIR beschränkt. Pfad-Traversal (.., absolute Pfade) wird bereits auf Schema-Ebene und erneut beim Auflösen abgelehnt.
Tool | Beschreibung |
| Liest einen Speicherstand von der Festplatte und gibt seine JSON-Daten zurück. |
| Schreibt ein JSON-Objekt in einen benannten Speicherstand. |
| Löscht einen Speicherstand. |
| Listet alle verfügbaren Speicherstände auf. |
Beispiel — Schreiben:
{
"slot": "autosave",
"data": { "level": 3, "score": 4200, "checkpoint": "bridge" }
}Slotnamen dürfen nur alphanumerische Zeichen, Bindestriche und Unterstriche enthalten (z. B. slot1, autosave, new-game-plus).
Actor
Tool | Beschreibung |
| Stellt eine Nachricht in den Posteingang eines bestimmten Actors. Wird beim nächsten ActorSystem-Flush verarbeitet. |
| Sendet eine Nachricht per Broadcast an alle registrierten Actors. |
| Anzahl der ausstehenden Nachrichten im Posteingang eines Actors. |
Beispiel — Nachricht senden:
{
"actorId": "enemy-spawner",
"message": { "type": "SPAWN_WAVE", "payload": { "wave": 3 } }
}Hinweis zur Reihenfolge: ActorSystem leert den Posteingang jedes Actors, bevor
update()aufgerufen wird. Nachrichten, die während Frame N gesendet werden, werden vollständig verarbeitet, bevor die Update-Logik von Frame N ausgeführt wird.
Entwicklung
npm run lint # TypeScript type-check (no emit)
npm test # run Vitest suite
npm run test:watch # watch modeDie Tests befinden sich in src/tests/. Sie decken Eingabevalidierung, Tool-Dispatch und Sicherheitsinvarianen ab (Pfad-Traversal, Shell-Metazeichen-Injektion, unbekannte Toolnamen).
Ein Tool hinzufügen
Erstelle
src/tools/<domain>.ts— exportiere einentoolDef-Array-Eintrag und einehandler- Funktion.Registriere beide in
src/tools/index.tsüber denregister()- Aufruf inbuildRegistry().Füge einen Eintrag zu
api-reference.jsoninemptysock-enginehinzu.Füge eine Skill-Datei zu
eleferrets/emptysock-ai-skillshinzu.
Verwende die gemeinsamen Helfer in src/lib/:
parse(schema, raw)— Zod-Parse, der bei einem FehlerMcpError(InvalidParams)wirftSafeRelPath,SafeId,Vec2,Vec3,GameNum— wiederverwendbare Zod-SchemastextResponse(data)— erstellt die standardmäßige MCP-Textinhalts-AntwortwrapError(err)— protokolliert auf stderr und wirft ihn alsMcpError(InternalError)erneut
Sicherheitsmodell
Risiko | Gegenmaßnahme |
Fehlerhafte Argumente | Zod- |
Pfad-Traversal | Schema |
Shell-Injektion | Kein |
Leakage von Zugangsdaten | Geheimnisse nur aus |
Übergroße Eingaben | Stringlängen sind auf jedem Schema-Feld begrenzt |
Unbekannte Tools |
|
Available Tools
21 toolsactor_broadcastB
Broadcast a message to all registered actors in the current ActorSystem.
Inputs: message (required).
actor_inbox_sizeB
Return the number of pending messages in an actor's inbox.
Inputs: actorId (required).
actor_send_messageA
Enqueue a message in a specific actor's inbox. The actor processes it on the next flush pass.
Inputs: actorId (required), message (required).
emptysock_layer_infoA
Return reference documentation for the EmptySock LayerSystem API: defineLayer, addToLayer, setVisible, setParallax, and RenderSystem integration.
Inputs: no named parameters.
gms2_inspect_projectA
Read a GameMaker Studio 2 .yyp project file and return a JSON summary: project name, asset counts by type, and lists of object and script names. Read-only — does not modify any files.
Inputs: yypPath (required).
particle_emitter_configA
Get or set a ParticleSystem emitter configuration by emitter ID. Omit config to read; provide config to write.
Inputs: emitterId (required), config.
physics_body_stateA
Return the current position, velocity, and angular velocity of a physics body by entity ID.
Inputs: entityId (required).
physics_overlap_circleB
Return all entity IDs whose 2D colliders overlap a circle.
Inputs: center (required), radius (required), layerMask.
physics_raycast_2dB
Cast a ray in 2D physics space and return the first hit entity, hit point, and normal.
Inputs: origin (required), direction (required), maxDistance (required), layerMask.
physics_raycast_3dC
Cast a ray in 3D physics space (Rapier3D) and return the first hit.
Inputs: origin (required), direction (required), maxDistance (required), layerMask.
save_deleteA
Delete a save slot from disk.
Inputs: slot (required).
save_listA
List all available save slots.
Inputs: subdir.
save_readA
Read a save slot from disk and return its JSON data.
Inputs: slot (required).
save_writeA
Write JSON data to a save slot on disk.
Inputs: data (required), slot (required).
scene_create_entityC
Add a new entity to a scene. Returns the new entity's ID.
Inputs: sceneId (required), tag, components.
scene_entity_infoC
Return the tag, active state, and component list for a specific entity.
Inputs: sceneId (required), entityId (required).
scene_get_componentB
Retrieve the serialised state of a specific component on an entity.
Inputs: sceneId (required), entityId (required), componentType (required).
scene_list_entitiesB
List all entity IDs currently active in a scene.
Inputs: sceneId (required).
story_graph_exportA
Export the Story Graph (VNSystem) for a named scene as a JSON object containing nodes and edges.
Inputs: sceneId (required), graphId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Tools are clearly separated by domain (navmesh, physics, scene, save, actor, etc.) and each tool targets a distinct action or query. Even within physics, 2D and 3D raycasts are explicitly differentiated. No two tools appear to do the same thing.
All tools follow a consistent domain_verb_noun pattern (e.g., scene_create_entity, save_list, actor_send_message). Suffixes like _2d and _3d are uniform, and the one odd name (emptysock_layer_info) still adheres to the same style. Naming is predictable and coherent.
With 21 tools, the count falls in the 16-25 range, which is borderline heavy. However, the server covers many distinct subsystems, so each tool arguably earns its place, but the overall number feels slightly excessive for a single MCP server.
The set covers core read/query operations across multiple domains, but there are notable gaps: scene entities can be created and inspected but not updated or deleted, physics only offers queries (no manipulation), and particle control is limited to configuration. This leaves some lifecycle operations incomplete.
Maintenance
Related MCP Connectors
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
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.
Persistent memory, knowledge graph, task management and more 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 gradedqualityBmaintenanceAn 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
- AlicenseNot gradedqualityDmaintenanceConnects Claude Code to the Unity Editor via MCP, enabling AI-driven control of scenes, assets, components, UI, animations, and more through 91 tools.2MIT
- AlicenseCqualityCmaintenanceEnables AI-driven game development by providing MCP tools to interact with the Godot editor, including scene editing, node manipulation, script attachment, and scene execution.2814 npmMIT