CU-MCP-Bridge
CU-MCP-Bridge
BepInEx mod + Python MCP server that lets AI assistants control Casualties Unknown gameplay in real time via named pipe.
Requirements
Windows 10/11
Casualties Unknown (Steam)
Python 3.10+
.NET SDK (for building the mod)
BepInEx installed in the game
Related MCP server: Unity-MCP
Quick start
1. Install the mod
Copy the two DLLs from mod/ into your game's BepInEx/plugins/ folder:
<game directory>/BepInEx/plugins/CU-MCP-Mod.dll
<game directory>/BepInEx/plugins/Newtonsoft.Json.dll2. Install Python dependencies
pip install -r requirements.txt3. Configure your AI client
Add to your MCP configuration (e.g. opencode.json):
{
"mcp": {
"servers": {
"cu-mcp-bridge": {
"type": "stdio",
"command": "python",
"args": ["src/bridge_server/server.py"],
"cwd": "/path/to/CU-MCP-Bridge"
}
}
}
}4. Play
Start the game, enter a level
Start the Python server:
python src/bridge_server/server.pyAsk your AI assistant to control the player
Order matters: the server must start after the game is running.
Building from source
# Build the C# mod
dotnet build BepInEx/CU-MCP-Mod.csproj -c Release
# Deploy to game (kills the game process, rebuilds, copies DLL)
.\deploy.ps1 -Action deployOutput: BepInEx/bin/Release/net472/CU-MCP-Mod.dll
Architecture
AI Client (opencode)
|
stdio (JSON-RPC)
|
Python FastMCP Server (src/bridge_server/)
|
Named Pipe (win32pipe, newline-delimited JSON)
|
C# BepInEx Mod (BepInEx/, inside Unity game)
|
Unity Game (Casualties Unknown)Communication
AI -> Game: Orders are sent over the named pipe and executed on Unity's main thread
Game -> AI: Player state and query results flow back over the same pipe
Blocking: Each command blocks until the mod reports completion (success/failure/timeout)
Project structure
CU-MCP-Bridge/
├── BepInEx/ # C# mod source (BepInEx plugin)
│ ├── Executor/ # Order execution, pathfinding, movement
│ ├── Collector/ # Game state collection (player, environment)
│ ├── Contingency/ # Local condition-action rules
│ ├── Pipe/ # Named pipe client + protocol
│ ├── AIPlayerManager.cs # AI companion creation/destruction
│ ├── BridgePlugin.cs # Entry point, tick loop
│ └── DebugGUI.cs # F6 debug panel
├── src/bridge_server/ # Python MCP server
│ ├── server.py # MCP tool definitions
│ ├── state_manager.py # Pipe reader, state cache
│ ├── order_manager.py # Order queue
│ ├── pipe_server.py # Named pipe server (win32pipe)
│ └── contingency.py # Contingency rule manager
├── tests/ # Unit & integration tests
├── deploy.ps1 # Build + deploy script
└── requirements.txt # Python dependenciesMCP Tools
Tool | Description |
| Player state (position, health, inventory) + environment snapshot |
| Terrain and entity info around the player |
| List dropped items near the player |
| Query entities/terrain at a specific world coordinate |
| Search terrain by material name (e.g. "sand", "rock") |
| Move the active player to a world position |
| Move the AI companion to the human player |
| Make the AI companion follow the human |
| Jump (supports horizontal direction) |
| Use an inventory item |
| Pick up a nearby item (by name or nearest) |
| Drop an inventory item |
| Rest to recover energy |
| Heal a specific limb on the AI companion |
| Clone an AI companion next to the human |
| Remove the AI companion |
| Set condition-action rules (e.g. "heal if HP < 30%") |
| Update contingency rules at runtime |
| Highest-priority human intervention |
Known issues
Skin mod compatibility: Installing third-party skin mods (e.g. "Skin Sync") may cause the AI companion to display a duplicate tail that mirrors the human player's tail. This is a skin mod compatibility issue and does not occur in the vanilla game.
License
MIT
This server cannot be installed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
MCP server for AI dialogue using various LLM models via AceDataCloud
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseBqualityAmaintenanceMCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)5101,880MIT
- AlicenseNot gradedqualityAmaintenanceSeamless automation and intelligent control over your Unity projects. By integrating with the MCP server and client, it allows AI agents or external tools to interact with your Unity environment—creating, modifying, and managing GameObjects, Components, Assets, Scenes, and more.4,016Apache 2.0
- AlicenseAqualityBmaintenanceMCP server to dynamically load Claude Code skills into AI agents56215MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that bridges Unity with AI agents, enabling scene inspection, C# code execution, and screenshot capture via WebSocket communication.MIT
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/mouse114514/CU-MCP-Bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server