Files
HickLab3D_Dashboard/app/Console/Commands/EtsyMcp.php
T
hermes 9b13640571 Add first-party Etsy MCP server for shop listings, orders and messages
Expose php artisan etsy:mcp as JSON-RPC stdio next to laravel-boost, reuse the stored HickLab3D shop connection, create listings as drafts only, and skip Etsy v3 conversation send because that API does not exist.
2026-11-07 15:54:05 +00:00

35 lines
970 B
PHP

<?php
namespace App\Console\Commands;
use App\Services\EtsyMcpServer;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use Symfony\Component\Console\Output\OutputInterface;
#[Signature('etsy:mcp')]
#[Description('Run the HickLab3D Etsy MCP server over JSON-RPC stdio')]
class EtsyMcp extends Command
{
public function handle(EtsyMcpServer $server): int
{
ini_set('display_errors', 'stderr');
$this->output->setDecorated(false);
$input = $this->input->getStream() ?? STDIN;
while (! feof($input)) {
$line = fgets($input);
if ($line === false) {
break;
}
$response = $server->handleLine($line);
if ($response !== null) {
$this->output->write($response.PHP_EOL, false, OutputInterface::OUTPUT_RAW);
}
}
return self::SUCCESS;
}
}