QVeris
OpenCode API workflow guideOpenCode API 工作流指南

Best APIs to Use with OpenCode for AI Workflows适合 OpenCode AI 工作流的最佳 API

The best APIs for OpenCode are the ones that close a specific workflow gap: current evidence, business context, or a controlled action. Start with QVeris for broad tool discovery, then add search, workspace, code, database, communications, payments, and observability APIs only when the workflow needs them.适合 OpenCode 的最佳 API 应解决明确的工作流缺口:补充实时证据、业务上下文,或执行受控操作。可先用 QVeris 发现工具,再按需求加入搜索、办公协作、代码、数据库、沟通、支付与可观测性 API。

OpenCode agent hub connected through permission gates to web, documents, repositories, browser, database, files, memory, and location data
Treat each API 集成 as a capability boundary, not as a collectible integration.每个 API 集成 都是一条能力与权限边界,而不是越多越好的插件收藏。
Best for broad data综合数据首选QVeris API & MCP
Best for repositories代码仓库首选GitHub APIs
Best for current docs最新文档首选Brave Search API
Best for browser checks浏览器验证首选Playwright

The short answer: install for outcomes, not coverage快速结论:按结果选择,不追求数量

For most OpenCode projects, start with one external capability that closes a repeated workflow gap. QVeris can help discover API-backed tools; add GitHub for repository work, Brave Search for current web evidence, and Playwright for browser verification. Database, filesystem, billing, and collaboration access should remain project-specific because they expose broader data and actions.

OpenCode supports local and remote MCP servers through the mcp section of opencode.json or opencode.jsonc. MCP tools consume model context, so a smaller, task-specific set is usually easier to select, secure, and audit.

对大多数 OpenCode 项目而言,先接入一种能补齐重复性工作流缺口的外部能力即可。QVeris 可用于发现 API 工具;涉及代码仓库时加入 GitHub,需要最新网页证据时加入 Brave Search,需要浏览器验证时加入 Playwright。数据库、文件系统、支付和协作服务会暴露更多数据与操作,应按项目单独授权。

OpenCode 通过 opencode.jsonopencode.jsonc 中的 mcp 配置支持本地与远程 MCP Server。MCP 工具会占用模型上下文,因此范围更小、与任务直接相关的工具集通常更容易选择、保护和审计。

Compatibility baseline:兼容性基线: Check the 请查看 official OpenCode MCP documentationOpenCode 官方 MCP 文档 for current local and remote configuration, OAuth, tool management, and debugging behavior.,确认当前版本的本地与远程配置、OAuth、工具管理和调试方式。
# Server Best for最适合 Typical scope典型权限范围 Main caution主要注意点
1 QVeris API & Plugin Current data and API tools实时数据与 API 工具 Selected tools/providers指定工具与服务商 Choose only needed operations只开放所需操作
2 GitHub API Repositories, issues, PRs仓库、Issue 与 PR Token and repository scope令牌与仓库范围 Avoid broad write access避免宽泛写权限
3 Brave Search API Current library documentation实时网络检索 Remote documentation远程文档读取 Confirm library/version确认库与版本
4 Playwright Browser interaction and checks浏览器操作与验证 Selected sites and test environments指定站点与测试环境 Protect sessions and form submissions保护会话并审核表单提交
5 Supabase APIs Supabase project workSupabase 项目工作 Project and feature groups项目与功能组 Prefer development projects优先连接开发项目
6 Filesystem Bounded local documents限定范围的本地文件 Explicit directories明确指定的目录 Never expose broad roots不要暴露宽泛根目录
7 Fetch Simple URL retrieval简单 URL 内容抓取 Network read网络读取 Treat pages as untrusted将网页视为不可信输入
8 Stripe APIs Payments and billing支付与账单 Test-mode billing operations测试模式下的账单操作 Require approval for money movement资金操作必须审批

The 8 best API integrations for OpenCode适合 OpenCode 的 8 个最佳 API 集成

This ranking prioritizes practical usefulness, documented maintenance, scope control, and fit with coding workflows. It is a use-case shortlist, not a universal benchmark.本清单优先考虑实际用途、文档与维护情况、权限范围以及与编程工作流的匹配度;它是一份场景清单,而不是通用性能排名。

1

QVeris API & MCP

Best for unified tool discovery最适合统一发现工具

Use QVeris when OpenCode needs to discover and test focused external operations without maintaining a separate adapter for every provider.当 OpenCode 需要发现并测试明确的外部操作,又不想为每个服务商维护独立适配器时,可优先使用 QVeris。

2

GitHub APIs

Best for repository workflows最适合代码仓库工作流

Give OpenCode read access to issues, pull requests, checks, and releases first; keep merges and branch-policy changes behind approval.可先让 OpenCode 只读访问 Issue、PR、检查与 Release;合并和分支策略变更应保留人工审批。

3

Brave Search API

Best for current web evidence最适合获取最新网页证据

Search helps with fast-changing documentation and error research. Treat returned pages as untrusted input and retain source URLs.搜索适合查询快速变化的文档与错误信息;返回网页必须视为不可信输入,并保留来源 URL。

4

Playwright

Best for browser verification最适合浏览器验证

Use browser automation for local UI checks and workflows that cannot be verified through an API alone.本地 UI 检查以及无法仅通过 API 验证的流程,可以使用浏览器自动化。

5

Supabase APIs

Best for application data最适合应用数据

Use narrowly scoped database and storage operations, test Row Level Security, and separate development from production credentials.数据库与存储操作应限制范围、验证 RLS,并将开发凭证与生产凭证分离。

6

Google Workspace APIs

Best for documents and collaboration最适合文档与协作

Use granular OAuth scopes and require a preview before OpenCode sends mail, edits shared documents, or changes calendar state.应使用细粒度 OAuth 权限,并在 OpenCode 发送邮件、编辑共享文档或修改日历前提供预览与确认。

7

Fetch APIs

Best for bounded URL retrieval最适合受控 URL 抓取

A small fetch tool is useful for retrieving known documentation URLs. Restrict hosts, redirects, response size, and content types.小型 Fetch 工具适合读取已知文档 URL,但应限制域名、重定向、响应大小和内容类型。

8

Stripe APIs

Best for billing workflows最适合账单工作流

Start in test mode, verify webhook signatures, use idempotency keys, and require approval for charges, refunds, and subscription changes.应从测试模式开始,验证 Webhook 签名并使用幂等键;扣款、退款和订阅变更必须经过审批。

Choose by the missing capability按缺失能力选择

Workflow工作流 Start with推荐起点 Add when needed按需增加
Software delivery软件交付 GitHub + Brave Search API Playwright for end-to-end checks端到端验证再加 Playwright
Supabase applicationSupabase 应用 Supabase + Brave Search API GitHub for issue/PR workflowsIssue/PR 流程再加 GitHub

Configure MCP tools in OpenCode safely在 OpenCode 中安全配置 MCP 工具

Use OpenCode Config as the source of truth. Add one named server under mcp, start with non-production access, confirm authentication, then control each exposed tool through the current permission rules.

  1. Use type: "local" with a command array for a local process, or type: "remote" with a URL for a remote MCP server.
  2. Reference secrets through environment variables; do not commit literal credentials.
  3. Run opencode mcp list to review configured servers and authentication status.
  4. Use opencode mcp auth <server-name> for OAuth servers; use opencode mcp debug <server-name> when remote authentication or discovery fails.
  5. Set sensitive or state-changing tool patterns to "ask" or "deny" under permission.
  6. Test with representative non-production data before expanding scopes.

应以 OpenCode Config 作为配置事实来源。在 mcp 下添加一个具名 Server,先连接非生产环境,确认认证状态,再通过当前的 permission 规则控制各项工具权限。

  1. 本地进程使用 type: "local" 与命令数组;远程 MCP Server 使用 type: "remote" 与 URL。
  2. 通过环境变量引用密钥,不要把明文凭证提交到配置文件。
  3. 运行 opencode mcp list 查看已配置 Server 及其认证状态。
  4. OAuth Server 使用 opencode mcp auth <server-name>;远程认证或发现失败时使用 opencode mcp debug <server-name>
  5. permission 中将敏感或会改变状态的工具模式设为 "ask""deny"
  6. 先使用有代表性的非生产数据测试,再逐步扩大权限范围。
opencode mcp list
opencode mcp auth <server-name>
opencode mcp debug <server-name>
opencode mcp logout <server-name>

Configuration and commands can change; confirm them in the 配置与命令可能随版本变化,请以 current OpenCode MCP documentation当前 OpenCode MCP 文档 and review the 为准,并同时查看 permission reference权限配置文档.

OpenCode MCP security checklistOpenCode MCP 安全检查清单

  • Verify the maintainer, repository, package name, release history, and official documentation before installation.安装前核对维护者、仓库、包名、版本记录与官方文档。
  • Pin or review versions. Convenience tags are useful for evaluation, not a complete supply-chain policy.固定或审查版本;便捷标签适合评估,但不能替代供应链策略。
  • Use per-server tool filters and prefer read-only actions with narrow resource scopes.使用按 Server 的工具过滤,并优先开放资源范围明确的只读操作。
  • Treat pages, issues, documents, database rows, and tool descriptions as untrusted content that may contain prompt injection.网页、Issue、文档、数据库记录和工具描述都可能包含提示注入,应视为不可信内容。
  • Keep secrets in approved environment or secret-reference mechanisms and redact them from logs.使用合规的环境变量或密钥引用机制保存凭证,并从日志中脱敏。
  • Separate read, write, publish, payment, deletion, and production access into distinct approval classes.将读取、写入、发布、支付、删除与生产访问划分为不同审批等级。
  • Record server identity, tool name, decision, result status, and latency without logging unnecessary personal data.记录 Server 身份、工具名、决策、结果状态与延迟,但不记录无必要的个人数据。
  • Define a disable path. One unhealthy or compromised server should be removable without breaking the entire agent.预先设计停用路径;单个异常或受损 Server 不应拖垮整个智能体。

Frequently asked questions常见问题

Can OpenCode connect to external APIs?OpenCode 能连接外部 API 吗?

Yes. OpenCode can use local or remote MCP servers, and developers can also create custom tools in TypeScript or JavaScript that call API clients or scripts.可以。OpenCode 能使用本地或远程 MCP Server,开发者也可以用 TypeScript 或 JavaScript 创建自定义工具,再由工具调用 API 客户端或脚本。

Which API should I connect first?应该先接入哪个 API?

Start with the smallest integration that closes a recurring capability gap. Consider QVeris for tool discovery, GitHub for repository work, Brave Search for current web evidence, or Playwright for browser verification.先选择能补齐一个重复性能力缺口的最小集成:工具发现可考虑 QVeris,仓库工作选择 GitHub,最新网页证据选择 Brave Search,浏览器验证选择 Playwright。

How many external tools should OpenCode use?OpenCode 应使用多少外部工具?

There is no universal limit. Reduce the set when tools overlap, selection becomes unreliable, context use grows, or permissions become difficult to audit.没有统一上限。当工具开始重叠、选择变得不稳定、上下文占用增加,或权限难以审计时,就应该缩减工具集。

Can OpenCode auto-approve MCP tools?OpenCode 可以自动批准 MCP 工具吗?

OpenCode has an auto mode, but explicit deny rules still apply. For safer automation, keep sensitive and state-changing tools set to ask or deny instead of relying on unrestricted auto-approval.OpenCode 提供自动批准模式,但明确的 deny 规则仍会生效。为了降低风险,敏感操作和会改变外部状态的工具应设为 ask 或 deny,不应依赖不受限制的自动批准。

Are API integrations the same as OpenCode skills?API 集成和 OpenCode Skill 是一回事吗?

No. A skill supplies reusable instructions, while an MCP server or custom tool exposes callable capabilities. A skill can still teach OpenCode when and how to use a narrowly scoped tool.不是。Skill 提供可复用的指令,MCP Server 或自定义工具则暴露可调用能力。Skill 可以进一步说明 OpenCode 应在何时、如何使用范围明确的工具。

Give OpenCode the smallest useful toolset为 OpenCode 配置最小但够用的工具集

Choose one missing capability, inspect its source and permissions, test it with representative data, and expand only after the complete workflow is reliable.先确定一个缺失能力,核对来源与权限,用代表性数据测试;只有完整工作流可靠后,才扩大工具范围。