PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
convertkit / vendor / wordpress / mcp-adapter / includes / Transport / Infrastructure / HttpRequestContext.php

HttpRequestContext.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.4.3, at vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php

76 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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