-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
BugSomething isn't workingSomething isn't workingServerIssues & PRs related to the Server componentIssues & PRs related to the Server component
Description
Describe the bug
I noticed that $_session can be injected in tools, but it requires entering a session in the inspector. However, after entering it, it doesn't get overridden, but rather becomes SessionInterface.
To Reproduce
<?php
namespace app\mcp;
use Mcp\Capability\Attribute\McpTool;
use Mcp\Server\Session\SessionInterface;
class example
{
#[McpTool(name: 'example_tool')]
public function exampleTool(SessionInterface $_session): array
{
return [
'status' => 'ok',
'session_id' => $_session->getId()->toRfc4122(),
];
}
}Expected behavior
Support SessionInterface injection and remove related schema
Additional context

Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingServerIssues & PRs related to the Server componentIssues & PRs related to the Server component