Logo vun OculOS

OculOS

Communautéit
huseyinstif

If it's on the screen, it's an API. Control any desktop app via REST + MCP. Rust.

Editeurhuseyinstif
Repositoryoculos
SproochRust
Forks
19
Stären
132
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    OculOS stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    132 Stären an 19 Forks aus dem verlinkte Repository.


OculOS is a lightweight daemon that reads the OS accessibility tree and exposes every button, text field, checkbox, and menu item as a JSON endpoint. It works as a REST API for scripts, testing, and CI/CD — and as an MCP server for AI agents like Claude, Cursor, and Windsurf.

No screenshots. No pixel coordinates. No browser extensions. No code injection. No AI required. Just structured JSON.


Demo — Claude Code + OculOS → Calculator (5×5=25)

Claude Code uses OculOS MCP tools to open Calculator, find buttons, click 5 × 5 =, and read the result — fully autonomous.

Claude Code + OculOS → Spotify

Claude Code uses OculOS MCP tools to find Spotify, focus it, search for a song, and play it — fully autonomous.

Web Dashboard

Built-in dashboard with window list, interactive element tree, inspector, recorder, and live WebSocket events.


Quick Start

bash
git clone https://github.com/huseyinstif/oculos.git
cd oculos
cargo build --release

macOS: Grant Accessibility Permission

OculOS reads the OS accessibility tree, so macOS requires you to grant permission:

  1. Open System Settings → Privacy & Security → Accessibility
  2. Click the lock icon and enter your password
  3. Click + and add your terminal app (Terminal, iTerm2, Windsurf, etc.) or the oculos binary itself
  4. Make sure the toggle is enabled

Without this permission, OculOS can list windows but cannot read UI elements or interact with them.

HTTP mode (API + Dashboard)

bash
./target/release/oculos
# API       → http://127.0.0.1:7878
# Dashboard → http://127.0.0.1:7878

MCP mode (for AI agents)

bash
./target/release/oculos --mcp

How It Works

OculOS reads the OS accessibility tree and assigns each UI element a session-scoped UUID (oculos_id). You use that ID to interact.

bash
# 1. List open windows
curl http://localhost:7878/windows

# 2. Get the UI tree for a window
curl http://localhost:7878/windows/{pid}/tree

# 3. Find a specific element
curl "http://localhost:7878/windows/{pid}/find?q=Submit&type=Button"

# 4. Click it
curl -X POST http://localhost:7878/interact/{id}/click

# 5. Type into a text field
curl -X POST http://localhost:7878/interact/{id}/set-text \
  -H "Content-Type: application/json" \
  -d '{"text":"hello world"}'

Every element includes an actions array — the API tells you exactly what you can do:

json
{
  "oculos_id": "a3f8c2d1-...",
  "type": "Button",
  "label": "Submit",
  "enabled": true,
  "actions": ["click", "focus"],
  "rect": { "x": 120, "y": 340, "width": 80, "height": 32 }
}

API

Discovery

EndpointDescription
GET /windowsList all visible windows
GET /windows/{pid}/treeFull UI element tree
GET /windows/{pid}/find?q=&type=&interactive=Search elements
GET /hwnd/{hwnd}/treeTree by window handle
GET /hwnd/{hwnd}/findSearch by window handle

Window operations

EndpointDescription
POST /windows/{pid}/focusBring to foreground
POST /windows/{pid}/closeClose gracefully
GET /windows/{pid}/wait?q=&type=&timeout=Wait for element to appear (polls, default 5s)
GET /windows/{pid}/screenshotCapture window as PNG

Element interactions

EndpointBodyDescription
POST /interact/{id}/click—Click
POST /interact/{id}/set-text{"text":"…"}Replace text content
POST /interact/{id}/send-keys{"keys":"…"}Keyboard input
POST /interact/{id}/focus—Move focus
POST /interact/{id}/toggle—Toggle checkbox
POST /interact/{id}/expand—Expand dropdown / tree
POST /interact/{id}/collapse—Collapse
POST /interact/{id}/select—Select list item
POST /interact/{id}/set-range{"value":N}Set slider value
POST /interact/{id}/scroll{"direction":"…"}Scroll container
POST /interact/{id}/scroll-into-view—Scroll into viewport
POST /interact/{id}/highlight{"duration_ms":N}Highlight on screen
POST /interact/batch{"actions":[...]}Execute multiple interactions

System

EndpointDescription
GET /healthStatus, version, uptime
GET /wsWebSocket (live action events)

MCP Setup

Works with any MCP-compatible client. Add to your config:

json
{
  "mcpServers": {
    "oculos": {
      "command": "/path/to/oculos",
      "args": ["--mcp"]
    }
  }
}

Tested with: Claude Code, Claude Desktop, Cursor, Windsurf

For non-MCP agents (OpenAI, Gemini, custom), paste AGENTS.md into the system prompt and give the agent HTTP access.


Dashboard

Built-in web UI at http://127.0.0.1:7878:

  • Window list — all open windows with focus/close buttons
  • Element tree — full interactive UI tree with search and filter
  • Inspector — element details, properties, and all available actions
  • Recorder — record a sequence of interactions, export as Python, JavaScript, or curl
  • JSON viewer — raw element data with copy
  • WebSocket — live event indicator, real-time action feed
  • Shortcuts — R refresh · / search · E expand · C collapse · H highlight · J JSON

Platform Support

PlatformBackendStatus
WindowsUI Automation (windows-rs)✅ Full — Win32, WPF, Electron, Qt
LinuxAT-SPI2 (atspi + zbus)✅ Working — GTK, Qt, Electron
macOSAccessibility API (AXUIElement + CoreGraphics)✅ Working — Cocoa, Electron, Qt

App Compatibility

App typeCoverageNotes
Win32 / WPF / WinFormsExcellentFull deep tree, all interactions
GTK / QtExcellentFull tree on all platforms
Electron (Spotify, VS Code, Slack, Chrome)GoodKey interactive elements exposed; tree is shallower than native
Cocoa (macOS native)GoodStandard controls fully exposed
Custom-drawn / OpenGL / DirectXPoorMinimal or no accessibility tree — games, CAD, etc.

Tip: Run curl "localhost:7878/windows/{pid}/find?interactive=true" to see what's available for any app.


Client SDKs

Official wrappers for the REST API. Install from source (PyPI/npm packages coming soon):

Python

bash
cd sdk/python
pip install .
python
from oculos import OculOS

client = OculOS()
windows = client.list_windows()
client.click(element_id)
client.set_text(element_id, "hello world")

See sdk/python for full docs.

TypeScript

bash
cd sdk/typescript
npm install
npm run build
typescript
import { OculOS } from "./sdk/typescript/src/index";

const client = new OculOS();
const windows = await client.listWindows();
await client.click(elementId);
await client.setText(elementId, "hello world");

See sdk/typescript for full docs.


CLI

oculos [OPTIONS]

  -b, --bind <ADDR>       Bind address [default: 127.0.0.1:7878]
      --static-dir <DIR>  Static files directory [default: static]
      --log <LEVEL>       Log level: trace/debug/info/warn/error [default: info]
      --mcp               Run as MCP server over stdin/stdout
  -h, --help              Print help

How OculOS Differs

OculOSVision agentsScreen coordinate toolsBrowser-only tools
ApproachOS accessibility treeScreenshots + LLMPixel positionsDOM / a11y tree
ScopeAny desktop appAny (with latency)Any (fragile)Browser only
SpeedInstantSecondsInstantInstant
Deterministic✅❌✅✅
GPU required❌✅❌❌
Cloud required❌Usually❌❌
Semantic✅ Labels + typesVaries❌ Coordinates✅

Everything Built So Far

Core

  • Windows UIA backend (full — Win32, WPF, Electron, Qt)
  • Linux AT-SPI2 backend
  • macOS Accessibility backend (AXUIElement, CoreGraphics window enumeration, CGEvent keyboard simulation)
  • REST API server (Axum)
  • MCP server (JSON-RPC 2.0 over stdio)
  • Session-scoped element registry with UUIDs
  • Full keyboard simulation engine

Dashboard

  • Window list with focus/close
  • Interactive element tree with search/filter
  • Element inspector with all actions
  • API request log
  • JSON viewer with copy
  • Keyboard shortcuts

Advanced

  • Element highlighting (native GDI overlay)
  • Automation recorder (record + export Python/JS/curl)
  • WebSocket live events
  • Health endpoint (uptime, version, platform)

Planned

  • macOS element highlighting (native overlay)
  • Python & TypeScript client SDKs
  • Batch operations (multiple interactions per request)
  • Conditional waits (/wait endpoint with timeout)
  • Screenshot capture (/screenshot endpoint)
  • GitHub Actions CI (Windows, Linux, macOS)
  • Docker image for CI/CD
  • OpenAPI spec
  • --version CLI flag
  • Element caching & diffing (change detection)
  • PyPI / npm SDK publishing

Contributing

We welcome contributions! See CONTRIBUTING.md for details.

Top areas:

  • Tests — cross-app integration tests
  • macOS highlight — native overlay for element highlighting
  • Element caching — change detection & diffing
  • Documentation — guides, examples, tutorials

License

MIT

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "huseyinstif-oculos": {
      "command": "",
      "args": []
    }
  }
}

OculOS MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal OculOS verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

OculOS als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu OculOS an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "huseyinstif-oculos": {
      "command": "npx",
      "args": [
        "-y",
        "oculos"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu OculOS. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu OculOS.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat OculOS?
OculOS
Jo. Ech hunn et gelies.
Dat hunn ech mat OculOS fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server OculOS benotzt?

OculOS ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech OculOS MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir OculOS mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat OculOS MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann OculOS verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech OculOS MCP mat TypingMind?

OculOS leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt OculOS MCP an TypingMind zur Verfügung?

OculOS stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir OculOS MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann OculOS eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇