cuga-agent MCP工具 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
cuga-agent MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、企业智能体、代码生成 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
cuga-agent MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、企业智能体、代码生成 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install cuga-agent
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install cuga-agent
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/cuga-project/cuga-agent
cd cuga-agent
pip install -e .
# 验证安装
python -c "import cuga_agent; print('安装成功')"
# 命令行使用
cuga-agent --help
# 基本用法
cuga-agent input_file -o output_file
# Python 代码中调用
import cuga_agent
# 示例
result = cuga_agent.process("input")
print(result)
# cuga-agent 配置文件示例(config.yml) app: name: "cuga-agent" debug: false log_level: "INFO" # 运行时指定配置文件 cuga-agent --config config.yml # 或通过环境变量配置 export CUGA_AGENT_API_KEY="your-key" export CUGA_AGENT_OUTPUT_DIR="./output"
<picture> <source media="(prefers-color-scheme: dark)" srcset="/docs/images/cuga-dark.png"> <source media="(prefers-color-scheme: light)" srcset="/docs/images/cuga-light.png"> <img alt="CUGA" src="/docs/images/cuga-dark.png"> </picture>
| Tool Type | Best For | Configuration | Runtime Loading |
|---|---|---|---|
| **OpenAPI** | REST APIs, existing services | mcp_servers.yaml | Build |
| **MCP** | Custom protocols, complex integrations | mcp_servers.yaml | Build |
| **LangChain** | Python functions, rapid prototyping | Direct import | Runtime |
SKILL.md files with frontmatter; the agent discovers them and loads full instructions on demand via the load_skill tool (see Agent skills)CugaAgent(tools=[...]) → await agent.invoke(message)agent.stream()thread_idDocumentation: SDK Guide | Policies Guide
CugaAgent instances with external agents via A2A, task-only or variables in metadata if enabled.variables=["var_name"] to pass previous agent outputs or context to the next agent (for internal agents, or A2A when pass_variables_a2a is enabled in settings).You can also load agents from YAML with CugaSupervisor.from_yaml("path/to/config.yaml"). Enable the supervisor in settings.toml under [supervisor] when using the server.
---
uv sync
1. Get an E2B API key: - Sign up at e2b.dev - Create an API key from your dashboard
2. Set up the E2B template:
# Install E2B CLI
npm install -g @e2b/cli
# Login with your API key
e2b auth login
# Create a template (one-time setup)
# This creates a 'cuga-langchain' template that CUGA uses
e2b template build --name cuga-langchain
3. Install E2B dependencies:
uv sync --group e2b
4. Configure environment: Add to your .env file:
E2B_API_KEY=your-e2b-api-key-here
Building a domain-specific enterprise agent from scratch is complex and requires significant effort: agent and tool orchestration, planning logic, safety and alignment policies, evaluation for performance/cost tradeoffs and ongoing improvements. CUGA is a state-of-the-art generalist agent designed with enterprise needs in mind, so you can focus on configuring your domain tools, policies and workflow.
---
</div>
---
Why CUGA? — A generalist agent harness for the enterprise: wire your APIs and MCP servers, tune reasoning and task modes, and govern behavior with policies—without rebuilding orchestration from scratch. | Feature | How | |---------|-----| | MCP, OpenAPI & LangChain tools |mcp_servers.yaml·CugaAgent(tools=[...])| | Reasoning modes (fast / balanced / accurate) |[features] cuga_modeinsettings.toml·configurations/modes/| | Hybrid API + browser tasks |[advanced_features] mode = 'hybrid'· Playwright + browser extension | | Multi-agent (CugaSupervisor) |cuga start demo_supervisor·[supervisor]insettings.toml| | A2A & remote agents | External agent entries in supervisor config · CugaSupervisor | | Policies & HITL | Policies SDK — Intent Guard, Playbook, Tool Approval, Tool Guide, Output Formatter | | Manage & publish |cuga start manager· draft tools, MCP, LLM, and policies in the web UI, then publish a versioned config for production chat (details) | | Reflection |[advanced_features] reflection_enabledinsettings.toml| | Langflow | Low-code visual workflows — integrates with CUGA (langflow.org) | | Memory (optional) |enable_memoryinsettings.toml·uv sync --extra memory·cuga start memory| | Knowledge (RAG) |enable_knowledge=True(default) · ingest PDFs/Office/HTML/Markdown via Docling · agent-level + session-level scopes ·cuga start demo_knowledge· details | | Agent skills |SKILL.mdunder.agents/skills·cuga start demo_skills(sandbox_mode = "native"by default, oropensandbox) · ordemo --sandboxwith[skills]on · Agent skills | | Self-host on a cluster | Helm chart and deploy scripts indeployment/· Kubernetes guide (local kind/minikube, or registry push for cloud clusters) | | Save & reuse (experimental)_ |cuga_mode = "save_reuse_fast"insettings.toml| SDK · Policies · Quick Start →
# Edit ./src/cuga/settings.toml and change:
mode = 'hybrid' # under [advanced_features] section
playwright installer should already be included after installing with Quick Start playwright install chromium
cuga start demo
6. Try the hybrid task:
get top account by revenue from digital sales then add it to current page
What you'll see: CUGA will fetch data from the Digital Sales API and then interact with the web page to add the account information directly to the current page - demonstrating seamless API-to-web workflow integration!
</details>
# Edit ./src/cuga/settings.toml and ensure:
api_planner_hitl = true # under [advanced_features] section
cuga start demo
3. Try the HITL task:
get best accounts
What you'll see: CUGA will pause at critical decision points, showing you the planned actions and waiting for your approval before proceeding.
</details>
1. Choose how Evolve will be started. Recommended for normal CUGA usage: let the CUGA MCP registry launch Evolve for you. In the manager UI, add an MCP tool with: - Name: evolve - Connection type: Command (stdio) - Command: uvx - Args: --from altk-evolve --with setuptools<70 evolve-mcp Important: this command starts Evolve in stdio mode through the upstream Evolve package. It is intended to be launched by the CUGA registry, not run manually in a separate terminal. Alternative for standalone/manual debugging: run Evolve yourself as an SSE server: If you run Evolve from a checked-out altk-evolve repo instead of uvx, install the Postgres extras first with uv sync --extra pgvector. 2. Add these environment values in the MCP tool UI:
EVOLVE_BACKEND=postgres
EVOLVE_PG_HOST=localhost
EVOLVE_PG_PORT=5432
EVOLVE_PG_USER=postgres
EVOLVE_PG_PASSWORD=postgres
EVOLVE_PG_DBNAME=evolve
EVOLVE_MODEL_NAME=Azure/gpt-4o
OPENAI_API_KEY=env://OPENAI_API_KEY
OPENAI_BASE_URL=env://OPENAI_BASE_URL
Each env://... value tells CUGA to read the real secret or setting from its own process environment at runtime, so make sure PostgreSQL is reachable, pgvector is available, and the configured OpenAI/LiteLLM-compatible model is one your gateway is allowed to use.
./src/cuga/settings.toml and enable lite mode plus Evolve:[advanced_features]
lite_mode = true
[evolve]
enabled = true
url = "http://127.0.0.1:8201/sse"
mode = "auto"
app_name = "evolve"
lite_mode_only = true
save_on_success = true
save_on_failure = true
async_save = true
timeout = 30.0
If you use the recommended registry-managed setup above, keep mode = "auto" or set mode = "registry".
If you run Evolve manually as a standalone SSE server, keep url = "http://127.0.0.1:8201/sse" and set mode = "direct" if you want to skip registry lookup entirely.
If you use Evolve tip generation, make sure the environment for the Evolve MCP server includes the required Evolve model settings. Otherwise save_trajectory may fail later with a LiteLLM/OpenAI model access error even when the MCP connection itself works.
cuga start demo_crm --sample-memory-data
Identify the common cities between my cuga_workspace/cities.txt and cuga_workspace/company.txt
• Change ./src/cuga/settings.toml: cuga_mode = "save_reuse_fast" • Run: cuga start demo
<details> <summary><em style="color: #666;"> Prerequisites (click to expand)</em></summary>
</details>
```bash
```
<details> <summary> LLM Configuration - Advanced Options</summary>
---
Refer to: .env.example for detailed examples.
CUGA supports multiple LLM providers with flexible configuration options. You can configure models through TOML files or override specific settings using environment variables.
```python from cuga import CugaAgent from langchain_core.tools import tool import asyncio
@tool def add_numbers(a: int, b: int) -> int: '''Add two numbers together''' return a + b
@tool def multiply_numbers(a: int, b: int) -> int: '''Multiply two numbers together''' return a * b
from cuga import CugaAgent, CugaSupervisor
from langchain_core.tools import tool
import asyncio
@tool
def get_customers(limit: int = 10) -> str:
"""Fetch top customers from CRM with name, email, and revenue. Returns a formatted string."""
customers = [
"Alice (alice@example.com, $250,000)",
"Bob (bob@example.com, $180,000)",
"Carol (carol@example.com, $120,000)",
"Dave (dave@example.com, $95,000)",
"Eve (eve@example.com, $88,000)",
]
top = customers[: min(limit, len(customers))]
return "Top customers by revenue: " + "; ".join(f"{i+1}. {c}" for i, c in enumerate(top))
@tool
def send_email(to: str, body: str) -> str:
"""Send an email. Returns confirmation."""
return f"Email sent successfully to {to}"
async def main():
crm_agent = CugaAgent(tools=[get_customers])
crm_agent.description = "CRM and customer data"
email_agent = CugaAgent(tools=[send_email])
email_agent.description = "Sending emails and notifications"
supervisor = CugaSupervisor(agents={
"crm": crm_agent,
"email": email_agent,
})
result = await supervisor.invoke("Get our top 5 customers by revenue, then send the top customer a thank-you email")
print(result.answer)
asyncio.run(main())
To add a remote agent via A2A, pass an external config in agents: "analytics": {"type": "external", "description": "...", "config": {"a2a_protocol": {"endpoint": "http://localhost:9999", "transport": "http"}}}.
<details> <summary><b> Save & Reuse</b></summary>
cuga start demo_crm --read-only
• First run: get top account by revenue
get top 2 accounts by revenue• Flow now will be saved:
• Verify reuse: get top 4 accounts by revenue
</details>
<details> <summary><b> Adding Tools: Comprehensive Examples</b></summary>
CUGA supports three types of tool integrations. Each approach has its own use cases and benefits:
uv venv --python=3.12 && source .venv/bin/activate
echo "OPENAI_API_KEY=your-openai-api-key-here" > .env
cuga viz
Setup Instructions:
1. Create an account at platform.openai.com 2. Generate an API key from your API keys page 3. Add to your .env file:
# OpenAI Configuration
OPENAI_API_KEY=sk-...your-key-here...
AGENT_SETTING_CONFIG="settings.openai.toml"
# Optional overrides
MODEL_NAME=gpt-4o # Override model name
OPENAI_BASE_URL=https://api.openai.com/v1 # Override base URL
OPENAI_API_VERSION=2024-08-06 # Override API version
Default Values:
gpt-4oSetup Instructions:
1. Access IBM WatsonX 2. Create a project or space and get your credentials: - Project ID or Space ID - API Key - Region/URL 3. Add to your .env file:
# WatsonX Configuration
WATSONX_API_KEY=your-watsonx-api-key
WATSONX_PROJECT_ID=your-project-id
# WATSONX_SPACE_ID=your-space-id # Alternative to WATSONX_PROJECT_ID
WATSONX_URL=https://us-south.ml.cloud.ibm.com # or your region
AGENT_SETTING_CONFIG="settings.watsonx.toml"
# Optional override
MODEL_NAME=meta-llama/llama-4-maverick-17b-128e-instruct-fp8 # Override model for all agents
Default Values:
meta-llama/llama-4-maverick-17b-128e-instruct-fp8Setup Instructions:
1. Add to your .env file:
AGENT_SETTING_CONFIG="settings.azure.toml" # Default config uses ETE
AZURE_OPENAI_API_KEY="<your azure apikey>"
AZURE_OPENAI_ENDPOINT="<your azure endpoint>"
OPENAI_API_VERSION="2024-08-01-preview"
CUGA supports LiteLLM through the OpenAI configuration by overriding the base URL:
.env file: # LiteLLM Configuration (using OpenAI settings)
OPENAI_API_KEY=your-api-key
AGENT_SETTING_CONFIG="settings.openai.toml"
# Override for LiteLLM
MODEL_NAME=Azure/gpt-4o # Override model name
OPENAI_BASE_URL=https://your-litellm-endpoint.com # Override base URL
OPENAI_API_VERSION=2024-08-06 # Override API version
Setup Instructions:
1. Create an account at groq.com 2. Generate an API key from your API keys page 3. Add to your .env file:
# Groq Configuration
GROQ_API_KEY=your-groq-api-key-here
AGENT_SETTING_CONFIG="settings.groq.toml"
# Optional override
MODEL_NAME=llama-3.1-70b-versatile # Override model name
Default Values:
settings.groq.tomlSetup Instructions: 1. Create an account at openrouter.ai 2. Generate an API key from your account settings 3. Add to your .env file:
# OpenRouter Configuration
OPENROUTER_API_KEY=your-openrouter-api-key
AGENT_SETTING_CONFIG="settings.openrouter.toml"
OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"
# Optional override
MODEL_NAME=openai/gpt-4o # Override model name
CUGA uses TOML configuration files located in src/cuga/configurations/models/:
settings.openai.toml - OpenAI configuration (also supports LiteLLM via base URL override)settings.watsonx.toml - WatsonX configurationsettings.azure.toml - Azure OpenAI configurationsettings.groq.toml - Groq configurationsettings.openrouter.toml - OpenRouter configurationEach file contains agent-specific model settings that can be overridden by environment variables.
</details>
Tip: Want to use your own tools or add your MCP tools? Check out src/cuga/backend/tools_env/registry/config/mcp_servers.yaml for examples of how to configure custom tools and APIs, including those for digital sales.
</div>
<details> <summary> Running with a secure code sandbox</summary>
Cuga supports isolated code execution using Docker/Podman containers for enhanced security.
uv sync --group sandbox
cuga start demo --sandbox
This automatically configures Cuga to use Docker/Podman for code execution instead of local execution.
# Test local sandbox (default)
cuga test-sandbox
# Test remote sandbox with Docker/Podman
cuga test-sandbox --remote
You should see the output: ('test succeeded\n', {})
Note: Without the --sandbox flag, Cuga uses local Python execution (default), which is faster but provides less isolation.
</details>
<details> <summary> Running with E2B Cloud Sandbox</summary>
CUGA supports E2B for cloud-based code execution in secure, ephemeral sandboxes. This provides better isolation than local execution while being faster than Docker/Podman containers.
Edit ./src/cuga/settings.toml:
[advanced_features]
e2b_sandbox = true
e2b_sandbox_mode = "per-session" # Options: "per-session" | "single" | "per-call"
e2b_sandbox_ttl = 600 # Cache TTL in seconds (10 minutes)
configurations/
├── modes/fast.toml
├── modes/balanced.toml
├── modes/accurate.toml
└── modes/custom.toml
Edit settings.toml:
[features]
cuga_mode = "fast" # or "balanced" or "accurate" or "custom"
Documentation: ./docs/flags.html
</details>
<details> <summary> Task Mode Configuration - Switch between API/Web/Hybrid modes</summary>
Edit ./src/cuga/settings.toml:
[demo_mode]
start_url = "https://opensource-demo.orangehrmlive.com/web/index.php/auth/login" # Starting URL for hybrid mode
[advanced_features]
mode = 'api' # 'api', 'web', or 'hybrid'
</details>
<details> <summary>📝 Special Instructions Configuration</summary>
configurations/
└── instructions/
├── instructions.toml
├── default/
│ ├── answer.md
│ ├── api_planner.md
│ ├── code_agent.md
│ ├── plan_controller.md
│ ├── reflection.md
│ ├── shortlister.md
│ └── task_decomposition.md
└── [other instruction sets]/
Edit configurations/instructions/instructions.toml:
[instructions]
instruction_set = "default" # or any instruction set above
</details>
<details> <summary><em style="color: #666;"> 🧠 Optional: Use Evolve with CugaLite</em></summary>
Evolve can now be used with CugaLite to bring task-specific guidance into the prompt before execution and save completed trajectories after the run.
This flow is:
cuga[evolve] if you want the upstream Evolve package available locally, or let uvx fetch it on demandCUGA can be easily integrated into your Python applications as a library. The SDK provides a clean, minimal API for creating and invoking agents with custom tools.
SDK Documentation: SDK Documentation
function_call_host in settings.toml with your ngrok URLBenefits of E2B: - No Docker/Podman required - Faster than container-based sandboxing - Cloud-native with automatic scaling - Better isolation than local execution - Supports per-session caching for cost optimization
Note: E2B is a paid service with a free tier. Check e2b.dev/pricing for details.
</details>
<details> <summary> Reasoning modes - Switch between Fast/Balanced/Accurate modes</summary>
cuga-agent 是一个高性能的通用型 Agent 框架,旨在通过多种工具集成模式处理复杂的 Web 和 API 任务。它支持通过 OpenAPI 规范集成 REST APIs,利用 MCP 协议实现自定义协议或复杂集成,并允许通过 LangChain 直接导入 Python 函数。系统通过结构化规划和智能变量管理,有效防止幻觉并应对复杂逻辑。
本项目具备强大的 Agent 能力,结合了 planner-executor 和 code-act 等先进模式,确保在复杂任务中的稳定性。开发者可以通过简洁的 API(如 `CugaAgent.invoke`)快速调用,并支持实时流式输出(Streaming)以监控执行过程。此外,系统提供完善的状态隔离(State Isolation)机制,支持基于 `thread_id` 的多用户会话,并允许通过 LangGraph 访问底层图结构进行深度定制。
在开始之前,请确保您的开发环境已安装 Python 3.12+ 以及 uv 包管理器。此外,由于项目依赖 E2B 沙盒环境进行代码执行,您需要前往 e2b.dev 注册并获取 E2B API key,并通过 E2B CLI 完成登录与模板设置,以确保 Agent 具备安全的运行时环境。
项目推荐使用 `uv sync` 进行依赖安装。若需启用混合模式(hybrid mode)以支持浏览器功能,请修改 `./src/cuga/settings.toml` 中的配置。对于需要浏览器交互的任务,请务必运行 `playwright install chromium` 来安装必要的浏览器 API 支持。您可以从通用 Agent 开始,根据业务领域快速定制并部署企业级应用。
通过 Quick Start 示例,您可以利用 LangChain 的 `@tool` 装饰器轻松定义自定义工具,并将其注入到 `CugaAgent` 中。Agent 会自动解析工具逻辑并进行决策。对于高级用户,可以通过配置 `.env` 文件或 TOML 文件来灵活切换不同的 LLM 提供商,并根据需求覆盖特定的模型参数。
CUGA 提供了高度灵活的配置系统。您可以通过 `mcp_servers.yaml` 管理 MCP 服务器,或通过 `settings.toml` 配置高级功能。系统支持通过环境变量覆盖配置文件中的设置,方便在不同环境下快速切换 LLM 配置。对于需要外部通信的场景,请务必正确配置 `function_call_host` 参数。
您可以将 CUGA 作为 Python SDK 集成到现有应用中。SDK 提供了极简的 API 设计,方便开发者创建并调用带有自定义工具的 Agent。在 `mode = 'api'` 模式下,任务将在常规 Web 浏览器中打开,这非常适合以 API 或工具为核心的工作流测试与验证。
常见问题排查:若遇到 "function_call_host not configured" 错误,请检查 `settings.toml` 中的 ngrok URL 是否配置正确;若工具执行失败,请确认 ngrok 服务是否正在运行且 URL 与配置一致;若出现连接超时,请检查防火墙是否允许 ngrok 的通信请求。
活跃度高���企业级智能体框架,MCP集成完整,安全机制健全。开源社区维护良好,生产级可用性强。
该工具使用 NOASSERTION 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 NOASSERTION — 请查阅原始协议条款了解具体使用限制。
经综合评估,cuga-agent MCP工具 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | cuga-agent |
| 原始描述 | 开源MCP工具:CUGA is an open-source generalist agent harness for the enterprise, supporting c。⭐734 · Python |
| Topics | MCP协议企业智能体代码生成计算机操作安全护栏 |
| GitHub | https://github.com/cuga-project/cuga-agent |
| License | NOASSERTION |
| 语言 | Python |
收录时间:2026-05-17 · 更新时间:2026-05-19 · License:NOASSERTION · AI Skill Hub 不对第三方内容的准确性作法律背书。