Skip to content

Lesson 6.2 · 3:35

Give the agent eyes

Goal: Let the agent click through your app in a real browser and report what it saw.

Try it

  1. Start the practice app (node serve.mjs) so it runs at http://127.0.0.1:4174.
  2. Add the mcp block above to opencode.json and restart OpenCode.
  3. Send this prompt:
Use the browser tool to test this local app at http://127.0.0.1:4174 against TEST-MATRIX.md. For each case, state the input, action, observed result, and pass/fail. Do not change code during this first pass. If the tool cannot access the app, report that limit rather than claiming it passed.
  1. Approve the browser actions as they come up. Compare its results with the ones you wrote by hand in 6.1.

You're done when you have the agent's row-by-row report, you've checked that no files changed, and you've repeated one case yourself.

Recap

  • Without a browser tool, the agent is guessing from code. With one, it can use the app.
  • Tools are added in opencode.json. The plug's name and how it works come in 7.4.
  • First pass = observe only, report limits honestly, and you still check the key case.

Next lesson (6.3): a surprise the browser reveals. Where does your app's data actually live?