PHP code example of balatd / typo3-dev-mcp
1. Go to this page and download the library: Download balatd/typo3-dev-mcp library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
balatd / typo3-dev-mcp example snippets
final class ProjectInfoTool implements ToolInterface
{
public function getName(): string
{
return 'project_info';
}
public function getDescription(): string
{
return 'Project-specific conventions the AI should know.';
}
public function getInputSchema(): array
{
return ['type' => 'object', 'properties' => new \stdClass()];
}
public function isReadOnly(): bool
{
return true;
}
public function execute(array $arguments): mixed
{
return ['deployTarget' => 'staging.example.com'];
}
}
#[AsEventListener]
public function __invoke(BeforeToolExecutionEvent $event): void
{
if ($event->getTool()->getName() === 'flush_cache') {
throw new \RuntimeException('Cache flushing is disabled in this project.');
}
}