MCPHttpOptions

org.llm4s.mcp.MCPHttpOptions
See theMCPHttpOptions companion object
final case class MCPHttpOptions

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 an Authorization in headers; a key that cannot be read fails the request. MCPServerOptions.apiKey is what an llm4s MCPServer checks

headers

sent with every request to the server: each POST, the event-stream GET of HTTP+SSE and the session DELETE. 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; with None it creates one and closes it when it is closed

Attributes

Companion
object
Source
MCPTransport.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
MCPTransport.scala

Sends the key apiKey provides as Authorization: Bearer.

Sends the key apiKey provides as Authorization: Bearer.

Attributes

Source
MCPTransport.scala

Sets or clears the credential sent as Authorization: Bearer.

Sets or clears the credential sent as Authorization: Bearer.

Attributes

Source
MCPTransport.scala
def withHeader(name: String, value: String): MCPHttpOptions

Adds or replaces one header sent with every request.

Adds or replaces one header sent with every request.

Attributes

Source
MCPTransport.scala

Replaces the headers sent with every request.

Replaces the headers sent with every request.

Attributes

Source
MCPTransport.scala

Sends with httpClient, which the transport never closes.

Sends with httpClient, which the transport never closes.

Attributes

Source
MCPTransport.scala

Sets or clears the HTTP client to send with.

Sets or clears the HTTP client to send with.

Attributes

Source
MCPTransport.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product