-
Notifications
You must be signed in to change notification settings - Fork 81
IBX-11536: MCP Servers #3106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.0
Are you sure you want to change the base?
IBX-11536: MCP Servers #3106
Changes from all commits
148d07c
7307f02
c2215e5
d1b50e2
3b4d89f
a40d3dc
9ba2f81
618984f
81def20
acd9291
c3dca5f
fff74f7
c0e0b7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ibexa: | ||
| repositories: | ||
| default: | ||
| mcp: | ||
| example: | ||
| path: /mcp/example | ||
| enabled: true | ||
| description: 'Example MCP Server' | ||
| instructions: 'Use this server to greet someone.' | ||
| discovery_cache: cache.tagaware.filesystem | ||
| session: | ||
| type: file | ||
| directory: '%kernel.cache_dir%/mcp/sessions' | ||
| system: | ||
| default: | ||
| mcp: | ||
| servers: | ||
| - example |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| baseUrl='http://localhost' # Adapt to your test case | ||
|
|
||
| jwtToken=$(curl -s -X 'POST' \ | ||
| "$baseUrl/api/ibexa/v2/user/token/jwt" \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{ | ||
| "JWTInput": { | ||
| "_media-type": "application/vnd.ibexa.api.JWTInput", | ||
| "username": "admin", | ||
| "password": "publish" | ||
| } | ||
| }' | jq -r .JWT.token) | ||
|
|
||
| mcpSessionId=$(curl -s -i -X 'POST' "$baseUrl/mcp/example" \ | ||
| -H "Authorization: Bearer $jwtToken" \ | ||
| -d '{ | ||
| "jsonrpc": "2.0", | ||
| "id": 1, | ||
| "method": "initialize", | ||
| "params": { | ||
| "protocolVersion": "2025-03-26", | ||
| "capabilities": {}, | ||
| "clientInfo": { | ||
| "name": "test-curl-client", | ||
| "version": "1.0.0" | ||
| } | ||
| } | ||
| }' | grep 'Mcp-Session-Id:' | sed 's/Mcp-Session-Id: \([0-9a-f-]*\).*/\1/') | ||
|
|
||
| curl -s -i -X 'POST' "$baseUrl/mcp/example" \ | ||
| -H "Authorization: Bearer $jwtToken" \ | ||
| -H "Mcp-Session-Id: $mcpSessionId" \ | ||
| -d '{ | ||
| "jsonrpc": "2.0", | ||
| "method": "notifications/initialized" | ||
| }' | ||
|
|
||
| curl -s -X 'POST' "$baseUrl/mcp/example" \ | ||
| -H "Authorization: Bearer $jwtToken" \ | ||
| -H "Mcp-Session-Id: $mcpSessionId" \ | ||
| -d '{ | ||
| "jsonrpc": "2.0", | ||
| "id": 2, | ||
| "method": "tools/list" | ||
| }' | jq | ||
|
|
||
| curl -s -X 'POST' "$baseUrl/mcp/example" \ | ||
| -H "Authorization: Bearer $jwtToken" \ | ||
| -H "Mcp-Session-Id: $mcpSessionId" \ | ||
| -d '{ | ||
| "jsonrpc": "2.0", | ||
| "id": 3, | ||
| "method": "tools/call", | ||
| "params": { | ||
| "name": "greet", | ||
| "arguments": { | ||
| "name": "World" | ||
| } | ||
| } | ||
| }' | jq |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| namespace App\mcp\src\Command; | ||
|
|
||
| use Ibexa\Contracts\Mcp\McpServerConfigurationRegistryInterface; | ||
| use Symfony\Component\Console\Attribute\AsCommand; | ||
| use Symfony\Component\Console\Command\Command; | ||
| use Symfony\Component\Console\Style\SymfonyStyle; | ||
|
|
||
| #[AsCommand(name: 'app:mcp:server_list', description: 'List MCP servers')] | ||
| class McpServerListCommand | ||
| { | ||
| public function __construct(private readonly McpServerConfigurationRegistryInterface $configRegistry) | ||
| { | ||
| } | ||
|
|
||
| public function __invoke(SymfonyStyle $io): int | ||
| { | ||
| foreach($this->configRegistry->getServerConfigurations() as $serverConfiguration) { | ||
| $io->title($serverConfiguration->identifier); | ||
| dump($serverConfiguration); | ||
| } | ||
|
|
||
| return Command::SUCCESS; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| namespace App\mcp\src\Mcp; | ||
|
|
||
| use Ibexa\Contracts\Mcp\Attribute\McpTool; | ||
| use Ibexa\Contracts\Mcp\McpCapabilityInterface; | ||
|
|
||
| final readonly class ExampleTools implements McpCapabilityInterface | ||
| { | ||
| #[McpTool(servers: ['example'], description: 'Greet a user by name')] | ||
| public function greet(string $name): string | ||
| { | ||
| return sprintf('Hello, %s!', $name); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| description: AI interactions with Ibexa DXP | ||
|
Check failure on line 2 in docs/ai/ai.md
|
||
| page_type: landing_page | ||
| month_change: true | ||
| --- | ||
|
|
||
| # Artificial Intelligence (AI) | ||
|
Check notice on line 7 in docs/ai/ai.md
|
||
|
|
||
| [[= product_name =]] embed AI capabilities, for example, | ||
| to make recommendations to product customers and content readers with [Raptor connector][[#(raptor_connector_guide.md)#]], | ||
| or to help editors in the back office with [AI Actions](ai_actions_guide.md). | ||
| It's also opened to external AI capabilities with the exposition of [Model Context Protocol (MCP) servers](mcp_guide.md) to allow agents to interact with the system. | ||
| It's extensible. For example, new AI actions or MCP servers can be implemented. | ||
|
Check notice on line 13 in docs/ai/ai.md
|
||
| To go further, an AI can learn to use the REST API, or learn the PHP API and help you in your development. | ||
|
Check warning on line 14 in docs/ai/ai.md
|
||
|
|
||
| [[= cards([ | ||
| "ai/ai_actions/ai_actions", | ||
| "ai/mcp/mcp", | ||
| ], columns=2) =]] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| description: TODO. | ||
| page_type: landing_page | ||
| month_change: true | ||
| --- | ||
|
|
||
| # MCP Servers | ||
|
Check notice on line 7 in docs/ai/mcp/mcp.md
|
||
|
|
||
| MCP servers allow AI interactions with the system. | ||
| Learn more about this protocol and [[= product_name_base =]] MCP Servers: | ||
|
|
||
| [[= cards([ | ||
| ("ai/mcp/mcp_guide", "MCP Servers guide", "TODO."), | ||
| "ai/mcp/mcp_config", | ||
| ], columns=2) =]] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test if the alias exist yet but at some point this constraint will have to use it.