-
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
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
5f6b1e9
df84f07
83abc90
ebe4a8b
c610438
84d8251
62b4929
cacad72
c7937ee
7eef300
cf82940
c16c815
e17866f
f9bbccd
e5c50f8
4d366d5
23b6f80
cd737f6
70a7fad
0d5be8f
2ab0696
7d2cdbe
24a69e5
f6d12d8
50f362f
943f85b
0282b86
e3f9ec1
de226f7
c5d85f9
59cf6c4
69b6fd8
0d37a69
a3f53df
ed12545
0892eb5
d58e901
c994547
6e1de9d
f17069a
4707fdf
014f5a4
88e9069
53fb3fe
1e5d2a3
c7d03f1
5a0070e
4365ea3
3a46b4d
cbe300f
f2d2b44
c66880d
8f9d30f
1600945
c6eca1b
ee533ee
447c8fd
6d0fb67
1e50ec3
e3714d9
a4c3a25
219ebe0
34bd2af
3e50577
6a50634
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; | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
|
|
||
| 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
|
||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
|
|
||
| [[= product_name =]] embed AI capabilities, for example, | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
| to make recommendations to product customers and content readers with [Raptor connector][[#(raptor_connector_guide.md)#]], | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
| 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. | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
| 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. | ||
|
adriendupuis marked this conversation as resolved.
Outdated
|
||
| 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.