登録して招待リンクを共有すると、動画再生報酬と紹介報酬を獲得できます。

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture 投稿は個人の意見です。
参加 May 2026
279 フォロー中    408 ファン
# OpenCode Features and Practical Usage 🔌 Want your agent to reach into the outside world? OpenCode's MCP server integration turns Sentry errors, library docs, and code search into tools the agent can call directly. 🏷️ Title: External Tool Connections (Local/Remote) 🔗 URL: 📘 Overview Configure MCP (Model Context Protocol) servers and external service tools become automatically available to the agent alongside OpenCode's built-in tools. Both local (process-launched) and remote (HTTP endpoint) servers are supported. ⚙️ How It Works Servers are declared in the `mcp` block of `opencode.json`, each under a unique identifier. ・Local: set `type: "local"`, give `command` as the startup command array, and optionally pass `environment` variables. `timeout` (default 5000ms) is configurable. ・Remote: set `type: "remote"` and provide `url`. Authenticate by passing a Bearer token in `headers`, or use OAuth (a 401 can trigger the flow automatically). Each server can be toggled individually with `enabled`. MCP tools appear with the server name as a prefix, and the `tools` field with wildcards (`*`, `?`) lets you enable or disable them globally or per agent. 🛠️ Practical Usage A remote Sentry integration is just an entry under `mcp` with `type: "remote"`, the `url` ` a Bearer token in `headers`, and `enabled: true`. For local servers, launch with something like `"command": ["npx", "-y", "@/modelcontextprotocol/server-everything"]`. You can just as easily add Context7 for docs search (` or Grep for GitHub code search (` as remotes. Use `opencode mcp auth ` and `opencode mcp list` to authenticate and check status. 💡 Use Cases Have the agent investigate a production error via Sentry, look up the correct usage of an up-to-date library via Context7, and find real-world implementations across repos via Grep — all in a single session, from investigation through implementation. For safety, keep servers at `enabled: false` and switch them on only for the tasks that need them. ⚠️ Caveats MCP servers consume context. Enabling a server that exposes many tools (like GitHub's) can rapidly inflate token usage and risk overflowing the context limit. Keep the set of enabled servers tight, and if you use API keys, set `oauth: false` to suppress automatic OAuth. Note that a remote server can fail to start if it exceeds its `timeout`. #OpenCode# #MCP#
もっと見る