# zip-ai/0.0.8/lib/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php

ZIP AI – AI Website Builder &amp; AI Agent (Beta), version 0.0.8. 76 lines.

- Page: https://pluginprobe.com/plugins/zip-ai/0.0.8/code/lib/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php
- Raw: https://pluginprobe.com/plugins/zip-ai/0.0.8/raw/lib/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php
- Modified: 2026-08-17T11:42:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/zip-ai/0.0.8/code/lib/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php#L10-L20`.

```php
<?php
/**
 * MCP HTTP Transport for WordPress - MCP 2025-11-25 Compliant
 *
 * @package McpAdapter
 */
declare( strict_types=1 );

namespace WP\MCP\Transport\Infrastructure;

/**
 * A simple data carrier for HTTP request context.
 * Properties are public for easy access but should be treated as read-only after construction.
 */
class HttpRequestContext {

	/**
	 * The original WordPress REST request object.
	 *
	 * @var \WP_REST_Request<array<string, mixed>>
	 */
	public \WP_REST_Request $request;

	/**
	 * The HTTP method of the request.
	 *
	 * @var string
	 */
	public string $method;


	/**
	 * The Mcp-Session-Id header from the request.
	 *
	 * @var string|null
	 */
	public ?string $session_id;

	/**
	 * The JSON-decoded body of the request.
	 *
	 * @var array|null
	 */
	public ?array $body;

	/**
	 * The MCP-Protocol-Version header from the request.
	 *
	 * @since 0.5.0
	 *
	 * @var string|null
	 */
	public ?string $protocol_version;

	/**
	 * The Accept header from the request.
	 *
	 * @var string|null
	 */
	public ?string $accept_header;

	/**
	 * Constructor.
	 *
	 * @param \WP_REST_Request<array<string, mixed>> $request The original request object.
	 */
	public function __construct( \WP_REST_Request $request ) {
		$this->request          = $request;
		$this->method           = $request->get_method();
		$this->session_id       = $request->get_header( 'Mcp-Session-Id' );
		$this->protocol_version = $request->get_header( 'Mcp-Protocol-Version' );
		$this->accept_header    = $request->get_header( 'accept' );
		$this->body             = 'POST' === $this->method ? $request->get_json_params() : null;
	}
}

```
