PHP code example of hryvinskyi / magento2-mcp-server
1. Go to this page and download the library: Download hryvinskyi/magento2-mcp-server 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/ */
hryvinskyi / magento2-mcp-server example snippets
class GetRateTableAbility implements PoolAbilityInterface
{
public function __construct(private readonly RateTable $rateTable)
{
}
public function getName(): string
{
return 'acme_shipping.rate_table.get';
}
public function getTitle(): string
{
return 'Get the shipping rate table';
}
public function getDescription(): string
{
return 'Returns the rates of one carrier.';
}
public function getCategory(): string
{
return 'Acme_Shipping';
}
public function getAccess(): AbilityAccess
{
return AbilityAccess::Read;
}
public function getAclResources(): array
{
return ['Acme_Shipping::rates'];
}
public function getInputSchema(): array
{
return [
'type' => 'object',
'properties' => ['carrier' => ['type' => 'string']],
'