# Drowse for developers and browser agents

Drowse exposes typed tools to visiting browser agents through experimental WebMCP. Its separate Python edition provides a library and HTTP server. Select the interface that matches where the model runs: inside the user's browser or on a machine running Drowse's Python runtime.

Resource: https://drowse.ai/developers.md

## Discover the current browser workspace

Open the app and load a compatible model before using the workspace example below. Start with state and action discovery, inspect a tool's schema and availability, then select its task group and discover the registered tools again. Public-page and model-onboarding tools are available before a workspace opens; steering tools require the loaded workspace. Selecting a group does not navigate or change model settings.

- Use drowse_explain_control to inspect units, applicability, defaults, and interactions before changing a setting.
- Groups cover chat, raw completion, steering, saved chats, appearance, models, artifacts, templates, profiles, conversation trees, analysis, instruments, files, interface controls, and authoring. Read the current group list from drowse_list_actions.
- Use drowse_list_actions with catalogue: true to inspect coverage, unavailable operations, and actions requiring a browser interaction.

```
drowse_get_state({})
drowse_list_actions({})
drowse_list_actions({action: "drowse_set_steering"})
drowse_select_tool_group({group: "steering"})
drowse_list_actions({group: "steering"})
```

- [WebMCP integration guide](https://github.com/a9lim/drowse/blob/main/webui/docs/webmcp.md)
- [Tool discovery implementation](https://github.com/a9lim/drowse/blob/main/webui/src/lib/webmcp/index.ts)

## Track operations to completion

Tools return structured success or error results. Mutation tools accept expected_revision to reject stale edits and request_id to reconcile an uncertain invocation. Reuse a request ID only with identical input. Long operations return a job ID. Read status with drowse_get_job, or request cancellation with drowse_cancel_job.

Job history may survive a reload in the same tab when browser storage permits. For an interrupted generation, open its original model and call drowse_reconcile_job with the job_id. This checks runtime receipts without repeating generation. It may restore the original system prompt after a comparison, while preserving newer prompt edits. Inspect the returned state and any partial results; reading status alone does not reconcile a job.

Large-result handles can expire and do not survive reloads. Read their chunks with drowse_read_result before leaving. Preserve existing drafts and act within the user's authorization when sending a contact message or deleting their work.

- [Job and recovery implementation](https://github.com/a9lim/drowse/blob/main/webui/src/lib/webmcp/jobs.ts)
- [Revision and result contracts](https://github.com/a9lim/drowse/blob/main/webui/docs/webmcp.md#discovery-and-execution)

## Understand WebMCP availability

Drowse registers tools through document.modelContext.registerTool when the browser exposes that experimental API. Browser and agent support are separate requirements; unsupported browsers retain the ordinary interface. The hosted website does not expose a public remote MCP inference endpoint.

Browser tools can generate, inspect, compare, and fit compatible manifolds and templates locally. SAE training and J-lens fitting require Python; the browser consumes compatible precomputed packs. File pickers, credential entry, and some archive operations retain their existing interaction requirements.

- [Browser capability boundaries](https://github.com/a9lim/drowse/blob/main/webui/src/hosted/runtime/capabilities.ts)
- [Chrome WebMCP documentation](https://developer.chrome.com/docs/ai/webmcp)

## Use the Python library and local inference APIs

The Python import and CLI are drowse; the distribution name is drowse.ai. DrowseSession supports programmatic steering and measurement. Running drowse serve starts the dashboard and OpenAI-compatible /v1/*, Ollama-compatible /api/*, and native /drowse/v1/* routes on the configured server.

Inspect that server's /openapi.json and /docs for its HTTP schema. These are Python-server routes, not hosted-site inference services. Configure authentication and network access for your own installation, and follow the repository's current installation instructions.

- [Python API](https://github.com/a9lim/drowse/blob/main/README.md#python-api)
- [Server implementation and OpenAPI configuration](https://github.com/a9lim/drowse/blob/main/drowse/server/app.py)
- [Install from source](https://github.com/a9lim/drowse/blob/main/README.md#quick-start)

[Documentation index](https://drowse.ai/llms.txt) · [Open Drowse](https://drowse.ai/app) · [Source code](https://github.com/a9lim/drowse)
