@adcp/client Bug Report: Auth Headers Not Forwarded for sync_creatives
Summary
Auth headers configured viaauth_token_env
are successfully forwarded for get_products
but NOT forwarded for sync_creatives
when using the MCP protocol with StreamableHTTP transport.
Environment
- Package:
@adcp/client
(version from package.json) - Protocol: MCP (Model Context Protocol)
- Transport: StreamableHTTP
- Auth Method:
auth_token_env
(environment variable approach) - Sales Agent: Wonderstruck MCP server (
https://wonderstruck.sales-agent.scope3.com/mcp
)
Expected Behavior
When configuring anAgentConfig
with auth_token_env
pointing to an environment variable containing an auth token:
x-adcp-auth
header should be forwarded to the MCP server for ALL tool calls, including both read operations (get_products
) and write operations (sync_creatives
).
Actual Behavior
✅ Works: get_products
When callingget_products
, the auth header IS successfully forwarded:
❌ Fails: sync_creatives
When callingsync_creatives
with the SAME auth configuration, the header is NOT forwarded:
Bug Analysis
Key Observations
- Same auth configuration used for both tools
- Debug logs identical - both show “Transport configured with x-adcp-auth header”
- Different outcomes - get_products succeeds, sync_creatives fails
- Server confirms missing header - Wonderstruck explicitly reports “Missing or invalid x-adcp-auth header”
Hypothesis
The StreamableHTTP transport may have different code paths for different tool types, or there’s a bug in how headers are forwarded forsync_creatives
specifically. The debug logs show the header is being SET on the transport object but NOT actually included in the HTTP request.
Minimal Reproduction
Debug Logs Comparison
get_products (✅ Working)
sync_creatives (❌ Failing)
Impact
This bug prevents usingsync_creatives
with any MCP server that requires authentication via custom headers. Since creative syncing is a core ADCP operation, this significantly limits the protocol’s usefulness for authenticated scenarios.
Workarounds Attempted
- Direct auth token in config - Not supported by AgentConfig type
- Manual header injection - StreamableHTTP transport doesn’t expose header API
- OAuth instead of API key - Not supported by Wonderstruck MCP server
Requested Fix
Ensure that custom auth headers (configured viaauth_token_env
) are consistently forwarded for ALL MCP tool calls, not just get_products
. The StreamableHTTP transport should apply headers uniformly regardless of which tool is being invoked.
Additional Context
- Other MCP operations that may be affected:
get_brand_compliance_policy
, custom tools - This appears to be a transport-layer issue rather than a tool-specific issue
- The @modelcontextprotocol/sdk StreamableHTTP transport may be the root cause if @adcp/client relies on it for header forwarding
Test Environment Details
- Node.js: v22.19.0
- TypeScript: 5.6.3
- OS: macOS (Darwin 24.6.0)
- Package Manager: npm