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:
- Navigate with
waitUntil: "done"(default) LP.getSemanticTree— pruned accessibility DOM for the LLMLP.detectForms— form fields with stablebackendNodeIdLP.fillNode/LP.clickNode— act on nodes by ID, not fragile CSSLP.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
| MCP | SDK |
|---|---|
| Cursor / IDE agents | Test suites and pipelines |
| Exploratory browsing | Custom orchestration logic |
| No npm project needed | Programmatic control from Node/TS |
Learn more
- MCP tools — protocol details and implementation
- LP CDP domain — extraction and NodeHandle APIs
- Agent extraction APIs — SDK equivalents