MCP 클라이언트를 통해 웹 브라우징이나 데스크톱 제어가 가능한 자율형 컴퓨터 사용 에이전트를 실행하고 관리합니다.
다른 이름 hcompai/hai-agents-python, hai-agents-python
- 스타
- 46
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- 1.0.0
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- MIT
Computer-Use Agents API MCP란?
Computer-Use Agents API은(는) MCP server입니다. MCP 클라이언트를 통해 웹 브라우징이나 데스크톱 제어가 가능한 자율형 컴퓨터 사용 에이전트를 실행하고 관리합니다.
프로젝트 README에서 생성된 요약
Computer-Use Agents API MCP server 정보
Computer-Use Agents API는 웹 브라우징과 데스크톱 제어가 가능한 자율형 에이전트를 관리하기 위한 Python SDK와 CLI를 제공합니다. 개발자는 holo mcp install 명령어를 통해 Cursor, Claude Code, Codex와 같은 에디터를 지원하는 MCP 클라이언트에 이러한 에이전트를 배포할 수 있습니다. 이 시스템은 호스팅된 에이전트 실행과 --local 플래그를 통한 로컬 실행을 모두 지원하여 사용자의 기기에서 직접 에이전트 루프를 실행할 수 있습니다.
사용자는 웹 작업을 위한 h/web-surfer-pro나 마우스 및 키보드 입력을 사용하여 로컬 데스크톱을 제어하는 h/holo-desktop과 같은 특정 에이전트와 상호작용할 수 있습니다. API 인증을 위해서는 HAI_API_KEY가 필요하며, 이는 holo login 명령어를 통해 관리할 수 있습니다. 이 플랫폼은 Pydantic 모델을 사용한 구조화된 출력, 커스텀 Python 도구, 그리고 다양한 작업 간에 세션 상태를 유지하기 위한 브라우저 프로필과 같은 고급 기능을 지원합니다.
활용 사례
- 1자동 웹 리서치AI 클라이언트가 web-surfer-pro 에이전트를 사용하여 뉴스 사이트에서 특정 정보를 찾아 요약할 수 있습니다.
- 2데스크톱 애플리케이션 제어개발자가 에이전트에게 컴퓨터 데스크톱을 제어하도록 지시하여 로컬 소프트웨어와 상호작용하게 할 수 있습니다.
- 3자동 데이터 추출Pydantic 모델을 사용하여 에이전트가 특정 JSON 형식으로 정보를 반환하도록 요청할 수 있습니다.
- 4다요소 인증 처리에이전트가 특화된 도구를 사용하여 일회용 비밀번호가 필요한 로그인 화면을 탐색할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Computer-Use Agents API MCP 설치 방법
형식 확인: 2026년 11월 10일Claude Code에 Computer-Use Agents API MCP 설치
$ claude mcp add --transport http hai-agents-python https://agp.hcompany.ai/mcpCursor에 Computer-Use Agents API MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"hai-agents-python": {
"url": "https://agp.hcompany.ai/mcp"
}
}
}VS Code에 Computer-Use Agents API MCP 설치
.vscode/mcp.json
{
"servers": {
"hai-agents-python": {
"type": "http",
"url": "https://agp.hcompany.ai/mcp"
}
}
}Codex에 Computer-Use Agents API MCP 설치
~/.codex/config.toml
[mcp_servers.hai-agents-python] url = "https://agp.hcompany.ai/mcp"
Gemini CLI에 Computer-Use Agents API MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"hai-agents-python": {
"httpUrl": "https://agp.hcompany.ai/mcp"
}
}
}구성
HAI_API_KEY
| 이름 | 설명 | 유형 |
|---|---|---|
| HAI_API_KEY | — |
자동 검사
2026년 11월 12일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 모델에 대한 숨겨진 지침 없음통과
- 패키지와 의존성에 심각한 보안 권고 없음검사되지 않음
README
GitHub에서 보기Contents
- Installation
- Quickstart: command line
- Quickstart: Python
- Command line
- Python SDK guides
- Documentation
Installation
pip install "hai-agents[cli]" # SDK and the holo command
pip install hai-agents # SDK only
Python 3.10 or newer is required.
Quickstart: command line
pip install "hai-agents[cli]"
holo login
holo "What's the top story on Hacker News?"
holo login signs you in with Google in the browser, or takes a key you paste with holo login --key, and stores it in ~/.config/hai/.env. Any command does the same on first use in a terminal, so this step is optional. The task then runs on a hosted agent with its own browser: its steps stream to your terminal, and its answer prints at the end. In a terminal you can follow up on the same session, or run holo alone to start an interactive session.
Quickstart: Python
Get an API key at platform.hcompany.ai/settings/api-keys and export it, or run holo login once:
export HAI_API_KEY=hk-...
Launch the built-in h/web-surfer-pro agent, which ships with its own browser, and describe the task in plain language. run_session polls until the agent finishes and returns the final answer.
from hai_agents import Client
client = Client()
result = client.run_session(
agent="h/web-surfer-pro",
messages="What are the top 3 stories on Hacker News right now?",
)
print(result.status)
print(result.answer)
Client() reads HAI_API_KEY from the environment, else the key holo login stored in ~/.config/hai/.env.
result is a SessionRunResult: id, status, answer, the accumulated events, and final_changes.
Command line
The cli extra installs the holo command, also available as hai.
holo "What's the top story on Hacker News?" # run one task
holo # interactive session
holo -a h/web-surfer-pro "Compare 3 laptops" # pick an agent for one run
holo agents use h/web-surfer-pro # change the default agent
holo -a h/holo-desktop "Open Calculator" # drive this machine's desktop
holo --local "Summarize news.ycombinator.com" # run the agent loop on this machine
holo sessions watch <session-id> # follow a running session
holo mcp install # add the MCP server to your editor
Tasks run on h/web-surfer-flash unless you pass --agent or set a default with holo agents use. Run holo --help, or holo <command> --help, for every option.
~/.holo/agents.md joins the instructions of every agent holo runs, and ~/.holo/skills/<name>/SKILL.md joins its skills.
Interactive sessions
holo in a terminal opens a session you talk to in plain words. Each message continues the same session, with its browser and context, until you start fresh with /new.
| Key | Action |
|---|---|
| type, then enter | message the agent while it works |
| esc | pause the agent; esc again resumes |
/answer |
ask the agent to answer now |
/ |
list commands: /new, /retry, /resume, /agent, /live, /share, /status, /copy |
? |
all shortcuts |
| ctrl+c | cancel the turn; twice to exit |
An agent that drives this desktop, like h/holo-desktop, uses your mouse and keyboard, so typing goes to your apps instead: press esc twice, from any app, to stop it.
Commands
| Command | What it does |
|---|---|
holo run <task> |
run one task; same as holo <task> |
holo chat |
start an interactive session |
holo sessions |
list, status, watch, events, send, cancel, share sessions |
holo agents |
list agents, get one, use one as the default |
holo skills |
browse available skills |
holo mcp install |
let Cursor, Claude Code, Codex, and other MCP clients run agents through holo mcp; --remote adds the hosted server instead |
holo local |
serve a browser or desktop on this machine for a session started elsewhere |
holo login, logout, whoami, doctor |
manage and check your credentials and setup |
Scripts and CI
Scripts never prompt. Set HAI_API_KEY, or pipe a key into holo login --key, then use --json for machine-readable output or -q for the answer alone:
holo --json run "What's the top story on Hacker News?" | jq -r .answer
holo run -q "What's the top story on Hacker News?" > answer.txt
--json prints session_id, status, answer, outcome, error, error_code, and agent_view_url. The exit code is 0 when the session completes and 1 otherwise.
Credentials resolve from --api-key, then HAI_API_KEY, then ~/.config/hai/.env.
Python SDK guides
How a session works
A session is one run of an agent against a task. It moves through a small set of states: pending, running, and then a settled state such as completed, idle, failed, timed_out, or interrupted.
You drive a session two ways. run_session creates it and blocks until it settles, which suits one-shot tasks. start_session creates it and returns a handle right away, so you can read and steer the agent while it works.
session = client.start_session(
agent="h/web-surfer-pro",
messages="Find the top story on Hacker News",
)
print(session.id)
result = session.wait_for_completion()
print(result.status, result.answer)
Watch and steer a running session
A handle bound to the session id exposes the full lifecycle. Read the agent's progress at three levels of detail:
session.status()
session.changes(from_index=0)
session.get()
status() is a cheap snapshot with the state, step count, and token usage. changes(from_index=0) long-polls for new events and the final answer. get() returns the full Session resource.
While the session is not in a terminal state, you can intervene:
session.send_message({"type": "user_message", "message": "Only consider the last 24 hours"})
session.pause()
session.resume()
session.force_answer()
session.cancel()
send_message redirects the agent on its next step and wakes an idle session. pause halts with state preserved until resume. force_answer makes the agent stop exploring and answer from what it has. cancel ends the session as interrupted.
Multi-turn sessions
By default a session ends as soon as the agent answers. Set idle_timeout_s to keep it open: after each answer the session goes idle and waits that long for your next message, carrying its full context and browser state across turns.
session = client.start_session(
agent="h/web-surfer-pro",
idle_timeout_s=600,
messages="Find the top story on Hacker News",
)
first = session.wait_for_completion()
session.send_message({"type": "user_message", "message": "Now summarize its comments"})
second = session.wait_for_completion()
Structured output
Pass a pydantic model as answer_schema and the agent's final answer comes back as a validated instance. The model's JSON schema is sent as the agent's answer format; the raw wire value stays at result.final_changes.answer.
from pydantic import BaseModel
from hai_agents import Client
class Job(BaseModel):
title: str
company: str
class Jobs(BaseModel):
jobs: list[Job]
client = Client()
result = client.run_session(
agent="h/web-surfer-pro",
messages="Find 3 open ML engineering roles in Paris.",
answer_schema=Jobs,
)
for job in result.answer.jobs:
print(job.title, "@", job.company)
A completed answer that does not match the schema raises AnswerValidationError, with the raw payload on .raw. Sessions that end without completing return their raw answer untouched.
Custom tools
Expose your own Python functions to the agent. Pass them to run_session and the polling loop runs each one when the agent calls it, then posts the result back so the session continues. Any function with typed parameters and a docstring works; the input schema is derived from the signature.
from hai_agents import Client
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"Sunny in {city}"
client = Client()
result = client.run_session(
agent="h/web-surfer-pro",
messages="What should I wear in Paris today?",
tools=[get_weather],
)
Use the @tool decorator to override the name or description:
from hai_agents import tool
@tool(name="lookup_order", description="Look up an order by its id.")
def lookup(order_id: str) -> dict:
return {"id": order_id, "status": "shipped"}
A tool that raises is reported to the agent as a tool error rather than crashing the run. With AsyncClient, tools may be async def.
Prebuilt: one-time passwords (2FA)
hai_agents_tools ships ready-made tools. otp_tool lets the agent ask for a one-time password, verification code, or confirmation link when a login or signup step needs one. Without a handler it prompts on stdin; imap_otp_handler reads the code straight from a mailbox over IMAP (for Gmail, use an app password).
import os
from hai_agents import Client
from hai_agents_tools import imap_otp_handler, otp_tool
handler = imap_otp_handler(
host="imap.gmail.com",
username="agent-inbox@gmail.com",
password=os.environ["GMAIL_APP_PASSWORD"],
)
client = Client()
result = client.run_session(
agent="h/web-surfer-pro",
messages="Log in to example.com and check for new notifications",
tools=[otp_tool(handler)],
)
Like every custom tool, the handler runs entirely in your process: the IMAP credentials never leave your machine, and the agent only receives the single extracted code or link -- never mailbox contents.
Browser profiles and vaults
Start a session on a browser that already knows the user. A browser profile restores saved cookies and storage from an earlier session, and a vault lets the agent sign in to sites with secrets that never enter its context. Bind both through per-run overrides:
result = client.run_session(
agent="h/web-surfer-pro",
messages="Open my dashboard and report any new alerts",
overrides={
"agent.environments[kind=web].browser_profile_id": "<profile-id>",
"agent.environments[kind=web].vault_id": "<vault-id>",
},
)
Async
AsyncClient mirrors Client for asyncio. Every session method is a coroutine.
import asyncio
from hai_agents import AsyncClient
async def main():
client = AsyncClient()
result = await client.run_session(
agent="h/web-surfer-pro",
messages="What are the top 3 stories on Hacker News right now?",
)
print(result.answer)
asyncio.run(main())
Local agents
Client.local() and await AsyncClient.local() run the agent on this machine through a local agent runtime,
started on demand or passed in with runtime=.... A desktop is this machine; a browser picks host="user_device" or
host="cloud".
Client() keeps using the hosted Agents API. Closing the client stops a runtime it started, unless other clients still
have active sessions there.
from hai_agents import Client
with Client.local(local_options={"binary_path": "/path/to/hai-agent-runtime"}) as client:
session = client.sessions.create_session(
agent={
"name": "local-example",
"description": "Local desktop example",
"instructions": "Answer the user's task on this desktop.",
"environments": [{"id": "my-laptop", "kind": "desktop"}],
},
messages=[{"type": "user_message", "message": "Open the Calculator app."}],
max_steps=8,
max_time_s=120,
)
# Poll or steer the session here, before leaving the client context.
Inference stays hosted (HAI_API_KEY) unless you pass inference=Inference.self_hosted(url, model=...)
(from hai_agents_local.runtime import Inference).
One agent drives this machine's desktop at a time: a second process asking for a desktop bridge fails fast instead of
sharing the mouse. holo local stop stops every local turn on the machine; so does a double Esc
once hai_agents_local.killswitch.arm_esc_listener() is armed (macOS, Windows, and X11 Linux).
Inspect and share sessions
List past sessions and create a public replay link:
page = client.sessions.list_sessions(size=10)
for summary in page.items:
print(summary.id, summary.status)
link = client.sessions.share_session("<session-id>")
print(link.share_url)
Regions and configuration
The client targets the EU region by default; pass environment to use the US region instead:
from hai_agents import Client, HaiAgentsEnvironment
client = Client(environment=HaiAgentsEnvironment.US)
Client also accepts a custom base_url, and an api_key when you do not want to use the environment variable:
client = Client(base_url="https://agp.hcompany.ai", api_key="hk-...")
Errors
from hai_agents import AnswerValidationError, UnprocessableEntityError
from hai_agents.core import ApiError
ApiError is the base for HTTP failures and carries .status_code and .body. UnprocessableEntityError is the 422 raised when a request fails validation. AnswerValidationError is raised when a completed answer does not match answer_schema, with the unparsed value on .raw.
Webhooks
Verify the signature on an incoming webhook before trusting it:
from hai_agents import verify_webhook, WebhookVerificationError
event = verify_webhook(request_body, signature, timestamp, secret)
print(event.type, event.data)
Documentation
Guides, core concepts, and the full API reference live at hub.hcompany.ai/agents-api.
License
Computer-Use Agents API MCP 질문
Computer-Use Agents API MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add --transport http hai-agents-python https://agp.hcompany.ai/mcp를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
Computer-Use Agents API MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
SDK와 CLI를 어떻게 설치하나요?
pip install "hai-agents[cli]"를 사용하여 SDK와 holo 명령어를 설치하거나, pip install hai-agents로 SDK만 설치할 수 있습니다.
에이전트로 로컬 데스크톱을 제어할 수 있나요?
네, h/holo-desktop 에이전트를 사용하면 에이전트가 마우스와 키보드를 사용하여 사용자의 컴퓨터 데스크톱을 제어할 수 있습니다.
에디터에 어떻게 추가하나요?
holo mcp install 명령어를 사용하여 Cursor, Claude Code, Codex와 같은 에디터에 MCP server를 추가할 수 있습니다.
에이전트에 직접 만든 도구를 제공할 수 있나요?
네, run_session에 Python 함수를 전달하여 에이전트가 사용할 수 있도록 노출할 수 있습니다.