[Docs] Add blank line before lists so they render (#503)

This commit is contained in:
Christopher Hertel 2026-09-08 01:14:59 +02:00 • committed by GitHub
commit e7aa2d77de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 0 deletions

View file

@ -35,6 +35,7 @@ The SDK dispatches 4 broad event types at the protocol level, allowing you to ob
**Dispatched**: When any request is received from the client, before it's processed by handlers. **Dispatched**: When any request is received from the client, before it's processed by handlers.
**Properties**: **Properties**:
- `getRequest(): Request` - The incoming request - `getRequest(): Request` - The incoming request
- `setRequest(Request $request): void` - Modify the request before processing - `setRequest(Request $request): void` - Modify the request before processing
- `getSession(): SessionInterface` - The current session - `getSession(): SessionInterface` - The current session
@ -45,6 +46,7 @@ The SDK dispatches 4 broad event types at the protocol level, allowing you to ob
**Dispatched**: When a successful response is ready to be sent to the client, after handler execution. **Dispatched**: When a successful response is ready to be sent to the client, after handler execution.
**Properties**: **Properties**:
- `getResponse(): Response` - The response being sent - `getResponse(): Response` - The response being sent
- `setResponse(Response $response): void` - Modify the response before sending - `setResponse(Response $response): void` - Modify the response before sending
- `getRequest(): Request` - The original request - `getRequest(): Request` - The original request
@ -56,6 +58,7 @@ The SDK dispatches 4 broad event types at the protocol level, allowing you to ob
**Dispatched**: When an error occurs during request processing. **Dispatched**: When an error occurs during request processing.
**Properties**: **Properties**:
- `getError(): Error` - The error being sent - `getError(): Error` - The error being sent
- `setError(Error $error): void` - Modify the error before sending - `setError(Error $error): void` - Modify the error before sending
- `getRequest(): Request` - The original request. Messages that fail to parse are rejected before this event, so a listener never sees them. - `getRequest(): Request` - The original request. Messages that fail to parse are rejected before this event, so a listener never sees them.
@ -67,6 +70,7 @@ The SDK dispatches 4 broad event types at the protocol level, allowing you to ob
**Dispatched**: When a notification is received from the client, before it's processed by handlers. **Dispatched**: When a notification is received from the client, before it's processed by handlers.
**Properties**: **Properties**:
- `getNotification(): Notification` - The incoming notification - `getNotification(): Notification` - The incoming notification
- `setNotification(Notification $notification): void` - Modify the notification before processing - `setNotification(Notification $notification): void` - Modify the notification before processing
- `getSession(): SessionInterface` - The current session - `getSession(): SessionInterface` - The current session

View file

@ -169,6 +169,7 @@ $client->connect($transport);
``` ```
The `connect()` method performs the MCP initialization handshake: The `connect()` method performs the MCP initialization handshake:
1. Opens the transport connection 1. Opens the transport connection
2. Sends InitializeRequest with client capabilities 2. Sends InitializeRequest with client capabilities
3. Waits for InitializeResult from server 3. Waits for InitializeResult from server

View file

@ -18,6 +18,7 @@ $transport = new StdioTransport(
``` ```
**Parameters:** **Parameters:**
- `command` (string): The command to execute - `command` (string): The command to execute
- `args` (array): Command arguments - `args` (array): Command arguments
- `cwd` (string|null): Working directory for the process - `cwd` (string|null): Working directory for the process
@ -39,6 +40,7 @@ $transport = new HttpTransport(
``` ```
**Parameters:** **Parameters:**
- `endpoint` (string): The MCP server URL - `endpoint` (string): The MCP server URL
- `headers` (array): Additional HTTP headers - `headers` (array): Additional HTTP headers
- `httpClient` (ClientInterface|null): PSR-18 HTTP client (auto-discovered) - `httpClient` (ClientInterface|null): PSR-18 HTTP client (auto-discovered)
@ -50,6 +52,7 @@ $transport = new HttpTransport(
**PSR-18 Auto-Discovery:** **PSR-18 Auto-Discovery:**
The transport automatically discovers PSR-18 HTTP clients from: The transport automatically discovers PSR-18 HTTP clients from:
- `php-http/guzzle7-adapter` - `php-http/guzzle7-adapter`
- `php-http/curl-client` - `php-http/curl-client`
- `symfony/http-client` - `symfony/http-client`

View file

@ -54,6 +54,7 @@ $server = Server::builder()
``` ```
**Parameters:** **Parameters:**
- `$name` (string): The server name - `$name` (string): The server name
- `$version` (string): Version string (semantic versioning recommended) - `$version` (string): Version string (semantic versioning recommended)
- `$description` (string|null): Optional description - `$description` (string|null): Optional description
@ -152,6 +153,7 @@ $server = Server::builder()
``` ```
**Parameters:** **Parameters:**
- `$basePath` (string): Base directory for discovery (typically `__DIR__`) - `$basePath` (string): Base directory for discovery (typically `__DIR__`)
- `$scanDirs` (array): Directories to recursively scan for `#[McpTool]`, `#[McpResource]`, etc. All subdirectories are included. (default: `['.', 'src']`) - `$scanDirs` (array): Directories to recursively scan for `#[McpTool]`, `#[McpResource]`, etc. All subdirectories are included. (default: `['.', 'src']`)
- `$excludeDirs` (array): Directory names to exclude **within** the scanned directories during recursive scanning - `$excludeDirs` (array): Directory names to exclude **within** the scanned directories during recursive scanning
@ -189,6 +191,7 @@ $server = Server::builder()
``` ```
**How `excludeDirs` works:** **How `excludeDirs` works:**
- If scanning `src/` and there's `src/vendor/`, it will be excluded - If scanning `src/` and there's `src/vendor/`, it will be excluded
- If scanning `lib/` and there's `lib/tests/`, it will be excluded - If scanning `lib/` and there's `lib/tests/`, it will be excluded
- But if `vendor/` and `tests/` are at the same level as `src/`, they're not scanned anyway (not in `scanDirs`) - But if `vendor/` and `tests/` are at the same level as `src/`, they're not scanned anyway (not in `scanDirs`)
@ -217,6 +220,7 @@ $server = Server::builder()
``` ```
**Basic Container Features:** **Basic Container Features:**
- Supports constructor auto-wiring for classes with parameterless constructors - Supports constructor auto-wiring for classes with parameterless constructors
- Resolves dependencies where all parameters are type-hinted classes/interfaces known to the container - Resolves dependencies where all parameters are type-hinted classes/interfaces known to the container
- Supports parameters with default values - Supports parameters with default values

View file

@ -74,6 +74,7 @@ $server = Server::builder()
``` ```
**Parameters:** **Parameters:**
- `$gcProbability` (int): The numerator of the GC probability fraction (default: `1`). Set to `0` to disable GC. - `$gcProbability` (int): The numerator of the GC probability fraction (default: `1`). Set to `0` to disable GC.
- `$gcDivisor` (int): The denominator of the GC probability fraction (default: `100`). Must be >= 1. - `$gcDivisor` (int): The denominator of the GC probability fraction (default: `100`). Must be >= 1.
@ -81,6 +82,7 @@ $server = Server::builder()
> the `gcProbability` and `gcDivisor` settings are ignored — you control GC behavior in your own implementation. > the `gcProbability` and `gcDivisor` settings are ignored — you control GC behavior in your own implementation.
**Available Session Stores:** **Available Session Stores:**
- `InMemorySessionStore`: Fast in-memory storage (default) - `InMemorySessionStore`: Fast in-memory storage (default)
- `FileSessionStore`: Persistent file-based storage - `FileSessionStore`: Persistent file-based storage
- `Psr16SessionStore`: PSR-16 compliant cache-based storage - `Psr16SessionStore`: PSR-16 compliant cache-based storage

View file

@ -87,6 +87,7 @@ public function getUserProfile(
``` ```
**Provider Resolution:** **Provider Resolution:**
- **Class strings** (`Provider::class`) → Resolved from PSR-11 container - **Class strings** (`Provider::class`) → Resolved from PSR-11 container
- **Instances** (`new Provider()`) → Used directly - **Instances** (`new Provider()`) → Used directly
- **Values** (`['a', 'b']`) → Wrapped in `ListCompletionProvider` - **Values** (`['a', 'b']`) → Wrapped in `ListCompletionProvider`

View file

@ -100,6 +100,7 @@ makes the prompt handler throw.
### Error Handling ### Error Handling
Prompt handlers can throw any exception, but the type determines how it's handled: Prompt handlers can throw any exception, but the type determines how it's handled:
- **`PromptGetException`**: Converted to JSON-RPC error response with the actual exception message - **`PromptGetException`**: Converted to JSON-RPC error response with the actual exception message
- **Any other exception**: Converted to JSON-RPC error response, but with a generic error message - **Any other exception**: Converted to JSON-RPC error response, but with a generic error message

View file

@ -6,6 +6,7 @@ registry somehow. There are three ways to get it there, and they mix freely.
## Attribute-Based Discovery ## Attribute-Based Discovery
**Advantages:** **Advantages:**
- Declarative and readable - Declarative and readable
- Automatic parameter inference - Automatic parameter inference
- DocBlock integration - DocBlock integration
@ -25,6 +26,7 @@ Register MCP elements programmatically without using attributes. The handler is
any PHP callable. any PHP callable.
**Advantages:** **Advantages:**
- Fine-grained control - Fine-grained control
- Runtime configuration - Runtime configuration
- Conditional registration - Conditional registration