// DOCUMENTATION

Agents & MCP

Use Koko as an AI agent browser through MCP in Cursor and other hosts.

Getting Started

The fastest way to use Koko as an AI agent browser is through MCP (Model Context Protocol) — no TypeScript project required. Cursor and other MCP hosts connect to Koko tools for navigate, extract, and act.

Start the MCP server

koko mcp --browser-profile chrome-macos-catalina

Point your MCP host at the Koko server. In Cursor, configure the Koko MCP server in your MCP settings.

Typical agent loop

MCP tools follow the same order as the SDK agent examples:

  1. Navigate with waitUntil: "done" (default)
  2. LP.getSemanticTree — pruned accessibility DOM for the LLM
  3. LP.detectForms — form fields with stable backendNodeId
  4. LP.fillNode / LP.clickNode — act on nodes by ID, not fragile CSS
  5. LP.getMarkdown — token-efficient page text for summarization

SDK parity without Cursor

To verify the same semantics in CI:

node sdk/examples/agent-semantic.mjs --profile chrome-macos-catalina

When to use MCP vs SDK

MCPSDK
Cursor / IDE agentsTest suites and pipelines
Exploratory browsingCustom orchestration logic
No npm project neededProgrammatic control from Node/TS

Learn more