Skip to content

Commit 36695ac

Browse files
committed
Added doc
1 parent edc9cde commit 36695ac

File tree

2 files changed

+424
-0
lines changed

2 files changed

+424
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ $server = Server::builder()
231231

232232
## Documentation
233233

234+
<<<<<<< HEAD
234235
**Core Concepts:**
235236
- [Server Builder](docs/server-builder.md) - Complete ServerBuilder reference and configuration
236237
- [Transports](docs/transports.md) - STDIO and HTTP transport setup and usage
@@ -240,6 +241,36 @@ $server = Server::builder()
240241
- [Examples](docs/examples.md) - Comprehensive example walkthroughs
241242

242243
**External Resources:**
244+
=======
245+
### MCP Logging
246+
247+
The SDK provides comprehensive logging capabilities following the [MCP logging specification](https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging):
248+
249+
- **Auto-injection**: `McpLogger` automatically injected into capability handlers
250+
- **Client-controlled filtering**: Clients can set log levels to control verbosity
251+
- **Centralized logging**: All server logs flow to client for unified debugging
252+
- **Fallback support**: Compatible with existing PSR-3 loggers
253+
254+
**Quick example:**
255+
```php
256+
#[McpTool(name: 'my_tool')]
257+
public function myTool(string $input, McpLogger $logger): array {
258+
$logger->info('Tool called', ['input' => $input]);
259+
return ['result' => 'processed'];
260+
}
261+
262+
// Enable in server
263+
$server = Server::builder()
264+
->enableMcpLogging() // Enable centralized logging
265+
->build();
266+
```
267+
268+
📖 **[Complete MCP Logging Guide](docs/mcp-logging.md)**
269+
270+
### Additional Resources
271+
272+
- [SDK documentation](doc/index.rst)
273+
>>>>>>> 34ae3c3 (Added doc)
243274
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
244275
- [Model Context Protocol specification](https://spec.modelcontextprotocol.io)
245276
- [Officially supported servers](https://github.com/modelcontextprotocol/servers)

0 commit comments

Comments
 (0)