Skip to content

IBX-11536: MCP Servers#3106

Draft
adriendupuis wants to merge 17 commits into5.0from
mcp
Draft

IBX-11536: MCP Servers#3106
adriendupuis wants to merge 17 commits into5.0from
mcp

Conversation

@adriendupuis
Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis commented Mar 26, 2026

Question Answer
JIRA Ticket IBX-11068 > IBX-11536
Versions (TBC)
Edition All? (TBC)

Document built-in MCP Servers and how to create custom ones.

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Comment thread composer.json
"ibexa/core-persistence": "5.0.x-dev",
"ibexa/connector-ai": "5.0.x-dev",
"ibexa/connector-openai": "5.0.x-dev",
"ibexa/mcp": "dev-main",
Copy link
Copy Markdown
Contributor Author

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.

Suggested change
"ibexa/mcp": "dev-main",
"ibexa/mcp": "5.0.x-dev",

Comment thread mkdocs.yml Outdated
Apply SonarCloud Code Analysis warning's suggestion
Comment thread docs/ai/mcp/mcp_guide.md Outdated
@adriendupuis adriendupuis changed the title IBX-11068: MCP Servers IBX-11536: MCP Servers Mar 27, 2026
@github-actions
Copy link
Copy Markdown

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/mcp/config/packages/mcp.yaml


code_samples/mcp/config/packages/mcp.yaml

docs/ai/mcp/mcp_config.md@170:``` yaml
docs/ai/mcp/mcp_config.md@171:[[= include_file('code_samples/mcp/config/packages/mcp.yaml') =]]
docs/ai/mcp/mcp_config.md@172:```

001⫶ibexa:
002⫶ repositories:
003⫶ default:
004⫶ mcp:
005⫶ example:
006⫶ path: /mcp/example
007⫶ enabled: true
008⫶ description: 'Example MCP Server'
009⫶ instructions: 'Use this server to greet someone.'
010⫶ tools:
011⫶ - App\Mcp\ExampleTools
012⫶ discovery_cache: cache.tagaware.filesystem
013⫶ session:
014⫶ type: file
015⫶ directory: '%kernel.cache_dir%/mcp/sessions'
016⫶ system:
017⫶ default:
018⫶ mcp:
019⫶ servers:
020⫶ - example


code_samples/mcp/mcp.sh


code_samples/mcp/mcp.sh

docs/ai/mcp/mcp_config.md@199:``` bash
docs/ai/mcp/mcp_config.md@200:[[= include_file('code_samples/mcp/mcp.sh', 0, 36) =]]
docs/ai/mcp/mcp_config.md@201:```

001⫶baseUrl='http://localhost' # Adapt to your test case
002⫶
003⫶jwtToken=$(curl -s -X 'POST' \
004⫶ "$baseUrl/api/ibexa/v2/user/token/jwt" \
005⫶ -H 'Content-Type: application/json' \
006⫶ -d '{
007⫶ "JWTInput": {
008⫶ "_media-type": "application/vnd.ibexa.api.JWTInput",
009⫶ "username": "admin",
010⫶ "password": "publish"
011⫶ }
012⫶ }' | jq -r .JWT.token)
013⫶
014⫶mcpSessionId=$(curl -s -i -X 'POST' "$baseUrl/mcp/example" \
015⫶ -H "Authorization: Bearer $jwtToken" \
016⫶ -d '{
017⫶ "jsonrpc": "2.0",
018⫶ "id": 1,
019⫶ "method": "initialize",
020⫶ "params": {
021⫶ "protocolVersion": "2025-03-26",
022⫶ "capabilities": {},
023⫶ "clientInfo": {
024⫶ "name": "test-curl-client",
025⫶ "version": "1.0.0"
026⫶ }
027⫶ }
028⫶ }' | grep 'Mcp-Session-Id:' | sed 's/Mcp-Session-Id: \([0-9a-f-]*\).*/\1/')
029⫶
030⫶curl -s -i -X 'POST' "$baseUrl/mcp/example" \
031⫶ -H "Authorization: Bearer $jwtToken" \
032⫶ -H "Mcp-Session-Id: $mcpSessionId" \
033⫶ -d '{
034⫶ "jsonrpc": "2.0",
035⫶ "method": "notifications/initialized"
036⫶ }'

docs/ai/mcp/mcp_config.md@212:``` bash
docs/ai/mcp/mcp_config.md@213:[[= include_file('code_samples/mcp/mcp.sh', 37, 45) =]]
docs/ai/mcp/mcp_config.md@214:```

001⫶curl -s -X 'POST' "$baseUrl/mcp/example" \
002⫶ -H "Authorization: Bearer $jwtToken" \
003⫶ -H "Mcp-Session-Id: $mcpSessionId" \
004⫶ -d '{
005⫶ "jsonrpc": "2.0",
006⫶ "id": 2,
007⫶ "method": "tools/list"
008⫶ }' | jq

docs/ai/mcp/mcp_config.md@244:``` bash
docs/ai/mcp/mcp_config.md@245:[[= include_file('code_samples/mcp/mcp.sh', 46) =]]
docs/ai/mcp/mcp_config.md@246:```




code_samples/mcp/src/Command/McpServerListCommand.php


code_samples/mcp/src/Command/McpServerListCommand.php

docs/ai/mcp/mcp_config.md@183:``` php
docs/ai/mcp/mcp_config.md@184:[[= include_file('code_samples/mcp/src/Command/McpServerListCommand.php') =]]
docs/ai/mcp/mcp_config.md@185:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\mcp\src\Command;
004⫶
005⫶use Ibexa\Contracts\Mcp\McpServerConfigurationRegistryInterface;
006⫶use Symfony\Component\Console\Attribute\AsCommand;
007⫶use Symfony\Component\Console\Command\Command;
008⫶use Symfony\Component\Console\Style\SymfonyStyle;
009⫶
010⫶#[AsCommand(name: 'app:mcp:server_list', description: 'List MCP servers')]
011⫶class McpServerListCommand
012⫶{
013⫶ public function __construct(private readonly McpServerConfigurationRegistryInterface $configRegistry)
014⫶ {
015⫶ }
016⫶
017⫶ public function __invoke(SymfonyStyle $io): int
018⫶ {
019⫶ foreach($this->configRegistry->getServerConfigurations() as $serverConfiguration) {
020⫶ $io->title($serverConfiguration->identifier);
021⫶ dump($serverConfiguration);
022⫶ }
023⫶
024⫶ return Command::SUCCESS;
025⫶ }
026⫶}


code_samples/mcp/src/Mcp/ExampleTools.php


code_samples/mcp/src/Mcp/ExampleTools.php

docs/ai/mcp/mcp_config.md@177:``` php
docs/ai/mcp/mcp_config.md@178:[[= include_file('code_samples/mcp/src/Mcp/ExampleTools.php') =]]
docs/ai/mcp/mcp_config.md@179:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Mcp;
004⫶
005⫶use Ibexa\Contracts\Mcp\Attribute\McpTool;
006⫶use Ibexa\Contracts\Mcp\McpCapabilityInterface;
007⫶use Mcp\Schema\ToolAnnotations;
008⫶
009⫶final readonly class ExampleTools implements McpCapabilityInterface
010⫶{
011⫶ #[McpTool(
012⫶ name: 'greet',
013⫶ description: 'Greet a user by name',
014⫶ annotations: new ToolAnnotations(
015⫶ readOnlyHint: true,
016⫶ destructiveHint: false,
017⫶ idempotentHint: true,
018⫶ openWorldHint: false,
019⫶ ),
020⫶ )]
021⫶ public function greetByName(string $name): string
022⫶ {
023⫶ return sprintf('Hello, %s!', $name);
024⫶ }
025⫶}

Download colorized diff

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
18 Security Hotspots
44.3% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant