Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

added env variable for CUA_PROVIDER_API_KEY

Dillon DuPontf2e390ba553f
diff --git a/libs/mcp-server/README.md b/libs/mcp-server/README.md
index 5649cc1984..86430e9526 100644
--- a/libs/mcp-server/README.md
+++ b/libs/mcp-server/README.md
@@ -68,7 +68,7 @@ You can then use the script in your MCP configuration like this:
"CUA_AGENT_LOOP": "OMNI",
"CUA_MODEL_PROVIDER": "ANTHROPIC",
"CUA_MODEL_NAME": "claude-3-7-sonnet-20250219",
- "ANTHROPIC_API_KEY": "your-api-key"
+ "CUA_PROVIDER_API_KEY": "your-api-key"
}
}
}
@@ -90,7 +90,8 @@ If you want to develop with the cua-mcp-server directly without installation, yo
"CUA_AGENT_LOOP": "UITARS",
"CUA_MODEL_PROVIDER": "OAICOMPAT",
"CUA_MODEL_NAME": "ByteDance-Seed/UI-TARS-1.5-7B",
- "CUA_PROVIDER_BASE_URL": "https://****************.us-east-1.aws.endpoints.huggingface.cloud/v1"
+ "CUA_PROVIDER_BASE_URL": "https://****************.us-east-1.aws.endpoints.huggingface.cloud/v1",
+ "CUA_PROVIDER_API_KEY": "your-api-key"
}
}
}
diff --git a/libs/mcp-server/mcp_server/server.py b/libs/mcp-server/mcp_server/server.py
index 67f7fe1243..03971cb6ac 100644
--- a/libs/mcp-server/mcp_server/server.py
+++ b/libs/mcp-server/mcp_server/server.py
@@ -94,14 +94,7 @@ def serve() -> FastMCP:
# Determine which loop to use
loop_str = os.getenv("CUA_AGENT_LOOP", "OMNI")
- if loop_str == "OPENAI":
- loop = AgentLoop.OPENAI
- elif loop_str == "ANTHROPIC":
- loop = AgentLoop.ANTHROPIC
- elif loop_str == "UITARS":
- loop = AgentLoop.UITARS
- else:
- loop = AgentLoop.OMNI
+ loop = getattr(AgentLoop, loop_str)
# Determine provider
provider_str = os.getenv("CUA_MODEL_PROVIDER", "ANTHROPIC")
@@ -113,6 +106,9 @@ def serve() -> FastMCP:
# Get base URL for provider (if needed)
provider_base_url = os.getenv("CUA_PROVIDER_BASE_URL", None)
+ # Get api key for provider (if needed)
+ api_key = os.getenv("CUA_PROVIDER_API_KEY", None)
+
# Create agent with the specified configuration
agent = ComputerAgent(
computer=global_computer,
@@ -122,6 +118,7 @@ def serve() -> FastMCP:
name=model_name,
provider_base_url=provider_base_url,
),
+ api_key=api_key,
save_trajectory=False,
only_n_most_recent_images=int(os.getenv("CUA_MAX_IMAGES", "3")),
verbosity=logging.INFO,