When opencode receives a tools/call request that contains _meta, that metadata does not appear to be forwarded when opencode invokes downstream MCP tools.
In a typical setup:
UI → opencode → downstream MCP server
the UI may attach runtime metadata in _meta (for example document IDs, container IDs, workspace context, or tracing information). This metadata is intended to travel with the request but remain hidden from the LLM.
Currently, when opencode makes the downstream tools/call, the _meta field is dropped. As a result, downstream MCP servers lose request-scoped context.
Example incoming request:
{
"method": "tools/call",
"params": {
"name": "docuai_agent_tool",
"arguments": {
"user_request": {
"user_input": "Translate this document to French"
}
},
"_meta": {
"com.example/documentId": "doc_123",
"com.example/containerId": "cont_456"
}
}
}
Expected downstream request:
{
"method": "tools/call",
"params": {
"name": "translate_document_preserving_structure",
"arguments": {
"destinationLanguageThreeLetterCode": "fra"
},
"_meta": {
"com.example/documentId": "doc_123",
"com.example/containerId": "cont_456"
}
}
}
Forwarding _meta would allow downstream MCP tools to access request context (e.g., document IDs or workspace metadata) without exposing those values to the model.
It would be helpful if opencode preserved _meta from incoming requests and forwarded it to downstream tools/call requests when present.
When opencode receives a
tools/callrequest that contains_meta, that metadata does not appear to be forwarded when opencode invokes downstream MCP tools.In a typical setup:
the UI may attach runtime metadata in
_meta(for example document IDs, container IDs, workspace context, or tracing information). This metadata is intended to travel with the request but remain hidden from the LLM.Currently, when opencode makes the downstream
tools/call, the_metafield is dropped. As a result, downstream MCP servers lose request-scoped context.Example incoming request:
{ "method": "tools/call", "params": { "name": "docuai_agent_tool", "arguments": { "user_request": { "user_input": "Translate this document to French" } }, "_meta": { "com.example/documentId": "doc_123", "com.example/containerId": "cont_456" } } }Expected downstream request:
{ "method": "tools/call", "params": { "name": "translate_document_preserving_structure", "arguments": { "destinationLanguageThreeLetterCode": "fra" }, "_meta": { "com.example/documentId": "doc_123", "com.example/containerId": "cont_456" } } }Forwarding
_metawould allow downstream MCP tools to access request context (e.g., document IDs or workspace metadata) without exposing those values to the model.It would be helpful if opencode preserved
_metafrom incoming requests and forwarded it to downstreamtools/callrequests when present.