Skip to content

Commit 9fcf1c3

Browse files
committed
Added doc
1 parent 8608dc3 commit 9fcf1c3

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
@@ -233,6 +233,7 @@ $server = Server::builder()
233233

234234
## Documentation
235235

236+
<<<<<<< HEAD
236237
**Core Concepts:**
237238
- [Server Builder](docs/server-builder.md) - Complete ServerBuilder reference and configuration
238239
- [Transports](docs/transports.md) - STDIO and HTTP transport setup and usage
@@ -242,6 +243,36 @@ $server = Server::builder()
242243
- [Examples](docs/examples.md) - Comprehensive example walkthroughs
243244

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

0 commit comments

Comments
 (0)