array( 'name' => get_bloginfo( 'name' ), 'version' => get_bloginfo( 'version' ) ?: '1.0', 'description' => get_bloginfo( 'description' ) ?: '', 'websiteUrl' => home_url( '/' ), ), 'protocolVersion' => '2025-06-18', 'transport' => array( 'type' => 'streamable-http', 'endpoint' => $api_url, ), 'capabilities' => array( 'resources' => (object) array(), 'tools' => (object) array(), ), 'instructions' => sprintf( 'WordPress site exposing a REST API at %s. Discover endpoints via /.well-known/api-catalog or fetch the OpenAPI spec at /openapi.json.', $api_url ), ); /** * Filter the MCP server card before serialization. * * The card follows SEP-1649/SEP-2127 structure (`serverInfo`, `transport` * with an `endpoint`, `capabilities`). Note: vanilla WP does not speak the * MCP wire protocol — the advertised endpoint is the REST API root and the * capability objects are empty. Plugins that run a real MCP server (e.g. * the official WordPress MCP Adapter) should override `transport.endpoint` * and populate `capabilities` here. * * @param array $server_card */ $server_card = apply_filters( 'ajaco_mcp_server_card', $server_card ); echo wp_json_encode( $server_card, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ); exit; }