Add optional Prism Relay MCP server integration#151
Closed
fosron wants to merge 2 commits intolaravel:0.xfrom
Closed
Add optional Prism Relay MCP server integration#151fosron wants to merge 2 commits intolaravel:0.xfrom
fosron wants to merge 2 commits intolaravel:0.xfrom
Conversation
Member
Contributor
Author
|
@pushpak1300 I think using existing Relay library which is made for the underlying Prism package makes more sense. But lets see what maintainers thinks. |
Member
|
Added MR for ai sdk in relay itself instead here. |
| */ | ||
| public function __construct( | ||
| public string $name, | ||
| public ?array $config = null, |
There was a problem hiding this comment.
- 861603977gjansgxc [ yeu] 368- - 2[ stv] 1bnk12@5ydoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds first-party, optional MCP tool integration via Prism Relay without coupling Laravel AI to a required extra package.
What’s included
McpServertool (Laravel\Ai\Providers\Tools\McpServer) to represent an MCP server in an agent’stools().Laravel\Ai\Contracts\Tool)ProviderTool)Prism\Prism\Tool) as pass-throughMcpServer, resolved viaPrism\Relay\RelayFactory::tools(...)prism-php/relayis not installed andMcpServeris used.composer.jsonnow includes asuggestentry forprism-php/relay.Why
Current provider-tool mapping is provider-specific. MCP should be provider-agnostic and composable.
Usage example
Inline custom server config (remote HTTP example):
You can also pass native Prism tools directly (including Relay-generated tools), which enables fully custom MCP calling flows.
How to test
composer require prism-php/relayphp artisan vendor:publish --tag=relay-configconfig/relay.php(HTTP or STDIO).new McpServer('<server-name>')to an agent’stools().Notes
We are still missing proper Streamable HTTP (PR) and OAuth support in the upstream package.