Answer: Register the implementation inside setup using ctx.rpc.register(Acme, { search: async (input, context) => {...} }), then call it through ctx.rpc(Acme). Status: Confirmed Entry: tool/opencode/integrations/implement-rpc Revision: 2 Digest: sha256:3942798addc9a34d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:54Z Last changed: 2026-11-18T13:38:21Z (error helper: — → context.error(...)) Last verified: 2026-11-20T13:44:42Z Next check: 2026-11-21T13:44:42Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of call method | ctx.rpc(Acme) | [1] | 2026-11-20 cancellation signal | signal | [1] | 2026-11-20 error helper | context.error(...) | [1] | 2026-11-20 multiple RPCs | One plugin can register more than one RPC. | [1] | 2026-11-20 disposal | Disposing the registration removes it. | [1] | 2026-11-20 Sources: [1] opencode. "Plugin RPC | OpenCode". https://opencode.ai/docs/build/plugins/rpc/ Role: primary. Accessed: 2026-11-20T13:44:42Z Quote: "the same plugin can call it through ctx.rpc(Acme)" (Supports: call method) Quote: "The second argument includes signal for cancellation" (Supports: cancellation signal) Quote: "context.error(...) for declared errors" (Supports: error helper) Quote: "One plugin can register more than one RPC." (Supports: multiple RPCs) Quote: "Disposing the registration removes it." (Supports: disposal) Snapshot SHA-256: 37434d54cb17cadeed5e125bd89c1835a46ec5999bd75168c1eaa7349e5372c9 (captured 2026-11-18T13:38:20Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:21Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:42Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:42Z Last attempt: 2026-11-20T13:44:42Z Notes and limitations: Extracted automatically from a single official source (section "Implement"). Related: https://latestn.com/tool/opencode/integrations/inference-api-endpoints Which API endpoints does the opencode Inference API support for OpenAI, Anthropic, and Gemini models? https://latestn.com/tool/opencode/integrations/load-plugin How do I load an opencode plugin? https://latestn.com/tool/opencode/integrations/local-mcp-server-config How do I configure a local MCP server in opencode? https://latestn.com/tool/opencode/integrations/effect-stream-events How do I stream events from opencode using the Effect client? https://latestn.com/tool/opencode/integrations/find-provider-url Where do I find the provider URL for the opencode Console Providers API? https://latestn.com/tool/opencode/integrations/host-apis-prompt-model How do I read and write the prompt or choose the model from an opencode GUI plugin? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:38:21Z | changed | error helper: — → context.error(...) | [1] 2026-11-18T13:38:21Z | changed | cancellation signal: — → signal | [1] 2026-11-18T13:38:21Z | changed | error return/throw: You can return or throw the error. → — | [1] 2026-11-18T13:38:21Z | changed | declared errors: context.error(...) → — | [1] 2026-11-18T13:38:21Z | changed | cancellation: signal → — | [1] 2026-11-13T03:55:54Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/implement-rpc/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/integrations/implement-rpc POST: https://latestn.com/dispute/tool/opencode/integrations/implement-rpc with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/implement-rpc?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I implement an RPC in an opencode plugin? Revision 2, last verified 2026-11-20T13:44:42Z. https://latestn.com/tool/opencode/integrations/implement-rpc (accessed 2026-11-21T09:50:29Z). @misc{LatestN_tool_opencode_integrations_implement_rpc_r2, title = {How do I implement an RPC in an opencode plugin?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/implement-rpc}}, note = {Revision 2; digest sha256:3942798addc9a34d; last verified 2026-11-20T13:44:42Z; accessed 2026-11-21T09:50:29Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/integrations/implement-rpc