Skip to content

fix: complete screenshot feature with missing GDScript autoload#65

Open
sajadghawami wants to merge 2 commits intoCoding-Solo:mainfrom
sajadghawami:fix/screenshot-feature
Open

fix: complete screenshot feature with missing GDScript autoload#65
sajadghawami wants to merge 2 commits intoCoding-Solo:mainfrom
sajadghawami:fix/screenshot-feature

Conversation

@sajadghawami
Copy link

Summary

Fixes the take_screenshot tool from PR #62 which didn't work because:

  1. The required ScreenshotManager GDScript autoload was never provided
  2. Unused dependencies (screenshot-desktop, axios) were added but never used

This PR completes the feature by:

  • Adding screenshot_manager.gd - GDScript autoload that captures viewport via file-based IPC
  • Adding setup_screenshot_manager tool to automatically install the autoload into projects
  • Updating build process to include the new script
  • Improving error messages with clearer setup instructions
  • Removing unused dependencies

How it works

  1. Call setup_screenshot_manager with project path to install the autoload
  2. Run the project with run_project
  3. Wait for the game to fully load
  4. Call take_screenshot to capture the viewport

Test plan

  • Build completes without errors
  • setup_screenshot_manager copies script and configures autoload in project.godot
  • run_project launches Godot project
  • take_screenshot captures viewport and returns base64 PNG
  • stop_project stops the running project

Closes #62

🤖 Generated with Claude Code

tylerhaar7 and others added 2 commits January 8, 2026 22:19
Add a new MCP tool that captures screenshots from running Godot projects
using Godot's native viewport capture API instead of external screen
capture libraries.

Features:
- Uses file-based IPC to communicate with running Godot project
- Cross-platform support (Windows, macOS, Linux)
- Returns screenshot as base64 image or saves to specified path
- Requires ScreenshotManager autoload in the Godot project

The implementation works by:
1. Creating a trigger file in Godot's user:// directory
2. ScreenshotManager autoload detects the file and captures viewport
3. Screenshot is saved and read back by the MCP server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add screenshot_manager.gd that captures viewport via file-based IPC
- Add setup_screenshot_manager tool to install autoload into projects
- Update build.js to copy screenshot_manager.gd to build/scripts
- Improve error messages with clearer setup instructions
- Remove unused dependencies (screenshot-desktop, axios)
- Delete unused screenshot-desktop.d.ts type declarations
- Add Claude Code files to .gitignore

The take_screenshot tool now works by:
1. User calls setup_screenshot_manager to install the autoload
2. User runs the project with run_project
3. User calls take_screenshot which creates a request file
4. The GDScript autoload detects the request and captures the viewport
5. Screenshot is returned as base64 PNG or saved to file

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.

2 participants