Skip to main content

opendesk — Python SDK

Give any AI agent eyes and hands on your desktop.

macOS · Linux · Windows

PyPI Python License: MIT


Install

pip install 'opendesk[core,mcp]'
opendesk install

opendesk install registers the MCP server with Claude Code globally.


Quick start

import asyncio
from opendesk import create_registry, allow_all_context

async def main():
    registry = create_registry()
    ctx = allow_all_context()

    # Screenshot with Set-of-Marks
    shot = registry.get("screenshot")
    result = await shot.execute(ctx, shot.Params(marks=True))
    print(result.output)

    # Click a button by name — no coordinates needed
    ui = registry.get("ui")
    await ui.execute(ctx, ui.Params(action="click", app="TextEdit", title="File"))

asyncio.run(main())

Installation options

pip install opendesk                              # core framework only
pip install 'opendesk[core,mcp]'                  # + screen capture + MCP server (recommended)
pip install 'opendesk[core,mcp,learn]'            # + task recording and replay
pip install 'opendesk[core,mcp,learn,schedule]'   # + scheduled tasks
pip install 'opendesk[core,mcp,remote]'           # + remote machine control
pip install 'opendesk[all]'                       # everything

Tools

Tool What it does
screenshot Capture screen with Set-of-Marks on every interactive element
ui Click and type by element name — no coordinates needed
mouse Pixel-level mouse control for anything ui can't reach
keyboard Type text, press keys, send hotkeys
app Open, close, and focus applications
clipboard Read and write the system clipboard
ocr Extract text from any region of the screen
learn Record a workflow once, replay it anytime
schedule Run any task on a timer
audit Show the session audit log in any MCP session

Full reference: docs/tools.md


Remote machine control

opendesk supports controlling remote machines over an encrypted WebSocket connection with mDNS peer discovery.

# On the machine to be controlled:
pip install 'opendesk[core,mcp,remote]'
opendesk pair            # prints a pairing code

# On the controlling machine:
opendesk pair-with <host> <code>
opendesk serve           # start the server

See docs/remote.md and docs/protocol.md for full details.


MCP integrations

Claude Code

opendesk install        # register globally
opendesk uninstall      # remove

Claude Desktop

{
  "mcpServers": {
    "opendesk": { "command": "opendesk-mcp" }
  }
}

Cursor / Continue

{
  "mcpServers": [{ "name": "opendesk", "command": "opendesk-mcp", "transport": "stdio" }]
}

Agent integrations

Anthropic SDK

import anthropic
from opendesk.integrations.claude_code import ClaudeCodeAdapter
from opendesk.registry import create_registry

client = anthropic.Anthropic()
adapter = ClaudeCodeAdapter(create_registry())

result = await adapter.run_loop(
    client=client,
    model="claude-opus-4-6",
    messages=[{"role": "user", "content": "Open TextEdit and type Hello."}],
    system="Use the ui tool first. Mouse is a last resort.",
)

OpenAI / on-device models (Ollama, vLLM, llama.cpp)

from openai import OpenAI
from opendesk.integrations.openai_compat import OpenAIAdapter

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
adapter = OpenAIAdapter()
result = await adapter.run_loop(client, model="qwen2.5:72b", messages=messages)

LangChain

from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent
from opendesk.integrations.langchain_compat import as_langchain_tools
from opendesk.registry import create_registry

tools = as_langchain_tools(create_registry())
agent = create_react_agent(ChatAnthropic(model="claude-opus-4-6"), tools)

Build from source

cd python
pip install -e '.[core,mcp]'

Docs

License

MIT

Release files for opendesk 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opendesk 0.2.0
File Size Uploaded
opendesk-0.2.0.tar.gz 184.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opendesk 0.2.0
File Interpreter ABI Platform
opendesk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 357.7 kB

Release files / opendesk-0.2.0.tar.gz

Download URL opendesk-0.2.0.tar.gz
Size 184.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c3ee53fe8fd4e09e95dda656cf56fef2e07bcc98d3309cff81fa4030ad2b7d58
BLAKE2b-256 checksum
How to use checksums
7bb7390ea8576432a6760c7807c86c2bd6911aa6c256469334b91d2baeece4fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release files / opendesk-0.2.0-py3-none-any.whl

Download URL opendesk-0.2.0-py3-none-any.whl
Size 172.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3747a993776f4e01f929f1f5af0f20cdf77bbce70b6d6b489f6535fe9b85f39b
BLAKE2b-256 checksum
How to use checksums
09a4e3ad5ebf9e61f6c165d4a848dc4976a6c91fce998b3a68e0bdf3c2180f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page