CUPComputer Use Protocol
MCP Integration

MCP Setup

Connect CUP to AI agents like Claude Code, Cursor, and Codex via the Model Context Protocol.

What is MCP?

The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools. CUP ships with a built-in MCP server that exposes 9 tools for UI perception and interaction.

Start the server

cup-mcp
# or
python -m cup.mcp
npx cup-mcp

Configure your agent

Add CUP to your agent's MCP configuration file (.mcp.json, mcp_config.json, etc.):

{
  "mcpServers": {
    "cup": {
      "command": "cup-mcp",
      "args": []
    }
  }
}
{
  "mcpServers": {
    "cup": {
      "command": "npx",
      "args": ["cup-mcp"]
    }
  }
}

Compatible agents

CUP's MCP server works with any MCP-compatible agent:

AgentConfiguration file
Claude Code.mcp.json in project root
CursorSettings > MCP Servers
CodexMCP configuration
Custom agentsAny MCP client implementation

CUP automatically detects your operating system and loads the appropriate platform adapter. No additional configuration is needed.

Advanced configuration

Web platform (CDP)

To capture Chrome/Chromium pages, see Web platform setup for launching Chrome with remote debugging, then configure the MCP server:

{
  "mcpServers": {
    "cup": {
      "command": "cup-mcp",
      "args": ["--platform", "web", "--cdp-port", "9222"]
    }
  }
}

Verbose mode

For debugging, enable verbose output:

{
  "mcpServers": {
    "cup": {
      "command": "cup-mcp",
      "args": ["--verbose"]
    }
  }
}

Best practices

Minimize token usage

  • Use find() to locate elements instead of repeatedly calling snapshot()
  • Use overview() (instant) to discover apps before snapshot_app()
  • Use screenshot() only when you need visual context the tree doesn't capture

Workflow

For the typical agent workflow (snapshot → find → action → verify), see the Quick Start.

On this page