Skip to content

[FEATURE]: Full MCP client capabilities #28567

@Arcadi4

Description

@Arcadi4

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

OpenCode's MCP client features are way behind the latest MCP standard. The gaps below were touched across many issues and PRs. I myself also encountered many difficulties due to the incomplete capability while developing MCP extensions for OpenCode. A one-time implementation is probably the cleanest fix to all of them and leaves no technical debt. This should also bring architectural advantages by flattening skills and tasks into the MCP layer.

I know this proposal for a project of this size might be a bit unreal. Rewriting the MCP client would definitely break loads of plugins and dependents, and the migration wouldn't be easy. Even so, the count of issues on this is large enough that I think the discussion is at least worth having.

Behavioral gaps

Missing entirely:

  • sampling/createMessage and the sampling capability1
  • elicitation/create (form + URL modes), notifications/elicitation/complete, URLElicitationRequiredError -32042, and the elicitation capability2
  • roots/list, notifications/roots/list_changed, and the roots capability3
  • resources/subscribe / resources/unsubscribe / notifications/resources/updated / notifications/resources/list_changed4
  • resources/templates/list5
  • completion/complete6
  • logging/setLevel and notifications/message7
  • ping8
  • The entire experimental tasks/* system from 2025-11-259
  • No capabilities object passed to new Client(...) — opencode advertises nothing at initialize10

Partial or incorrect:

  • Progress: resetTimeoutOnProgress: true is passed to callTool, but onprogress is never wired through, so no progress token is ever sent and the timeout never resets in practice11
  • Cancellation: notifications/cancelled is never sent when a user aborts a tool call12
  • Pagination: tools/list, resources/list, prompts/list are called without cursors; large lists silently truncate13
  • Tool results: structuredContent is ignored14; outputSchema is stripped via TolerantListToolsResultSchema rather than validated15; resource_link16 and audio17 content types are dropped
  • Tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)18 and icons[]19 are not consumed
  • tools/list_changed is the only notification handled20
  • The server's InitializeResult.instructions field is fetched but never threaded into the LLM context, so the server's own usage hints are lost21

Authorization:

  • Token refresh: refreshToken is stored but never executed — tokens silently expire22
  • RFC 8707 resource indicators: not sent23
  • RFC 9728 protected resource metadata: no explicit WWW-Authenticate resource_metadata parsing24
  • OpenID Connect Discovery 1.0 (added in 2025-11-25 as a second discovery option): not implemented25
  • Client ID Metadata Documents: not implemented26
  • Step-up authorization (insufficient_scope re-auth): not implemented27
  • Configured oauth.scope is not threaded into client metadata28
  • OAuth callback server (port 19876) is not stopped after auth completes
  • OAuth callback page has unescaped error query parameter (XSS / CWE-79)
  • headers config is not sent during mcp auth / mcp debug

Networking:

  • Streamable HTTP Accept header doesn't always list both application/json and text/event-stream29
  • MCP-Protocol-Version header is not explicitly set; opencode mcp debug hardcodes protocolVersion: "2024-11-05" (three revisions behind)30
  • Mcp-Session-Id is not handled; session loss permanently breaks the connection31
  • Last-Event-ID resumption is not implemented32
  • No transport-level auto-reconnect on socket errors29
  • Local stdio servers leak processes on disconnect / replace / rollback33
  • Origin header validation, SSRF protection, and session-hijacking mitigations from the spec's Security Best Practices are not implemented34

Related issues and PRs

Sampling:

Elicitation:

Resources (subscriptions, templates, model-invoked):

Prompts:

Progress:

Cancellation:

Structured content / outputSchema / resource_link:

OAuth / auth:

Transport / Streamable HTTP / SSE:

Connection lifecycle / reconnect / stdio leaks:

Custom / dynamic headers:

Server notifications / _meta / logging:

TLS / mTLS / cert validation:

Windows-specific

Schema:

Performance:

Footnotes

  1. https://modelcontextprotocol.io/specification/2025-11-25/client/sampling

  2. https://modelcontextprotocol.io/specification/2025-11-25/client/elicitation

  3. https://modelcontextprotocol.io/specification/2025-11-25/client/roots

  4. https://modelcontextprotocol.io/specification/2025-11-25/server/resources#subscriptions

  5. https://modelcontextprotocol.io/specification/2025-11-25/server/resources#resource-templates

  6. https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/completion

  7. https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging

  8. https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/ping

  9. https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks

  10. https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle#capability-negotiation

  11. https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/progress

  12. https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/cancellation

  13. https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/pagination

  14. https://modelcontextprotocol.io/specification/2025-11-25/server/tools#structured-content

  15. https://modelcontextprotocol.io/specification/2025-11-25/server/tools#output-schema

  16. https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool-result

  17. https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool

  18. https://modelcontextprotocol.io/specification/2025-11-25/basic#icons

  19. https://modelcontextprotocol.io/specification/2025-11-25/server/tools#list-changed-notification

  20. https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle#initialization

  21. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization

  22. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#resource-parameter-implementation

  23. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#authorization-server-discovery

  24. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#authorization-server-metadata-discovery

  25. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#client-id-metadata-documents

  26. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#scope-challenge-handling

  27. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#scope-selection-strategy

  28. https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http 2

  29. https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#protocol-version-header

  30. https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#session-management

  31. https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#resumability-and-redelivery

  32. https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#stdio

  33. https://modelcontextprotocol.io/specification/2025-11-25/basic/security_best_practices

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions