PHP code example of rasuvaeff / yii3-mcp-telemetry-bridge
1. Go to this page and download the library: Download rasuvaeff/yii3-mcp-telemetry-bridge 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/ */
rasuvaeff / yii3-mcp-telemetry-bridge example snippets
// config/params.php
use Rasuvaeff\Yii3McpTelemetryBridge\MetricsToolCallInterceptor;
use Rasuvaeff\Yii3McpTelemetryBridge\TracingToolCallInterceptor;
'rasuvaeff/yii3-mcp' => [
'interceptors' => [
TracingToolCallInterceptor::class,
MetricsToolCallInterceptor::class,
],
],
$interceptor = new TracingToolCallInterceptor(
tracer: $tracer, // Rasuvaeff\Yii3Telemetry\TracerInterface
argumentMasker: new ArgumentMasker(), // default key list: password, secret, token, api_key, credit_card
sessionBudget: 50, // optional: mirror your `session.budget` param
);
// config/common/di/mcp-telemetry.php
use Rasuvaeff\Yii3McpTelemetryBridge\TracingToolCallInterceptor;
use Rasuvaeff\Yii3Telemetry\TracerInterface;
return [
TracingToolCallInterceptor::class => static function (TracerInterface $tracer) use ($params) {
$budget = $params['rasuvaeff/yii3-mcp']['session']['budget'] ?? 0;
return new TracingToolCallInterceptor($tracer, sessionBudget: $budget);
},
];
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
return (new Configuration())->ignoreErrorsOnPackage(
'rasuvaeff/yii3-mcp-telemetry-bridge',
[ErrorType::UNUSED_DEPENDENCY],
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.