Skip to content

feat: add proxy for native Gyazo MCP server tools #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yuiseki
Copy link
Member

@yuiseki yuiseki commented May 19, 2025

This pull request introduces native screen capture and upload functionality for Gyazo on Windows and macOS, integrating it into the existing toolset. The changes include a new module for managing the native MCP server, updates to the tool handlers to support capture-related operations, and enhancements to ensure graceful shutdown of resources.

New Native Capture Integration

  • New GyazoNativeMCPServer class: Added a singleton class in src/capture-proxy.ts to manage the lifecycle of the native MCP server, including initialization, request handling, and cleanup. It supports operations such as listing capturable windows, capturing the primary screen, capturing a selected region, and capturing a specific window.

Tool Handler Updates

  • Tool registration and availability checks: Updated the listToolsHandler in src/handlers/tools.ts to dynamically include native capture tools if the MCP server is available. These tools allow users to perform screen capture operations and upload results to Gyazo. [1] [2]
  • New tool handlers: Added handlers for native capture tools (gyazo_list_capturable_windows, gyazo_capture_and_upload_primary_screen, gyazo_capture_and_upload_region, and gyazo_capture_and_upload_window) to process requests and interact with the MCP server. [1] [2]

Graceful Shutdown Enhancements

  • Cleanup handlers: Added cleanup logic in src/index.ts to ensure the MCP server is properly shut down during application termination (e.g., on SIGINT, SIGTERM, or process exit).

Type Definitions

  • New types for capture operations: Defined CapturableWindow and CaptureUploadResponse types in src/types.ts to standardize data structures for capturable windows and capture responses.

@yuiseki yuiseki self-assigned this May 19, 2025
@yuiseki yuiseki marked this pull request as draft May 19, 2025 04:02
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