Agents & MCP
Connect an agent harness to a streamable HTTP MCP server behind Bearer auth: register the URL, pass the key by header, and map missing-key vs bad-key vs disconnected.
1 file
Description
Connect an agent harness to a streamable HTTP MCP server behind Bearer auth: register the URL, pass the key by header, and map missing-key vs bad-key vs disconnected.
Wiring a hosted MCP endpoint (a service you or a vendor runs at a URL) into a client, instead of spawning a local subprocess. The worked example is the Developers Digest endpoint at /api/mcp, which serves credit-metered tools over streamable HTTP and requires Authorization: Bearer dd_live_....
A remote server is already running. You do not give the client a command and args; you give it a url and the transport type, plus the credential. Nothing is installed locally.
{
"mcpServers": {
"dd-platform": {
"type": "http",
"url": "https://developersdigest.tech/api/mcp",
"headers": { "Authorization": "Bearer ${DD_API_KEY}" }
}
}
}
Authorization header, never in the URL query string (URLs leak into logs and history).${DD_API_KEY}), not a literal, so a checked-in project config never ships the secret.Hit the endpoint directly first so a connection failure is not ambiguous:
curl -sS -H "Authorization: Bearer $DD_API_KEY" https://developersdigest.tech/api/mcp
A 401 means the key is missing or bad; a connection error means the URL or network is wrong; a valid handshake means the client config is the only thing left to fix.
Authorization header reads as "disconnected" in most clients, with no hint that it was an auth failure. Verify the key with curl before blaming the config.isError result as a stop, not a reason to hammer.Added 2026-07-01. Back to the Skill Library.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.