MCP PHP SDK

McpResource

FinalYes

Marks a PHP class as representing or handling a specific MCP Resource instance.

Used primarily for the 'resources/list' discovery.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Attributes
#[Attribute]
\Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS

Table of Contents

Properties

$annotations  : Annotations|null
$description  : string|null
$icons  : array<string|int, mixed>|null
$meta  : array<string|int, mixed>|null
$mimeType  : string|null
$name  : string|null
$size  : int|null
$uri  : string

Methods

__construct()  : mixed

Properties

$icons

public array<string|int, mixed>|null $icons = null

$meta

public array<string|int, mixed>|null $meta = null

Methods

__construct()

public __construct(string $uri[, string|null $name = null ][, string|null $description = null ][, string|null $mimeType = null ][, int|null $size = null ][, Annotations|null $annotations = null ][, array<string|int, Icon>|null $icons = null ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
$uri : string

The specific URI identifying this resource instance. Must be unique within the server.

$name : string|null = null

A human-readable name for this resource. If null, a default might be generated from the method name.

$description : string|null = null

An optional description of the resource. Defaults to class DocBlock summary.

$mimeType : string|null = null

the MIME type, if known and constant for this resource

$size : int|null = null

the size in bytes, if known and constant

$annotations : Annotations|null = null

optional annotations describing the resource

$icons : array<string|int, Icon>|null = null

Optional list of icon URLs representing the resource

$meta : array<string, mixed>|null = null

Optional metadata


        
On this page

Search results