Skip to content

Implement OmniMCP for Claude computer control #946

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

Closed
wants to merge 14 commits into from
Closed

Conversation

abrichr
Copy link
Member

@abrichr abrichr commented Mar 16, 2025

OmniMCP Implementation

This PR adds OmniMCP, a system that enables Claude to control the computer through the Model Control Protocol (MCP). OmniMCP combines OmniParser's visual understanding with Claude's natural language capabilities to automate UI interactions.

Key Components

  1. OmniParser Adapter (openadapt/adapters/omniparser.py)

    • Client for communicating with OmniParser server
    • Processes screenshots to detect UI elements
    • Handles API communication with the remote service
  2. OmniMCP Core (openadapt/omnimcp.py)

    • Manages the visual state of the screen
    • Provides UI interaction methods (click, type, etc.)
    • Implements natural language processing with Claude
    • Supports normalized or absolute coordinates
  3. MCP Server (openadapt/mcp/server.py)

    • Implements the Model Control Protocol
    • Exposes UI automation tools to Claude
    • Enables structured tool usage
  4. CLI Runner (openadapt/run_omnimcp.py)

    • Provides multiple modes (CLI, server, debug)
    • Command-line interface using fire
    • Extensive documentation and usage examples

Usage

# Run CLI mode (direct command input)
python -m openadapt.run_omnimcp cli

# Run MCP server (for Claude Desktop)
python -m openadapt.run_omnimcp server

# Run in debug mode to visualize screen elements
python -m openadapt.run_omnimcp debug

Implementation Details

  • Uses pynput for keyboard and mouse control
  • Integrates with existing OpenAdapt utilities
  • Supports debugging with visual element highlighting
  • Comprehensive documentation and type hints
  • Configurable through command line or config.py

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

abrichr and others added 14 commits February 18, 2025 15:43
This new strategy:
1. Uses OmniParser for parsing visual state and Gemini 2.0 for evaluation
2. Takes natural language task descriptions instead of recording IDs
3. Processes coalesced actions from events.py
4. Builds and maintains a process graph where states are nodes and actions are edges

The graph is constructed before replay based on recording + task description,
and is updated during replay based on observed states. Uses Pydantic for
structured data handling and robust JSON parsing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit adds OmniMCP, a system that enables Claude to control the computer using the Model Control Protocol.

Key components:
- OmniParser adapter for UI element detection
- MCP server implementation
- CLI interface for commands and debugging
- Comprehensive documentation

OmniMCP combines OmniParser's visual understanding with Claude's natural language capabilities to automate UI interactions.
@abrichr
Copy link
Member Author

abrichr commented Mar 16, 2025

Closing in favor of PR #947, which contains a clean version of this implementation based on the current main branch.

@abrichr abrichr closed this Mar 16, 2025
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