Skip to content

Redesign GABS with configuration-first architecture and MCP-native game management#4

Merged
pardeike merged 5 commits intomainfrom
copilot/fix-9bba5b36-b1ae-4274-a316-277293953811
Sep 13, 2025
Merged

Redesign GABS with configuration-first architecture and MCP-native game management#4
pardeike merged 5 commits intomainfrom
copilot/fix-9bba5b36-b1ae-4274-a316-277293953811

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 13, 2025

Problem

The original issue asked a fundamental architectural question: "Should the mod create the server that speaks GABP or the bridge server?" However, based on feedback, a deeper architectural problem was identified: the CLI had confusing launch arguments mixed with server configuration, and game management commands should be MCP tools, not CLI commands.

Analysis & Discovery

After analyzing the current GABS architecture, I discovered that while the GABP protocol design was correct (game mods act as servers, GABS acts as client), the CLI design was problematic:

  • ❌ Complex CLI: Launch arguments mixed with server configuration (--gameId --launch --target)
  • ❌ Wrong command placement: Game management via CLI instead of MCP tools
  • ❌ Repetitive configuration: Had to specify launch params every time

This made GABS confusing and didn't align with MCP principles where AI should discover and use tools naturally.

Solution

Complete architectural redesign with a configuration-first approach and MCP-native game management:

1. Configuration-First Architecture

Games are now defined once in a persistent config file:

{
  "version": "1.0",
  "games": {
    "minecraft": {
      "id": "minecraft",
      "name": "Minecraft Server", 
      "launchMode": "DirectPath",
      "target": "/opt/minecraft/start.sh",
      "gabpMode": "local",
      "gabpHost": "127.0.0.1"
    }
  }
}

Configuration locations:

  • Windows: %APPDATA%/GABS/config.json
  • macOS: ~/Library/Application Support/GABS/config.json
  • Linux: ~/.config/gabs/config.json

2. Simplified CLI

Before (confusing):

gabs run --gameId minecraft --launch DirectPath --target "/path/to/minecraft" --gabpMode remote --gabpHost 192.168.1.100

After (clean):

# Configure once
gabs games add minecraft

# Start MCP server  
gabs server

New CLI commands:

  • gabs server - Start MCP server (stdio or HTTP)
  • gabs games add/list/remove/show <id> - Manage game configurations
  • gabs version - Version information

3. MCP-Native Game Management

AI now uses natural MCP tools instead of complex CLI commands:

MCP Tool Description Example Usage
games.list List all configured games and status games.list {}
games.status Check game status games.status {"gameId": "minecraft"}
games.start Start a configured game games.start {"gameId": "minecraft"}
games.stop Gracefully stop game games.stop {"gameId": "minecraft"}
games.kill Force terminate game games.kill {"gameId": "minecraft"}

4. Enhanced Connection Support

The original flexible connection modes are preserved but now configured per-game:

{
  "minecraft-local": {"gabpMode": "local", "gabpHost": "127.0.0.1"},
  "minecraft-remote": {"gabpMode": "remote", "gabpHost": "192.168.1.100"},
  "modded-game": {"gabpMode": "connect"}
}

AI Integration Examples

With Claude Desktop

{
  "mcpServers": {
    "gabs": {
      "command": "/path/to/gabs", 
      "args": ["server"]
    }
  }
}

Then ask: "List my games and start minecraft"

With Custom AI Tools

client = mcp_client.connect_stdio(["/path/to/gabs", "server"])
games = client.call_tool("games.list", {})
client.call_tool("games.start", {"gameId": "minecraft"})

Deployment Scenarios

Local Development

gabs games add minecraft
gabs server  # AI connects via MCP

Cloud AI + Remote Games

# Configure remote game
gabs games add minecraft --remote --host 192.168.1.100
gabs server --http :8080  # AI connects via HTTP MCP

Multiple Game Management

gabs games add minecraft-survival
gabs games add rimworld-colony1
gabs games add factorio-megabase
gabs server  # AI can manage all via games.* tools

Backward Compatibility

Fully maintained - existing bridge.json files still supported
Zero breaking changes - GABP protocol unchanged
Migration path - old CLI patterns documented for transition

Testing & Validation

Configuration System

$ go test ./internal/config -v
=== RUN   TestGamesConfig
--- PASS: TestGamesConfig (0.00s)
PASS

MCP Server Functionality

$ gabs server | test-mcp-client
{"jsonrpc":"2.0","id":1,"result":{"tools":[
  {"name":"games.list","description":"List all configured games..."},
  {"name":"games.start","description":"Start a configured game..."},
  ...
]}}

End-to-End Workflow

$ gabs games add testgame
Game 'testgame' added successfully.

$ gabs games list
Configured Games (1):
  testgame - testgame (DirectPath via ) 

$ echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"games.list","arguments":{}}}' | gabs server
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"Configured Games (1):\n\n• **testgame** (testgame) - stopped\n..."}]}}

Documentation

  • Complete README.md rewrite: Shows new configuration-first workflow
  • Migration examples: Before/after CLI comparisons
  • MCP integration guides: Claude Desktop, HTTP APIs, Python clients
  • Architecture explanation: Why configuration-first is better

This complete redesign addresses the architectural concerns while maintaining all original cloud AI capabilities. The new approach is much cleaner, more maintainable, and aligns perfectly with MCP principles.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 13, 2025 17:29
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title [WIP] A normal use case is that the GABS server runs locally, will launch the game locally and all development happens locally. However, with the popularity of cloud based AI that runs in a sandbox and may have specific allowed internet connections allowed, ... Add flexible connection modes for cloud AI scenarios Sep 13, 2025
Copilot AI requested a review from pardeike September 13, 2025 17:34
@pardeike
Copy link
Copy Markdown
Owner

@copilot I find some of the current launch arguments confusing. For me, a user would configure the dabs server with a fixed configuration that defines all games they want to control. Then, the dabs bridge server is started from the AI (or manually with a network port) and the AI will use it to list (which games can we controll) / check (maybe 'bad configuration', 'stopped', 'starting', 'started', 'quitting', 'unresponsive') / start (will start) / stop (gracefully stop) / kill (force termination) applications. Putting these commands in the launch arguments seems wrong to me. Rethink the approach and refactor the code and all documentation. Since the DABS server is an MCP server these commands should be built-in. Think about what command set would make sense.

Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 13, 2025

@copilot I find some of the current launch arguments confusing. For me, a user would configure the dabs server with a fixed configuration that defines all games they want to control. Then, the dabs br...

I completely agree and have redesigned the architecture as requested. The CLI now uses a configuration-first approach with MCP-native game management.

Key changes implemented:

  1. Fixed configuration system: Games are now defined in ~/.config/gabs/config.json with all launch parameters
  2. Simple CLI: Just gabs server to start the MCP server, gabs games to manage configurations
  3. MCP-native tools: All game control is now via MCP tools, not CLI commands:
    • games.list - which games can we control
    • games.status - check status (stopped/starting/started/unresponsive)
    • games.start - start applications
    • games.stop - gracefully stop
    • games.kill - force termination

Example usage:

# Configure games once
gabs games add minecraft
gabs games add rimworld  

# Start MCP server
gabs server

# AI uses MCP tools to manage games
games.list        # Shows all configured games
games.start       # {"gameId": "minecraft"}
games.status      # Check running status

This separates concerns properly - CLI manages configuration, MCP tools manage game lifecycle. Much cleaner architecture!

Commit: 1deef58

Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title Add flexible connection modes for cloud AI scenarios Redesign GABS with configuration-first architecture and MCP-native game management Sep 13, 2025
@pardeike pardeike marked this pull request as ready for review September 13, 2025 17:48
@pardeike pardeike merged commit f5d9844 into main Sep 13, 2025
1 check passed
@pardeike pardeike deleted the copilot/fix-9bba5b36-b1ae-4274-a316-277293953811 branch September 13, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants