Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to `mcp/sdk` will be documented in this file.
-----

* Make `Protocol` stateless by decouple if from `TransportInterface`. Removed `Protocol::getTransport()`.
* Change signature of `Builder::addLoaders(...$loaders)` to `Builder::addLoaders(iterable $loaders)`.

0.1.0
-----
Expand Down
18 changes: 15 additions & 3 deletions src/Server/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,23 @@ public function addPrompt(
}

/**
* @param LoaderInterface[] $loaders
* Register a single custom loader.
*/
public function addLoaders(...$loaders): self
public function addLoader(LoaderInterface $loader): self
{
$this->loaders = [...$this->loaders, ...$loaders];
$this->loaders[] = $loader;

return $this;
}

/**
* @param iterable<LoaderInterface> $loaders
*/
public function addLoaders(iterable $loaders): self
{
foreach ($loaders as $loader) {
$this->loaders = [$loader];
}

return $this;
}
Expand Down