relay
An MCP client tool for Prism
claude mcp add --transport stdio prism-php-relay npx -y @modelcontextprotocol/server-puppeteer
How to use
Relay is a PHP-based bridge that connects Prism to external MCP servers (like Puppeteer) so your AI agents can use powerful tools. It defines the MCP servers you want to run and provides a unified way to request tools from those servers through Prism. In practice, you configure a Puppeteer MCP server to enable browser-like automation capabilities (navigation, interaction, screenshots, etc.) and expose those tools to Prism agents. You can then create agents that invoke Relay::tools('puppeteer') and compose those tools alongside other providers in your prompts, enabling automated web tasks within your AI workflows.
How to install
Prerequisites:
- PHP >= 7.4 (or higher) and Composer
- A Laravel project (or any PHP project that can load Composer packages)
Step 1: Install the Relay package
composer require prism-php/relay
Step 2: Publish the configuration
php artisan vendor:publish --tag="relay-config"
Step 3: Configure MCP servers Edit the generated config file (config/relay.php) and define the MCP servers you want to run. Example:
return [
'servers' => [
'puppeteer' => [
'command' => ['npx', '-y', '@modelcontextprotocol/server-puppeteer'],
'timeout' => 30,
'env' => [],
'transport' => \Prism\Relay\Enums\Transport::Stdio,
],
'github' => [
'url' => env('RELAY_GITHUB_SERVER_URL', 'http://localhost:8001/api'),
'timeout' => 30,
'transport' => \Prism\Relay\Enums\Transport::Http,
],
],
'cache_duration' => env('RELAY_TOOLS_CACHE_DURATION', 60), // in minutes (0 to disable)
];
Step 4: Run your application and ensure the Puppeteer MCP server is available. Depending on your setup, you may start a queue or supervisor to manage the subprocess as needed by your hosting environment.
Additional notes
- Relay supports multiple transport types: HTTP (with OAuth 2.1-like flows) and STDIO (local subprocesses). For HTTP, you’ll typically pass tokens via withToken(); for STDIO, use env configuration keys to control server behavior.
- The STDIO transport runs an external MCP server as a subprocess and communicates over standard I/O. This is ideal for running tool servers directly within your application.
- If you enable HTTP transport for a server, you can supply an API key or rely on token-based authentication per the MCP 2025-11-25 spec. Tokens must be refreshed as needed by your app.
- The example here defines a Puppeteer MCP server; you can add additional servers (e.g., GitHub or others) by extending the config accordingly.
- Ensure node and npm are available in environments running STDIO MCP servers (the Puppeteer server relies on Node.js).
Related MCP Servers
nerve
The Simple Agent Development Kit.
laravel-restify
Laravel API for Ai Agents and humans.
dexto
A coding agent and general agent harness for building and orchestrating agentic applications.
mesh
One secure endpoint for every MCP server. Deploy anywhere.
laravel
A Laravel package for implementing secure Model Context Protocol servers using Streamable HTTP and SSE transport, providing real-time communication and a scalable tool system for enterprise environments.
Remote
A type-safe solution to remote MCP communication, enabling effortless integration for centralized management of Model Context.