Actually use cache across example runs (#116)

This commit is contained in:
Christopher Hertel 2025-10-26 21:49:45 +01:00 • committed by GitHub
commit e5a4cb5906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ chdir(__DIR__);
use Mcp\Server;
use Mcp\Server\Transport\StdioTransport;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
use Symfony\Component\Cache\Psr16Cache;
logger()->info('Starting MCP Cached Discovery Calculator Server...');
@ -26,7 +26,7 @@ $server = Server::builder()
->setServerInfo('Cached Discovery Calculator', '1.0.0', 'Calculator with cached discovery for better performance.')
->setContainer(container())
->setLogger(logger())
->setDiscovery(__DIR__, ['.'], [], new Psr16Cache(new ArrayAdapter()))
->setDiscovery(__DIR__, cache: new Psr16Cache(new PhpFilesAdapter(directory: __DIR__.'/cache')))
->build();
$transport = new StdioTransport(logger: logger());