Skip to content

Conversation

@chr-hertel
Copy link
Member

@chr-hertel chr-hertel commented Nov 14, 2025

Alternative to #146

Outer interface does not change => no docs changes required

Fixes #74

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Nov 14, 2025
…bilities out and enable Registry injection in Builder
@chr-hertel
Copy link
Member Author

@soyuka & @camilleislasse we would merge that instead of #75 and #146 - does that work for the use-cases you have in mind?

Copy link
Contributor

@soyuka soyuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I like that we take the capabilities out of the registry.

public function getTool(string $name): ToolReference
{
return $this->tools[$name] ?? throw new ToolNotFoundException($name);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be nice for reviewing to keep the previous order of methods :D.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea fair, i think we're currently a bit rough with PR scopes 😬

$cursor,
$limit
);
throw new ResourceNotFoundException($uri);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird to log and to throw ?

Comment on lines +264 to +269
if ($includeTemplates) {
foreach ($this->resourceTemplates as $template) {
if ($template->matches($uri)) {
return $template;
}
}
Copy link
Contributor

@soyuka soyuka Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($includeTemplates) {
foreach ($this->resourceTemplates as $template) {
if ($template->matches($uri)) {
return $template;
}
}
if (!$includeTemplates) {
throw new ResourceNotFoundException($uri);
}
foreach ($this->resourceTemplates as $template) {
if ($template->matches($uri)) {
return $template;
}
}

@chr-hertel chr-hertel merged commit 7cd281d into main Nov 20, 2025
12 checks passed
@chr-hertel chr-hertel deleted the unified-registry branch November 20, 2025 18:37
camilleislasse added a commit to camilleislasse/ai that referenced this pull request Nov 24, 2025
Now that modelcontextprotocol/php-sdk#150 is merged, the Registry can be
injected directly into the Builder. This allows replacing the ProfilingLoader
with a cleaner TraceableRegistry decorator pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Expose Server Registry for debugging and profiling tools

4 participants