by wilson-lilburne
Model Context Protocol (MCP) server for Adventure Game Studio (AGS) compiled room (.crm) file manipulation.
Bridge tool that gives AI access to binary AGS room data for complete AI-powered adventure game development.
AI tools excel at reading and writing AGS script files (text), but cannot directly access compiled room (.crm) files. This creates a gap where developers must manually connect AI-generated scripts to room elements through the AGS editor.
The AGS MCP Server bridges this gap by providing programmatic access to binary .crm data, enabling AI to:
Core Workflow:
# Run directly without installation npx ags-mcp-server
# Clone the repository git clone <repository> cd ags-mcp-server # Install dependencies npm install # Run the demo npm run demo # Shows all functionality working
# Run directly without installation npx ags-mcp-server
# Clone the repository git clone <repository> cd ags-mcp-server # Install dependencies npm install # Build the project npm run build # Run the server npm start # Starts MCP server on stdio
Prerequisites: Node.js 18+ installed
Run with npx:
# Run directly without installation npx ags-mcp-server
Claude Desktop Config (%APPDATA%\Claude\claude_desktop_config.json
):
*Configuration content*
Prerequisites: Node.js 18+ installed
Run with npx:
# Run directly without installation npx ags-mcp-server
Claude Desktop Config (~/Library/Application Support/Claude/claude_desktop_config.json
):
*Configuration content*
Prerequisites: Node.js 18+ installed
Run with npx:
# Run directly without installation npx ags-mcp-server
Claude Desktop Config (~/.config/Claude/claude_desktop_config.json
):
*Configuration content*
read_room_data
- Parse .crm file and return structured room datalist_room_blocks
- List all blocks in a .crm file with detailsexport_room_block
- Export specific block to fileimport_room_block
- Import/replace block data in .crm fileget_room_hotspots
- Extract hotspot information and interactionsadd_hotspot_interaction
- Add interaction event handler to hotspot*Configuration content*
Add to your claude_desktop_config.json
(location depends on your OS):
*Configuration content*
Configure in Cline settings:
*Configuration content*
AI โ read_room_data โ analyze layout โ get_room_hotspots โ identify missing interactions
AI: "Make the door interactive"
MCP: add_hotspot_interaction(door, "Look", "door_Look")
AI: Generated function: door_Look() { player.Say("A sturdy wooden door."); }
# AI processes multiple rooms for consistency for room in ["room001.crm", "room002.crm", "room003.crm"]: hotspots = mcp_call("get_room_hotspots", {"roomFile": room}) # Add missing interactions automatically for hotspot in hotspots: if "Look" not in hotspot["interactions"]: mcp_call("add_hotspot_interaction", {...})
The MCP server works with AGS's binary .crm (compiled room) format:
Block ID | Name | Description |
---|---|---|
1 | Main | Room backgrounds, objects, masks |
2 | TextScript | Text script source (legacy) |
5 | ObjNames | Object and hotspot names |
6 | AnimBg | Animated backgrounds |
7 | CompScript3 | Current compiled script |
8 | Properties | Custom properties |
9 | ObjectScNames | Script names for objects |
hotspot{id}_{event}
(e.g., hotspot1_Look
)Enable AI tools to fully manipulate AGS room files without manual AGS editor intervention.
Goal: Complete hotspot script-to-binary connection capabilities
โ UPDATE: All operations now use direct binary manipulation with accurate data!
Goal: Eliminate binary dependencies and implement real file writing
list_room_blocks
with direct binary parsingGoal: Connect AI scripts to room objects via direct binary parsing
Goal: AI control over character movement via direct binary manipulation
Goal: AI setup of trigger zones via direct binary manipulation
Goal: AI character placement via direct binary manipulation
๐ฏ Status: Full Binary Manipulation Complete
# If you've cloned the repository npm run demo # Shows all MCP tools with mock data # Or using npx npx ags-mcp-server demo
# Test the JSON-RPC interface echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | npx ags-mcp-server
# Check if the MCP server is working correctly npx ags-mcp-server --version
# Install dependencies npm install # Build TypeScript code npm run build # Run tests npm test
AI Request โ MCP Server โ AGS Tools (crmpak) โ Binary .crm Files โ Structured Data โ AI Response
npx command not found:
# Make sure Node.js is installed node --version # If needed, install or update npm npm install -g npm
Permission issues with npx:
# On Linux/macOS, you might need to use sudo sudo npx ags-mcp-server # Or fix npm permissions https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
MCP connection failed:
# Check stdio configuration and tool responses echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | npx ags-mcp-server
File access errors:
# Make sure you're using absolute file paths or paths relative to your current directory # Not paths relative to the MCP server installation
DEBUG=ags-mcp:* npx ags-mcp-server
git checkout -b feature/new-tool
npm test
MIT License - see LICENSE file for details.
Ready to automate your AGS game development with AI? Start with npm run demo
to see it in action! ๐ฎโจ
4 contributors