Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Server/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Mcp\Capability\RegistryInterface;
use Mcp\Exception\InvalidArgumentException;
use Mcp\Exception\LogicException;
use Mcp\Exception\RuntimeException;
use Mcp\JsonRpc\MessageFactory;
use Mcp\Schema\Annotations;
use Mcp\Schema\Enum\ProtocolVersion;
Expand Down Expand Up @@ -1037,7 +1038,13 @@ private function resolve(): array
$discoverer = $this->discoverer ?? $this->createDiscoverer($logger);
$loaders[] = new DiscoveryLoader($this->discoveryBasePath, $this->discoveryScanDirs, $this->discoveryExcludeDirs, $discoverer, $this->discoveryNamePatterns, $logger);
} else {
$logger->warning('File-based discovery requires symfony/finder. Skipping automatic discovery. Run: composer require symfony/finder');
// Warning-and-skip here used to route around the identical guard in
// Discoverer::__construct(), turning a configured-but-impossible feature
// into a silent no-op: build() succeeds, initialize succeeds, and
// tools/list quietly returns an empty array with no actionable signal
// beyond a single log line. setDiscovery() is an explicit request for
// file-based discovery, so failing to honor it must fail loudly.
throw new RuntimeException('File-based discovery requires symfony/finder. Run: composer require symfony/finder');
}
}

Expand Down