How the client reaches an HTTP MCP server (#3078): the headers sent with every request, the credential, and the HTTP client that carries them.
Build one with MCPHttpOptions.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers. toString shows header names, never their values.
Value parameters
- apiKey
-
read before each request and sent as
Authorization: Bearer <key>, over anAuthorizationinheaders; a key that cannot be read fails the request.MCPServerOptions.apiKeyis what an llm4sMCPServerchecks - headers
-
sent with every request to the server: each POST, the event-stream
GETof HTTP+SSE and the sessionDELETE. The transport's own headers (Content-Type,Accept,mcp-session-id,MCP-Protocol-Version) take precedence over one of the same name - httpClient
-
the client to send with, for the application's proxy and TLS settings (
Llm4sHttpClient.create(HttpClientOptions(network))). The transport never closes a client it was given; withNoneit creates one and closes it when it is closed
Attributes
- Companion
- object
- Source
- MCPTransport.scala
- Graph
-
- Supertypes
