-
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 21 commits
148d07c
7307f02
c2215e5
d1b50e2
3b4d89f
a40d3dc
9ba2f81
618984f
81def20
acd9291
c3dca5f
fff74f7
c0e0b7e
ad3cc47
0836df3
736edd1
6107946
a6953e1
a73386b
ec27fdf
b588db3
266ea8b
910c49c
d101b58
71e80cb
c9e1c82
181fb77
d8cc209
a5ba48b
f4d55f8
12a15be
e568133
546acd6
05f0f5c
686c428
b201298
90c44f2
39b4645
71f5890
b144d93
ad17a4b
648fa58
5806a08
a116dea
781e516
8284cc9
6399410
6e90953
d5615d9
2fd9ba5
29bf219
bdee1e1
208b65e
1c58dcc
24b2b81
a214f9f
1e881eb
f3185a3
5ea4811
f986db5
3f4a393
a52c164
3fa7efb
282a02c
178ca6a
adb2947
56c2261
a28ab1e
80a7de9
7b3fca4
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,20 @@ | ||
| ibexa: | ||
| repositories: | ||
| default: | ||
| mcp: | ||
| example: | ||
| path: /mcp/example | ||
| enabled: true | ||
| description: 'Example MCP Server' | ||
| instructions: 'Use this server to greet someone.' | ||
| tools: | ||
| - App\Mcp\ExampleTools | ||
| 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,29 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| namespace App\Mcp; | ||
|
|
||
| use Ibexa\Contracts\Mcp\Attribute\McpTool; | ||
| use Ibexa\Contracts\Mcp\McpCapabilityInterface; | ||
| use Mcp\Schema\Icon; | ||
| use Mcp\Schema\ToolAnnotations; | ||
|
|
||
| final readonly class ExampleTools implements McpCapabilityInterface | ||
| { | ||
| #[McpTool( | ||
| name: 'greet', | ||
| description: 'Greet a user by name', | ||
| icons: [new Icon( | ||
| src: 'https://openmoji.org/data/color/svg/1F44B.svg', | ||
| )], | ||
| annotations: new ToolAnnotations( | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| idempotentHint: true, | ||
| openWorldHint: false, | ||
| ), | ||
| )] | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
| public function greetByName(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) =]] | ||
Uh oh!
There was an error while loading. Please reload this page.