OpenCode setup: Ollama, skills and MCP for coding

Learn OpenCode's Plan and Build workflow, connect Ollama models, and configure edit approvals in opencode.json through a browser game example.

Player not loading? Watch on YouTube

This tutorial introduces OpenCode as an open source coding assistant that works directly with project files. The speaker contrasts this workflow with copying code and errors between a browser chat and an editor, then explains how Plan prepares a task and Build carries it out.

The setup covers terminal installation options, including curl, npm and Homebrew for macOS, alongside desktop and web interfaces. The speaker describes accessing one web session from different devices on a local network. A small HTML, CSS and JavaScript game provides the working example: review the generated plan, switch to Build, inspect the result and request changes to a specific file.

Project instructions go in agents.md. The tutorial also uses opencode.json to require approval for edits and Bash commands while allowing ls. These controls are precautions, rather than a guarantee against destructive actions; the speaker also recommends Git and backups.

For a local LLM workflow, the demonstration connects Ollama and selects Gemma. LM Studio is another option, with model choice limited by what the computer can handle. The final sections cover proxy environment variables, installing skills and configuring MCP. Playwright illustrates browser control and extracting information into JSON. The game uses models the speaker describes as free; the local connection is a separate setup step.