PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / wordpress / mcp-adapter / includes / Transport / Infrastructure / HttpRequestContext.php
ameliabooking / vendor / wordpress / mcp-adapter / includes / Transport / Infrastructure Last commit date
HttpRequestContext.php 1 month ago HttpRequestHandler.php 1 month ago HttpSessionValidator.php 1 month ago JsonRpcResponseBuilder.php 1 month ago McpTransportContext.php 1 month ago McpTransportHelperTrait.php 1 month ago RequestRouter.php 1 month ago SessionManager.php 1 month ago
HttpRequestContext.php
76 lines
1 <?php
2 /**
3 * MCP HTTP Transport for WordPress - MCP 2025-11-25 Compliant
4 *
5 * @package McpAdapter
6 */
7 declare( strict_types=1 );
8
9 namespace WP\MCP\Transport\Infrastructure;
10
11 /**
12 * A simple data carrier for HTTP request context.
13 * Properties are public for easy access but should be treated as read-only after construction.
14 */
15 class HttpRequestContext {
16
17 /**
18 * The original WordPress REST request object.
19 *
20 * @var \WP_REST_Request<array<string, mixed>>
21 */
22 public \WP_REST_Request $request;
23
24 /**
25 * The HTTP method of the request.
26 *
27 * @var string
28 */
29 public string $method;
30
31
32 /**
33 * The Mcp-Session-Id header from the request.
34 *
35 * @var string|null
36 */
37 public ?string $session_id;
38
39 /**
40 * The JSON-decoded body of the request.
41 *
42 * @var array|null
43 */
44 public ?array $body;
45
46 /**
47 * The MCP-Protocol-Version header from the request.
48 *
49 * @since 0.5.0
50 *
51 * @var string|null
52 */
53 public ?string $protocol_version;
54
55 /**
56 * The Accept header from the request.
57 *
58 * @var string|null
59 */
60 public ?string $accept_header;
61
62 /**
63 * Constructor.
64 *
65 * @param \WP_REST_Request<array<string, mixed>> $request The original request object.
66 */
67 public function __construct( \WP_REST_Request $request ) {
68 $this->request = $request;
69 $this->method = $request->get_method();
70 $this->session_id = $request->get_header( 'Mcp-Session-Id' );
71 $this->protocol_version = $request->get_header( 'Mcp-Protocol-Version' );
72 $this->accept_header = $request->get_header( 'accept' );
73 $this->body = 'POST' === $this->method ? $request->get_json_params() : null;
74 }
75 }
76