OpenCode serves as an interface allowing LLMs to access local files, instructions, tools, APIs, and MCP servers to perform specific user tasks. Users can connect various external providers via API keys or utilize local LLMs for projects requiring data privacy.
The configuration is divided into two levels: global settings in ~/.config/opencode/ for universal instructions and skills, and project-specific settings in the repository for architectural constraints and task-specific commands.
The AGENTS.md file defines behavioral rules for the AI, such as requirements to avoid hallucinating facts or executing Git commands like push and merge without explicit permission. Complex, repetitive algorithms can be encapsulated into reusable skills.
For external integrations like GitLab or Jira, users can employ MCP servers or standard REST APIs. The author notes that REST APIs often provide a more stable alternative when MCP schemas do not match expected formats.
Security best practices include applying the principle of least privilege, such as using read-only tokens and setting permissions to 'ask' or 'deny' for sensitive operations. Secrets should be managed via environment variables rather than hardcoded in configurations.






