- 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.