Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b9f27de. Configure here.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff423e47d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5edf3b57b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 540c8bc8fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Description
HarborMCPMixin gives HarborEnv support for the [[environment.mcp_servers]] section of Harbor's task.toml. On post_sandbox_setup, the mixin parses each entry, decides whether the server is framework-managed or externally-managed (a real remote MCP endpoint), and handles each accordingly. Framework-managed servers have their hostname aliased to 127.0.0.1 in the sandbox's /etc/hosts, and get a HARBOR_MCP_<NAME>_URL env var published with the URL rewritten to loopback. For each network-transport server, the mixin starts the launch command via start_background_job then polls a configurable healthcheck until the port is listening. Externally-managed servers have their task.toml URL published to the agent unchanged and get no /etc/hosts patch so remote managed endpoints stay reachable. A @vf.cleanup(priority=1) handler kills each recorded process group before the sandbox is destroyed. Subclasses can override pre_mcp_setup to stage code or install dependencies between task-asset upload and server launch, or override mcp_launch_command for per-rollout launches.
Any task.toml that's valid Harbor should work. Network transports (streamable-http, sse, http) are fully supported and stdio entries are parsed and validated but intentionally left for the agent tooling to spawn (same as in the Harbor SDK). The one unavoidable departure from Harbor's native flow is that launch commands come from a Python-side mcp_launch_commands dict instead of environment/docker-compose.yaml, since prime-sandboxes uses a single sandbox container rather than compose sidecars.
There is one example (hello_mcp_harbor) which demonstrates the full end-to-end flow with a FastMCP get_secret server.
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Medium Risk
Changes Harbor sandbox startup/cleanup to launch and health-check MCP daemons and to rewrite/publish MCP URLs, which can affect rollout reliability and process cleanup semantics.
Overview
Adds first-class MCP server lifecycle support to
HarborEnv.HarborEnvnow parses[[environment.mcp_servers]], publishesHARBOR_MCP_<NAME>_URLenv vars (rewriting managed servers to loopback), patches/etc/hostsfor managed hostnames, starts declared network MCP servers via background jobs with configurable healthchecks, and SIGKILLs their process groups during cleanup.Introduces a new
hello_mcp_harborexample environment that stages a minimal FastMCPget_secretserver into the sandbox and runs an OpenCode agent against it, plus extensive unit tests (test_harbor_env_mcp.py) covering parsing/URL rewriting, parallel startup and failure cancellation,/etc/hostsbehavior, and healthcheck semantics.Reviewed by Cursor Bugbot for commit 2a32b3b. Bugbot is set up for automated code reviews on this repo. Configure here.