forked from core/php-mcp
fix: pass workspace context from API key to tool execution
Brain tools require workspace_id in context for data isolation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b112b5357a
commit
8138840cad
1 changed files with 7 additions and 1 deletions
|
|
@ -222,10 +222,16 @@ class McpApiController extends Controller
|
|||
throw new \RuntimeException("Tool not found: {$tool}");
|
||||
}
|
||||
|
||||
$context = [];
|
||||
|
||||
if ($apiKey?->workspace_id) {
|
||||
$context['workspace_id'] = $apiKey->workspace_id;
|
||||
}
|
||||
|
||||
return $registry->execute(
|
||||
name: $tool,
|
||||
args: $arguments,
|
||||
context: [],
|
||||
context: $context,
|
||||
apiKey: $apiKey,
|
||||
validateDependencies: false
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue