Skip to content

Input simulation#69

Open
hellochar wants to merge 6 commits intoCoding-Solo:mainfrom
hellochar:input-simulation
Open

Input simulation#69
hellochar wants to merge 6 commits intoCoding-Solo:mainfrom
hellochar:input-simulation

Conversation

@hellochar
Copy link

Summary

  • Adds simulate_input tool for sending mouse (with warp_mouse)/keyboard/action commands to running Godot games
  • First, invoke the setup_input_simulation tool which installs a new addon into the client project. That addon runs a TCP server that handles simulate_input commands

Features

  • Mouse: click, move, drag (with position, button, double-click support)
  • Keyboard: key press/release with modifiers
  • Actions: Godot input action press/release/pulse
  • Text input with configurable delay
  • Screenshot capture
  • Wait/timing control

Technical Details

  • Persistent TCP connection to avoid TIME_WAIT accumulation
  • Request serialization to prevent concurrent cross-talk
  • Configurable port via env var or project settings
  • Timeout with socket cleanup to prevent stale response corruption

hellochar and others added 6 commits February 2, 2026 19:07
Adds a Godot autoload script that runs a TCP server on port 7070 to
receive input simulation commands. Supports mouse clicks, movement,
drags, keyboard input, action triggers, text typing, and screenshots.

The build script now copies the addon to build/addons for distribution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- simulate_input: sends mouse/keyboard/action commands to running game
- setup_input_simulation: installs GodotMCPInput addon to a project

Uses persistent TCP connection to avoid TIME_WAIT socket accumulation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Input Simulation feature to README
- Document setup steps and available commands
- Add troubleshooting section for input simulation
- Update CONTRIBUTING.md with new tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Multiple concurrent simulate_input calls were sharing the same socket
and could receive each other's responses. Now requests are queued and
processed one at a time.

Also destroys socket on timeout to prevent stale responses from
corrupting subsequent requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
If two JSON lines arrived in one read, only the first was processed
and the second stayed in the buffer forever. Now loops through all
complete lines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Port can now be set via:
- Environment variable: GODOT_MCP_INPUT_PORT
- Project setting: godot_mcp/input_port
- Default remains 7070

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant