File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 "laravel/prompts" : " ^0.3.5" ,
3232 "phpstan/phpstan" : " ^2.1" ,
3333 "phpunit/phpunit" : " ^11.0 || ^12.0" ,
34- "swisnl/mcp-client" : " ^0.4 || ^0.5 " ,
34+ "swisnl/mcp-client" : " ^0.5.1 || ^0.6 " ,
3535 "swisnl/php-http-fixture-client" : " ^3.1" ,
3636 "symfony/console" : " ^7.2" ,
3737 "vlucas/phpdotenv" : " ^5.6"
Original file line number Diff line number Diff line change @@ -70,11 +70,15 @@ public function __construct(
7070 * Create a new MCP connection for a given Streamable HTTP endpoint
7171 *
7272 * @param string $endpoint
73+ * @param array<string, string> $headers
7374 * @return self
7475 */
75- public static function forStreamableHttp (string $ endpoint ): self
76+ public static function forStreamableHttp (string $ endpoint, array $ headers = [] ): self
7677 {
77- $ client = Client::withStreamableHttp ($ endpoint );
78+ $ client = Client::withStreamableHttp (
79+ endpoint: $ endpoint ,
80+ headers: $ headers ,
81+ );
7882
7983 $ connection = new self ($ client , 'MCP server ' );
8084 $ connection ->withCacheKey ('mcp_tools_ ' . md5 ($ endpoint ));
@@ -86,11 +90,15 @@ public static function forStreamableHttp(string $endpoint): self
8690 * Create a new MCP connection for a given SSE endpoint
8791 *
8892 * @param string $endpoint
93+ * @param array<string, string> $headers
8994 * @return self
9095 */
91- public static function forSse (string $ endpoint ): self
96+ public static function forSse (string $ endpoint, array $ headers = [] ): self
9297 {
93- $ client = Client::withSse ($ endpoint );
98+ $ client = Client::withSse (
99+ endpoint: $ endpoint ,
100+ headers: $ headers ,
101+ );
94102
95103 $ connection = new self ($ client , 'MCP server ' );
96104 $ connection ->withCacheKey ('mcp_tools_ ' . md5 ($ endpoint ));
You can’t perform that action at this time.
0 commit comments