About
A Model Context Protocol (MCP) server that enables AI coding assistants to launch, inspect, and mutate Bevy applications via the Bevy Remote Protocol (BRP). This tool bridges the gap between coding agents and Bevy by providing comprehensive BRP integration as an MCP server.
Bevy Compatibility
| bevy | bevy_brp_mcp |
|---|---|
| 0.18 | 0.18.0-0.19.0 |
| 0.17 | 0.17.0-0.17.2 |
| 0.16 | 0.1 |
The bevy_brp_mcp crate follows Bevy's version numbering and releases new versions for each Bevy release.
Features
Core BRP Operations
- Entity Management: Spawn, despawn, query
- Component Operations: Get, insert, list, remove, and mutate components on entities
- Resource Management: Get, insert, list, remove, and mutate resources
- Query System: Entity querying with filters
- Hierarchy Operations: Reparent entities
- Type Guide: Get proper JSON formats for BRP operations using the
brp_type_guidetool, which provides spawn/insert examples and mutation paths for components and resources
Application Discovery & Management for your Agent
- App Discovery: Find and list Bevy applications in your workspace
- Build Status: Check which apps are built and ready to run
- Launch Management: Start apps with proper asset loading and logging
- Example Support: Discover and run Bevy examples from your projects
Real-time Monitoring
- Component Watching: Monitor component changes on specific entities
- Log Management: Captures stdout to a temp file and provides a link to your agent for it to read your logs instead of blocking on running your app.
- Process Status: Check if apps are running with BRP enabled
Enhanced BRP Capabilities
requires bevy_brp_extras
brp_extras/screenshot- Capture screenshots of the primary windowbrp_extras/shutdown- Gracefully shutdown the applicationbrp_extras/send_keys- Send keyboard input to the applicationbrp_extras/type_text- Type text sequentially (one character per frame)brp_extras/set_window_title- Change the primary window titlebrp_extras/click_mouse- Click mouse buttonbrp_extras/double_click_mouse- Double click mouse buttonbrp_extras/send_mouse_button- Press and hold mouse buttonbrp_extras/move_mouse- Move mouse cursor (delta or absolute)brp_extras/drag_mouse- Drag mouse with smooth interpolationbrp_extras/scroll_mouse- Mouse wheel scrollingbrp_extras/double_tap_gesture- Trackpad double tap gesture (macOS)brp_extras/pinch_gesture- Trackpad pinch gesture (macOS)brp_extras/rotation_gesture- Trackpad rotation gesture (macOS)brp_extras/get_diagnostics- Query FPS and frame time diagnostics
Getting Started
First, install via cargo:
cargo install bevy_brp_mcp
Configure your MCP server. For Claude Code, add this to your ~/.claude.json file:
"mcpServers":
That's it!
Usage
With AI Coding Assistants
bevy_brp_mcp is designed to be used with AI coding assistants that support MCP (e.g., Claude Code). The MCP server provides tools that allow the AI to:
- Discover and launch your Bevy applications - with logs stored in your temp dir so they can be accessed by the coding assistant.
- Inspect and modify entity components in real-time
- Monitor application state and debug issues
- Take screenshots, send keyboard/mouse input, query diagnostics, and manage application lifecycle (requires
bevy_brp_extras)
Setting Up Your Bevy App
For full functionality, your Bevy app should include BRP support:
use *;
For enhanced features such as asking the coding agent to take a screenshot or to send keyboard input to your running app, also add bevy_brp_extras:
use *;
use BrpExtrasPlugin;
In either case you'll need to make sure to enable bevy's "bevy_remote" feature.
Example Workflow
- Discover: Use
brp_list_bevyto find available applications and examples - Launch: Use
brp_launchto start your game with proper logging - Inspect: Use
world_queryto find entities of interest - Monitor: Use
world_get_components_watchto observe entity changes in real-time - Modify: Use
world_mutate_componentsto adjust entity properties - Trigger: Use
world_trigger_eventto trigger events for your observers - Debug: Use
read_logto examine application output - Capture: Use
brp_extras_screenshotto document current state - Interact: Use
brp_extras_send_keysto send keyboard input for testing - Diagnose: Use
brp_extras_get_diagnosticsto check FPS and frame time
Logging
All launched applications create detailed log files in /tmp/ with names like:
bevy_brp_mcp_myapp_1234567890.log(application logs)bevy_brp_mcp_watch_123_get_456_1234567890.log(monitoring logs)
Use the log management tools to view and clean up these files.
License
Dual-licensed under either:
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.