This repository was archived by the owner on Jul 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConfiguration.php
More file actions
70 lines (64 loc) · 2.83 KB
/
Configuration.php
File metadata and controls
70 lines (64 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
declare(strict_types=1);
namespace PhpLlm\McpBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('mcp');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->scalarNode('app')->defaultValue('app')->end()
->scalarNode('version')->defaultValue('0.0.1')->end()
// ->arrayNode('servers')
// ->useAttributeAsKey('name')
// ->arrayPrototype()
// ->children()
// ->enumNode('transport')
// ->values(['stdio', 'sse'])
// ->isRequired()
// ->end()
// ->arrayNode('stdio')
// ->children()
// ->scalarNode('command')->isRequired()->end()
// ->arrayNode('arguments')
// ->scalarPrototype()->end()
// ->defaultValue([])
// ->end()
// ->end()
// ->end()
// ->arrayNode('sse')
// ->children()
// ->scalarNode('url')->isRequired()->end()
// ->end()
// ->end()
// ->end()
// ->validate()
// ->ifTrue(function ($v) {
// if ('stdio' === $v['transport'] && !isset($v['stdio'])) {
// return true;
// }
// if ('sse' === $v['transport'] && !isset($v['sse'])) {
// return true;
// }
//
// return false;
// })
// ->thenInvalid('When transport is "%s", you must configure the corresponding section.')
// ->end()
// ->end()
// ->end()
->arrayNode('client_transports')
->children()
->booleanNode('stdio')->defaultFalse()->end()
->booleanNode('sse')->defaultFalse()->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}