Skip to content

Commit e84287a

Browse files
committed
Update cached discovery example and composer dependencies
1 parent f073c07 commit e84287a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"Mcp\\Example\\DependenciesStdioExample\\": "examples/06-custom-dependencies-stdio/",
5555
"Mcp\\Example\\ComplexSchemaHttpExample\\": "examples/07-complex-tool-schema-http/",
5656
"Mcp\\Example\\SchemaShowcaseExample\\": "examples/08-schema-showcase-streamable/",
57+
"Mcp\\Example\\CachedDiscoveryExample\\": "examples/10-cached-discovery-stdio/",
5758
"Mcp\\Tests\\": "tests/"
5859
}
5960
},

examples/10-cached-discovery-stdio/CachedCalculatorElements.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the official PHP MCP SDK.
5+
*
6+
* A collaboration between Symfony and the PHP Foundation.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Mcp\Example\CachedDiscoveryExample;

examples/10-cached-discovery-stdio/server.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Server::make()
1818
->withServerInfo('Cached Discovery Calculator', '1.0.0', 'Calculator with cached discovery for better performance.')
1919
->withDiscovery(__DIR__, ['.'])
20+
->withLogger(logger())
2021
->withCache(new Psr16Cache(new ArrayAdapter())) // Enable discovery caching
2122
->build()
2223
->connect(new StdioTransport());

0 commit comments

Comments
 (0)