diff --git a/mcp-server/src/__tests__/index.test.ts b/mcp-server/src/__tests__/index.test.ts index 25c0cb1f..1bbb1167 100644 --- a/mcp-server/src/__tests__/index.test.ts +++ b/mcp-server/src/__tests__/index.test.ts @@ -1083,7 +1083,7 @@ describe("Phase 30 remote-agent tools", () => { expect(body.workspace_name).toBe("remote-1"); expect(body.setup_command).toContain("WORKSPACE_ID=ws-ext"); expect(body.setup_command).toContain("PLATFORM_URL="); - expect(body.setup_command).toContain("molecule-agent"); + expect(body.setup_command).toContain("molecule_agent"); }); test("handleCheckRemoteAgentFreshness fresh when heartbeat is recent", async () => { diff --git a/mcp-server/src/tools/remote_agents.ts b/mcp-server/src/tools/remote_agents.ts index 48171a57..0af3c04f 100644 --- a/mcp-server/src/tools/remote_agents.ts +++ b/mcp-server/src/tools/remote_agents.ts @@ -94,8 +94,13 @@ export async function handleGetRemoteAgentSetupCommand(params: { ``, `WORKSPACE_ID=${w.id} \\`, `PLATFORM_URL=${targetUrl} \\`, - `python3 -m examples.remote-agent.run`, + `python3 -c "from molecule_agent import RemoteAgentClient; \\`, + ` c = RemoteAgentClient.register_from_env(); \\`, + ` c.pull_secrets(); \\`, + ` c.run_heartbeat_loop()"`, ``, + `# For a richer demo (logging, graceful shutdown) see`, + `# sdk/python/examples/remote-agent/run.py in the molecule-monorepo checkout.`, `# The agent will register, mint its bearer token (cached at`, `# ~/.molecule/${w.id}/.auth_token), pull secrets, then heartbeat.`, ].join("\n");