PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.2
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.2
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / vendor / wp-media / mcp-oauth / inc / Transport / Server.php

Server.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.2, at vendor/wp-media/mcp-oauth/inc/Transport/Server.php

43 lines 942 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 declare( strict_types=1 );
3
4 namespace WPMedia\MCP\OAuth\Transport;
5
6 use WP\MCP\Core\McpAdapter;
7 use WP\MCP\Infrastructure\ErrorHandling\ErrorLogMcpErrorHandler;
8
9 class Server {
10 /**
11 * Register the MCP server with the adapter.
12 *
13 * Creates an isolated server at /wp-json/mcp/mcp-oauth-server using the custom
14 * OAuthHttpTransport for JWT Bearer authentication.
15 *
16 * @return void
17 */
18 public function register_server(): void {
19 if ( ! class_exists( McpAdapter::class ) ) {
20 return;
21 }
22
23 $adapter = McpAdapter::instance();
24
25 $adapter->create_server(
26 'mcp-oauth-server',
27 'mcp',
28 'mcp-oauth-server',
29 'MCP OAuth Server',
30 'MCP Server with OAuth 2.1 authentication',
31 'v1.0.0',
32 [ OAuthHttpTransport::class ],
33 ErrorLogMcpErrorHandler::class,
34 McpObservabilityHandler::class,
35 [
36 'mcp-adapter/discover-abilities',
37 'mcp-adapter/get-ability-info',
38 'mcp-adapter/execute-ability',
39 ]
40 );
41 }
42 }
43