cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::client::HttpTransportOptions Struct Reference

Configuration for the client HTTP transport. More...

#include <http_transport.hpp>

Public Attributes

std::string uri
 Full HTTP or HTTPS URI for the MCP endpoint.
 
std::string host
 Remote host name or IP address.
 
int port = 80
 Remote TCP port.
 
std::string path = "/"
 HTTP path used for MCP requests.
 
std::unordered_map< std::string, std::string > headers
 Extra request headers sent on every outbound HTTP request, including Streamable HTTP POST, SSE GET, and session DELETE requests.
 
std::optional< std::string > auth_header
 Optional bearer token inserted as Authorization: Bearer <token> on every outbound HTTP request.
 
HttpAuthRefreshHandler auth_refresh_handler
 Optional refresh hook invoked once for a 401 response before surfacing the auth failure.
 
std::chrono::milliseconds timeout {30000}
 Connect, read, and write timeout used by the transport.
 

Detailed Description

Configuration for the client HTTP transport.

Member Data Documentation

◆ auth_header

std::optional<std::string> mcp::client::HttpTransportOptions::auth_header

Optional bearer token inserted as Authorization: Bearer <token> on every outbound HTTP request.

Empty tokens are ignored. If headers already contains Authorization, the explicit header wins.

◆ auth_refresh_handler

HttpAuthRefreshHandler mcp::client::HttpTransportOptions::auth_refresh_handler

Optional refresh hook invoked once for a 401 response before surfacing the auth failure.

The returned token is stored as the new bearer token for the retry and future requests.

◆ uri

std::string mcp::client::HttpTransportOptions::uri

Full HTTP or HTTPS URI for the MCP endpoint.

When set, this overrides host/port/path and may include a path segment.


The documentation for this struct was generated from the following file: