Deterministic MCP-first browser automation runtime for coding agents
Project description
agentyc
Deterministic, MCP-first browser automation for coding agents.
agentyc ships a public stdio MCP server for Chrome or Chromium automation plus the Python session primitives that back that server. The public contract is centered on deterministic browser control, token-aware state snapshots, and deterministic extraction without LLM fallback.
What It Is
- Public stdio MCP server exposed by the
agentycconsole script. - Browser control over CDP through
agentyc.mcp.server,agentyc.tools.service,agentyc.mcp.state, andagentyc.browser.session. - Deterministic extraction routes in
agentyc.tools.extraction.routerfor common page structures. - Python imports such as
AgentycServer,BrowserSession,BrowserProfile, andToolsfor direct embedding.
The default MCP path does not require an API key for navigation, interaction, state inspection, screenshots, HTML access, cookies, or deterministic extraction.
Install
uv tool install agentyc
From source:
uv venv --python 3.11
source .venv/bin/activate
uv sync --dev
Bootstrap Your Agent
Run this once in your project directory to write a usage guide your coding agent can read:
agentyc init
This copies the packaged skills guide to agentyc-skill.md by default, or to a custom destination with --output. The guide covers the read->ref->act loop, since_hash polling, dynamic-text waits, error recovery, long-page search patterns, multi-tab handoff, extraction routes, auth persistence, and common pitfalls. Point Claude Code, Cursor, or Copilot at the generated file.
agentyc init --print # print to stdout instead of writing a file
agentyc init --force # overwrite an existing file
agentyc init --output my.md # custom destination
Run The MCP Server
Start the stdio MCP server:
agentyc
Equivalent explicit form:
agentyc mcp
Override the idle timeout for the browser session (default: never auto-close):
agentyc --session-timeout-minutes 20
Shared-browser collaboration flags are also available on agentyc mcp and the no-subcommand form:
--runtime-label--runtime-role--parent-runtime-id--shared-browser-mode--shared-browser-window-bounds--shared-browser-focus-policy
Shared Browser Mode
Launch a Chrome or Chromium instance with remote debugging enabled and print its CDP WebSocket URL:
agentyc browser --detach
Attach the MCP server to that browser instead of launching a separate browser process:
agentyc mcp --cdp-url ws://127.0.0.1:9222/devtools/browser/...
Current shared-browser behavior is intentionally narrow:
- Each attached MCP server creates a collaboration target in the shared browser: a tab by default, or a separate window when
--shared-browser-mode windowis used. - Attach and
new_tab=trueflows update the runtime's focused target automatically. - Visible browser activation is controlled by
--shared-browser-focus-policy:preserveavoids stealing the human-focused surface, whileactivateexplicitly foregrounds the runtime target. browser_get_stateandbrowser_list_tabssurface ownership metadata, display titles, and optional window bounds for shared-browser targets.- Stock Chrome and CDP do not provide reliable per-tab color ownership cues.
- Shared-browser workflows should be treated as best-effort collaboration, not hard isolation.
MCP Tool Surface
Navigation and state:
browser_navigatebrowser_go_backbrowser_go_forwardbrowser_refreshbrowser_waitbrowser_wait_for_network_idlebrowser_get_statebrowser_get_htmlbrowser_screenshot
Interaction:
browser_clickbrowser_right_clickbrowser_double_clickbrowser_hoverbrowser_drag_tobrowser_typebrowser_press_keybrowser_scrollbrowser_scroll_to_textbrowser_select_optionbrowser_get_dropdown_optionsbrowser_upload_file
Inspection and extraction:
browser_extract_contentbrowser_find_elementsbrowser_search_pagebrowser_wait_for_elementbrowser_get_focused_elementbrowser_evaluate
Tabs, cookies, and session state:
browser_list_tabsbrowser_switch_tabbrowser_close_tabbrowser_get_cookiesbrowser_set_cookiesbrowser_clear_cookiesbrowser_save_statebrowser_load_state
Observability and lifecycle:
browser_get_console_logsbrowser_get_network_logbrowser_list_sessionsbrowser_close_sessionbrowser_close_all
The public server exposes tools only. It does not publish MCP resources or prompts.
Perceived Speed
agentyc can help clients separate browser work from agent thinking time:
- MCP callers may provide a
progressTokenon tool calls; agentyc emitsnotifications/progressfor long-running browser steps when present. - Tool results include
_metatiming fields such asagentyc/browser_duration_msand a shortagentyc/tool_phaselabel on the first text content block. - Agents should prefer
browser_get_state(mode="min"),browser_get_state(mode="focus"), andsince_hashpolling over repeated full-state reads. - Agents should narrate intent briefly before a likely pause, for example
Waiting for validation to finish.
This makes a live session feel responsive even when the browser is fast and the model is still deciding what to do next.
State And Element Targeting
browser_get_state is the primary inspection primitive.
- Stable element refs such as
e123are derived from backend node ids. modesupportsauto,full,min, andfocus.since_hashallows unchanged-state checks without resending interactive element payloads.- Compact state payloads can surface
compaction_strategy, truncation counts, ownership, and runtime metadata when relevant. - Screenshots are returned as MCP image content, with JSON metadata in a separate text payload.
For best interactive performance, start with mode="min" and escalate to full only when the compact payload omitted an element you actually need.
Prefer refs from browser_get_state over legacy numeric index arguments.
Deterministic Extraction
browser_extract_content in the public MCP server is deterministic-only.
- No LLM fallback is used in the public server.
- Compatible routes include links, link collections, images, tables, lists, form fields, and key-value blocks.
output_schemais supported when the query matches a deterministic route.- Unsupported free-form requests return an explicit error instead of silently degrading.
- Responses include
<extraction_metadata>describing the route and truncation state.
This means the default extraction path works without any API key.
Python Surface
The package also exposes Python imports for direct integration:
from agentyc import AgentycServer, BrowserProfile, BrowserSession, Tools
The public product story is still MCP-first. Direct Python usage is available for embedding or lower-level control.
Development
./scripts/lint.sh
./scripts/test.sh
uv build
Docs
docs/overview.mddocs/features.mddocs/architecture.mddocs/api.mddocs/configuration.mddocs/release-gate.mddocs/tech-stack.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentyc-0.2.10.tar.gz.
File metadata
- Download URL: agentyc-0.2.10.tar.gz
- Upload date:
- Size: 407.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6027b7511a7b06c42c7e10356bb2efadf6fad353a0bb7f5a3da0978499d72505
|
|
| MD5 |
79b13cd31c07c202e37d6f413ab83f3a
|
|
| BLAKE2b-256 |
9190c2d36d9c458cb036f94b8b0de5f91ea37d3d10ab6bcc7fb535c215c124fb
|
File details
Details for the file agentyc-0.2.10-py3-none-any.whl.
File metadata
- Download URL: agentyc-0.2.10-py3-none-any.whl
- Upload date:
- Size: 513.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf3637fc12f651870a4d0cb8c186c6e586f559d0c95760c5229a1da8b4cab8f6
|
|
| MD5 |
f97e9063a5cc7d875314bd55b68711a8
|
|
| BLAKE2b-256 |
7eabbee3e18d09ce4df6436f80eed0e77836670108a78da39b45abfe8f1e02c0
|