1. Go to this page and download the library: Download vinkius/laravel-mcp-connect 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/ */
vinkius / laravel-mcp-connect example snippets
use Vinkius\McpConnect\Facades\Mcp;
// Search the marketplace
$results = Mcp::search('github issues');
// Inspect a tool's schema
$schema = Mcp::inspect('github__create_issue');
// Execute a tool
$result = Mcp::execute('github__create_issue', [
'owner' => 'my-org',
'repo' => 'my-repo',
'title' => 'Bug: Login broken on mobile',
]);
echo $result->text(); // "Issue #42 created successfully"
use Vinkius\McpConnect\Facades\Mcp;
// List all activated servers and their tools (}: " . implode(', ', $server->toolNames());
}
// Search the catalog (
// Browse marketplace categories
$categories = Mcp::categories();
foreach ($categories as $cat) {
echo "{$cat->label}: {$cat->listingCount} apps";
}
// Fetch paginated listings with filters
$response = Mcp::listings(['category' => 'ai', 'page' => 2, 'sort' => 'popular']);
foreach ($response['data'] as $listing) {
echo "{$listing->title} — {$listing->priceFormatted()}";
}
// Get full detail for a single listing
$listing = Mcp::listing('github-mcp');
echo "{$listing->title}: " . implode(', ', $listing->toolNames());
// Featured sections for discovery carousels
$featured = Mcp::featured();
// Search marketplace listings
$results = Mcp::searchListings('payment processing');
// Always inspect before executing — know the exact parameters
$schema = Mcp::inspect('github__create_issue');
echo $schema->description;
// "Create a new issue in a GitHub repository"
print_r($schema->inputSchema);
// ["type" => "object", "properties" => [...], "
$result = Mcp::execute('github__create_issue', [
'owner' => 'my-org',
'repo' => 'my-repo',
'title' => 'Automated issue from Laravel',
'body' => 'Created via MCP Connect.',
]);
if ($result->successful()) {
$data = $result->json(); // Parsed JSON from first content block
} else {
$error = $result->text(); // Error message
}
// Activate a marketplace listing
$activation = Mcp::activate('listing-uuid');
if ($activation->;
}
// Deactivate a subscription
Mcp::deactivate('subscription-uuid');