Skip to content

[FEATURE]: Support _meta field propagation in MCP tool calls #2094

@jonpspri

Description

@jonpspri

Summary

Context Forge Gateway does not currently propagate the _meta field from MCP tool call requests to downstream MCP servers. This field is part of the MCP specification and is the standard mechanism for passing metadata separately from business logic arguments.

Use Case

Propagate trace context and platform execution context (e.g., agentId, tenantId) to MCP servers during tool execution.

These values are:

  • Not business inputs - they shouldn't pollute tool arguments
  • Platform-owned execution context - similar to OpenTelemetry trace context
  • Separate from tool intent - maintaining clean separation between arguments (user-controlled, business-level inputs) and metadata (platform context)

Why not existing options?

Option Limitation
Headers Size limits (4-32KB); context variables can exceed this
Tool arguments Risk of name collisions with actual tool parameters
_meta field MCP protocol standard, no size limits, no collision risk ✓

Reference

Acceptance Criteria

  • _meta field from incoming tools/call requests is propagated to downstream MCP servers
  • Works across all transport types (SSE, WebSocket, stdio)
  • Unit tests covering _meta propagation
  • Integration tests verifying end-to-end _meta delivery

Additional Context

Discussion originated from IBM internal Slack thread regarding context variable passing for wxo integration.

Metadata

Metadata

Assignees

Labels

mcp-protocolAlignment with MCP protocol or specificationwxowxo integration

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions