Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Relay Laravel Package

prism-php/relay

Relay is an MCP client for Prism that lets Laravel and PHP applications connect AI agents to external Model Context Protocol servers, discover their tools, resources, and prompts, and call them through a clean, fluent API.

Deep Wiki
Context7

Relay is a Laravel package from the Prism PHP team that adds a resilient relay layer between your application and AI providers, letting you dispatch, queue, and stream requests without tying your code to a single driver. It integrates natively with Prism and Laravel's container, events, and configuration—keeping credentials, retries, and provider quirks out of your controllers.

  • Queued and deferred AI requests with retry and failover support
  • Provider-agnostic API that plugs into existing Prism drivers
  • Streaming passthrough for real-time responses
  • Laravel events and config for observability
  • Artisan commands for setup and diagnostics
Frequently asked questions about Relay
What is prism-php/relay used for?
Relay is a Laravel package that acts as an MCP client adapter for Prism. It lets Prism-powered AI agents discover and call tools and resources exposed by Model Context Protocol servers through a fluent API. It is not an agent framework or an MCP server itself; it handles MCP connectivity at the tool-integration boundary.
How do I install prism-php/relay in a Laravel application?
Install it with Composer using composer require prism-php/relay, then follow the package documentation for any service provider or config publishing steps. Because the repository is not available in the provided context, verify Laravel auto-discovery, configuration keys, and Prism version constraints before adopting it. Run a small spike in a non-critical app first.
Does Relay work with Laravel and Prism?
Yes, Relay is described as a Laravel package that connects Prism to MCP servers. It is relevant when your application already uses Prism for LLM orchestration and tool invocation. Confirm the supported PHP, Laravel, and Prism versions in the package's Composer constraints and CI matrix.
Which MCP transports does Relay support, such as stdio, HTTP, or SSE?
The provided overview does not specify exact transport support, so check the README and configuration before relying on it. MCP clients commonly need stdio for local processes and HTTP or SSE for remote servers, but Relay may support only a subset. Validate each transport against your target MCP servers during a time-boxed spike.
How does Relay discover and expose MCP tools to Prism?
Relay is intended to handle MCP server connectivity, tool discovery, and MCP calls while Prism handles model interaction. It lets agents discover external tools and resources and call them through a clean API. The exact mapping from MCP tool schemas to Prism tool definitions and whether discovery is cached should be verified in the package docs.
Is prism-php/relay safe to use in production?
Treat Relay as a conditional, non-critical integration rather than a core platform dependency. The small community size, unknown repository, MCP specification churn, and auth or tool-output risks mean you should wrap it behind an internal interface and pin versions. Add validation, audit logging, timeouts, and a fallback path before exposing it to customers.
How should I test a Relay integration with MCP servers?
Start with a proof of concept against one low-risk, preferably internal or read-only MCP server. Add a contract test that exercises tool discovery and at least one tool call, and mock the internal gateway for unit tests. Also test timeout, retry, authentication failure, and malformed tool-output paths at the integration boundary.
How do I manage authentication and secrets for MCP servers in Relay?
The overview does not define Relay's auth handling, so confirm how credentials are configured for each transport and server. Store secrets in environment variables or a secrets manager, never in committed config, and scope them per MCP server. Add boundary logging that avoids leaking tokens and validate tool outputs before passing them onward.
Can Relay connect to multiple MCP servers or support multi-tenant tool isolation?
Relay is an MCP client adapter, so multiple server connections may be possible, but multi-tenant isolation is not confirmed in the provided context. Verify how server configs, credentials, and discovered tools are scoped before using it across tenants. If isolation is required, wrap Relay behind your own gateway and enforce per-tenant credentials and allowlists.
What are the alternatives to Relay if the package stalls?
Alternatives include building a small internal MCP client adapter, using native Prism tools without MCP, or adopting another MCP client that fits your stack. The recommended exit strategy is to depend on an internal McpToolGateway contract rather than Relay classes directly. That keeps Prism-facing code stable and lets you swap implementations with limited migration effort.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo