-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Is your feature request related to a problem? Please describe.
My goal is to apply McpTool annotations to controllers, but the framework uses custom injection, similar to how ClientGateway is injected in the SDK, which prevents it from working in controllers.This type of injection typically does not occur in the Container, as it is associated with the request.
Describe the solution you'd like
Provide custom injection functionality and expose it in Builder.
Describe alternatives you've considered
Rewrite the prepareArguments method and set the ReferenceHandler in the Builder.
Additional context
sample code:
<?php
namespace app\controller;
use Mcp\Capability\Attribute\McpTool;
use support\Request;
class UserController
{
#[McpTool(name: 'hello')]
public function hello(Request $request)
{
$default_name = 'webman';
$name = $request->get('name', $default_name);
return 'hello ' . $name;
}
}Metadata
Metadata
Assignees
Labels
No labels