Koko implements MCP (Model Context Protocol) so AI agents can browse, extract, and act on pages through standardized tools — without writing custom CDP scripts for every workflow.
Launch MCP server
zig-out/bin/koko mcp --browser-profile chrome-macos-catalina
Cursor and other MCP hosts connect to the Koko MCP server and receive tools for navigation, extraction, and interaction.
Tool semantics
MCP tools mirror the SDK agent workflow ordering:
- Navigate with
waitUntil: "done"(default) LP.getSemanticTree— pruned accessibility DOM for LLMsLP.detectForms— form schema withbackendNodeIdLP.fillNode/LP.clickNode— stable backend-node actionsLP.getMarkdown— token-efficient page text
SDK parity
The SDK example sdk/examples/agent-semantic.mjs runs the same agent loop without Cursor — useful for CI smoke tests. Cursor users should prefer koko mcp for daily agent work.
When to use MCP vs SDK
| Use MCP when | Use SDK when |
|---|---|
| AI agent in Cursor/IDE | Programmatic test suites |
| Exploratory browsing | CI pipelines and benchmarks |
| No TypeScript project | Custom orchestration logic |
Implementation
MCP server code lives in src/protocols/mcp/ — router, tools, resources, and protocol handlers.