# Class LittleGhost::MCP::HTTPTransport

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/MCP/HTTPTransport.html

HTTPTransport sends MCP JSON-RPC messages over Streamable HTTP. It applies
time and response-size limits and keeps the negotiated MCP session ID.

### Connections and credentials

HTTPS is required by default. `allow_insecure_http` is only for a local
development endpoint. Scope caller-supplied credential headers to the target
server. Response bodies and negotiated session IDs are validated before use.

One transport instance retains one negotiated MCP session ID and sends it with
later requests. Use one transport and Client for one server and one
authenticated user or service identity; never share that pair across tenants.
LittleGhost does not send MCP session-termination DELETE requests, so
configure server-side expiry or send the cleanup request outside this
transport when the server requires explicit session termination.

## Inheritance

`LittleGhost::MCP::HTTPTransport < Object`

## Constants

### `DEFAULT_MAX_RESPONSE_BYTES`

Default upper bound for one MCP response body (10 MiB).

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(url:, headers: {}, timeout: 60, signer: nil, allow_insecure_http: false,
        max_response_bytes: DEFAULT_MAX_RESPONSE_BYTES)
```

Configures time and response-size limits. `signer`, when supplied, is called
with each Net::HTTP request before it is sent.

## Instance methods

<a id="method-i-send"></a>
### `#send`

```ruby
#send(payload, context: nil)
```

Sends one JSON-RPC payload. A RunContext supplies cancellation and a deadline;
without it the configured timeout applies.
