Expand description
§Bevy Debugger MCP
AI-assisted debugging for Bevy games through Claude Code using Model Context Protocol.
This crate provides a comprehensive debugging toolkit for Bevy games, enabling natural language interaction with game state through Claude Code. It bridges the gap between AI assistance and game development by offering intelligent observation, experimentation, and analysis capabilities.
§Quick Start
- Add BRP to your Bevy game:
[dependencies]
bevy = { version = "0.12", features = ["bevy_remote_protocol"] }- Enable BRP in your game:
use bevy::prelude::*;
use bevy::remote::RemotePlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(RemotePlugin::default())
.run();
}- Install and configure the MCP server:
cargo install bevy_debugger_mcp
bevy-debugger-mcp --help- Configure Claude Code:
{
"mcpServers": {
"bevy-debugger-mcp": {
"command": "bevy-debugger-mcp",
"args": [],
"type": "stdio"
}
}
}§Features
- 🔍 Natural Language Queries: Ask about your game state in plain English
- 🧪 Controlled Experiments: Test hypotheses with systematic variations
- 📊 Performance Analysis: Monitor and analyze game performance in real-time
- ⏱️ Time-Travel Debugging: Record, replay, and branch timelines
- 🚨 Anomaly Detection: Automatically detect unusual patterns in game behavior
- 📈 Stress Testing: Systematically test your game under various loads
- 🔧 Tool Orchestration: Chain debugging operations into complex workflows
§Core Modules
§Observation and Query
query_parser- Natural language to game queriessemantic_analyzer- Semantic understanding of game conceptsbrp_client- Bevy Remote Protocol communication
§Experimentation and Testing
experiment_system- Controlled game state experimentshypothesis_system- Property-based testing for gamesstress_test_system- Systematic stress testing
§Time and State Management
recording_system- Game state recording and persistenceplayback_system- Deterministic replay capabilitiestimeline_branching- Multi-timeline debugging with branchingcheckpoint- Save/restore debugging sessions
§Analysis and Monitoring
anomaly_detector- Pattern recognition for unusual behaviorstate_diff- Intelligent state comparison and diffingdiagnostics- System health monitoring and reporting
§Infrastructure
mcp_server- Model Context Protocol server implementationtool_orchestration- Complex debugging workflow coordinationerror- Comprehensive error handling and recoveryconfig- Configuration management
§Example Usage
use bevy_debugger_mcp::prelude::*;
// Connect to your Bevy game
let mut client = BrpClient::connect("ws://localhost:15702").await?;
// Parse natural language queries
let parser = RegexQueryParser::new();
let request = parser.parse("find entities with Transform and Velocity")?;
// Execute the query
let response = client.send_request(request).await?;
println!("Found entities: {:?}", response);§Architecture
The system follows a modular architecture:
Claude Code ←→ MCP Protocol ←→ MCP Server ←→ BRP Protocol ←→ Bevy Game
↓
Tool Modules
(observe, experiment,
stress, replay, etc.)§Error Handling
All operations return Result<T, Error> types. The system includes
comprehensive error recovery with automatic reconnection, dead letter queues for
failed operations, and checkpoint/restore capabilities.
Modules§
- anomaly_
detector - brp_
client - brp_
messages - checkpoint
- config
- dead_
letter_ queue - diagnostics
- error
- experiment_
system - hypothesis_
system - mcp_
server - playback_
system - prelude
- Common imports for typical usage
- query_
parser - recording_
system - resource_
manager - semantic_
analyzer - state_
diff - stress_
test_ system - timeline_
branching - tool_
orchestration - tools