|
29 | 29 | */
|
30 | 30 | 'discovery' => [
|
31 | 31 | 'base_path' => base_path(),
|
32 |
| - 'directories' => [ |
33 |
| - env('MCP_DISCOVERY_PATH', 'app/Mcp'), |
34 |
| - ], |
| 32 | + 'directories' => array_filter(explode(',', env('MCP_DISCOVERY_DIRECTORIES', 'app/Mcp'))), |
35 | 33 | 'exclude_dirs' => [
|
36 | 34 | 'vendor',
|
37 | 35 | 'tests',
|
|
46 | 44 | '.git',
|
47 | 45 | ],
|
48 | 46 | 'definitions_file' => base_path('routes/mcp.php'),
|
49 |
| - 'auto_discover' => env('MCP_AUTO_DISCOVER', true), |
50 |
| - 'save_to_cache' => env('MCP_DISCOVERY_SAVE_TO_CACHE', true), |
| 47 | + 'auto_discover' => (bool) env('MCP_AUTO_DISCOVER', true), |
| 48 | + 'save_to_cache' => (bool) env('MCP_DISCOVERY_SAVE_TO_CACHE', true), |
51 | 49 | ],
|
52 | 50 |
|
53 | 51 | /*
|
54 | 52 | |--------------------------------------------------------------------------
|
55 | 53 | | MCP Cache Configuration
|
56 | 54 | |--------------------------------------------------------------------------
|
57 | 55 | |
|
58 |
| - | Configure how the MCP server caches discovered elements and transport |
59 |
| - | state using Laravel's cache system. You can specify which store to use |
60 |
| - | and how long items should be cached. |
| 56 | + | Configure how the MCP server caches discovered elements using Laravel's cache system. |
| 57 | + | You can specify which store to use and how long items should be cached. |
61 | 58 | |
|
62 | 59 | */
|
63 | 60 | 'cache' => [
|
64 | 61 | 'store' => env('MCP_CACHE_STORE', config('cache.default')),
|
65 |
| - 'ttl' => env('MCP_CACHE_TTL', 3600), |
66 | 62 | ],
|
67 | 63 |
|
68 | 64 | /*
|
69 | 65 | |--------------------------------------------------------------------------
|
70 | 66 | | MCP Transport Configuration
|
71 | 67 | |--------------------------------------------------------------------------
|
72 | 68 | |
|
73 |
| - | Configure the available transports for MCP communication. Three types are |
74 |
| - | supported: stdio for CLI clients, http_dedicated for a standalone server, |
75 |
| - | and http_integrated for serving through Laravel's routing system. |
| 69 | + | Configure the available transports for MCP communication. |
76 | 70 | |
|
| 71 | + | Supported Transports: |
| 72 | + | - `stdio`: for CLI clients. |
| 73 | + | - `http_dedicated`: for a standalone server running on a process. |
| 74 | + | - `http_integrated`: for serving through Laravel's routing system. |
77 | 75 | */
|
78 | 76 | 'transports' => [
|
79 | 77 | 'stdio' => [
|
80 |
| - 'enabled' => env('MCP_STDIO_ENABLED', true), |
| 78 | + 'enabled' => (bool) env('MCP_STDIO_ENABLED', true), |
81 | 79 | ],
|
82 | 80 |
|
83 | 81 | 'http_dedicated' => [
|
|
88 | 86 | 'path_prefix' => env('MCP_HTTP_DEDICATED_PATH_PREFIX', 'mcp'),
|
89 | 87 | 'ssl_context_options' => [],
|
90 | 88 | 'enable_json_response' => (bool) env('MCP_HTTP_DEDICATED_JSON_RESPONSE', true),
|
91 |
| - 'event_store' => env('MCP_HTTP_DEDICATED_EVENT_STORE'), // FQCN or null |
| 89 | + 'event_store' => null, // FQCN or null |
92 | 90 | ],
|
93 | 91 |
|
94 | 92 | 'http_integrated' => [
|
95 | 93 | 'enabled' => (bool) env('MCP_HTTP_INTEGRATED_ENABLED', true),
|
96 | 94 | 'legacy' => (bool) env('MCP_HTTP_INTEGRATED_LEGACY', false),
|
97 | 95 | 'route_prefix' => env('MCP_HTTP_INTEGRATED_ROUTE_PREFIX', 'mcp'),
|
98 |
| - 'middleware' => explode(',', env('MCP_HTTP_INTEGRATED_MIDDLEWARE', 'web')), |
| 96 | + 'middleware' => explode(',', env('MCP_HTTP_INTEGRATED_MIDDLEWARE', 'api')), |
99 | 97 | 'domain' => env('MCP_HTTP_INTEGRATED_DOMAIN'),
|
100 | 98 | 'sse_poll_interval' => (int) env('MCP_HTTP_INTEGRATED_SSE_POLL_SECONDS', 1),
|
101 | 99 | 'cors_origin' => env('MCP_HTTP_INTEGRATED_CORS_ORIGIN', '*'),
|
102 |
| - 'enable_json_response' => (bool) env('MCP_HTTP_INTEGRATED_JSON_RESPONSE', false), |
103 |
| - 'json_response_timeout' => (int) env('MCP_HTTP_INTEGRATED_JSON_TIMEOUT', 30), |
104 |
| - 'event_store' => env('MCP_HTTP_INTEGRATED_EVENT_STORE'), // FQCN or null |
| 100 | + 'enable_json_response' => (bool) env('MCP_HTTP_INTEGRATED_JSON_RESPONSE', true), |
| 101 | + 'event_store' => null, // FQCN or null |
105 | 102 | ],
|
106 | 103 | ],
|
107 | 104 |
|
| 105 | + /* |
| 106 | + |-------------------------------------------------------------------------- |
| 107 | + | Session Management Configuration |
| 108 | + |-------------------------------------------------------------------------- |
| 109 | + | |
| 110 | + | Configure how the MCP server manages client sessions. Sessions store |
| 111 | + | client state, message queues, and subscriptions. Supports Laravel's |
| 112 | + | native session drivers for seamless integration. |
| 113 | + | |
| 114 | + */ |
| 115 | + 'session' => [ |
| 116 | + 'driver' => env('MCP_SESSION_DRIVER', 'cache'), // 'file', 'cache', 'database', 'redis', 'memcached', 'dynamodb', 'array' |
| 117 | + 'ttl' => (int) env('MCP_SESSION_TTL', 3600), |
| 118 | + |
| 119 | + // For cache-based drivers (redis, memcached, etc.) |
| 120 | + 'store' => env('MCP_SESSION_CACHE_STORE', config('cache.default')), |
| 121 | + |
| 122 | + // For file driver |
| 123 | + 'path' => env('MCP_SESSION_FILE_PATH', storage_path('framework/mcp_sessions')), |
| 124 | + |
| 125 | + // For database driver |
| 126 | + 'connection' => env('MCP_SESSION_DB_CONNECTION', config('database.default')), |
| 127 | + 'table' => env('MCP_SESSION_DB_TABLE', 'mcp_sessions'), |
| 128 | + |
| 129 | + // Session garbage collection probability. 2% chance that garbage collection will run on any given session operation. |
| 130 | + 'lottery' => [2, 100], |
| 131 | + ], |
| 132 | + |
108 | 133 | /*
|
109 | 134 | |--------------------------------------------------------------------------
|
110 | 135 | | Pagination Limit
|
|
128 | 153 | */
|
129 | 154 | 'capabilities' => [
|
130 | 155 | 'tools' => [
|
131 |
| - 'enabled' => env('MCP_CAP_TOOLS_ENABLED', true), |
132 |
| - 'listChanged' => env('MCP_CAP_TOOLS_LIST_CHANGED', true), |
| 156 | + 'enabled' => (bool) env('MCP_CAP_TOOLS_ENABLED', true), |
| 157 | + 'listChanged' => (bool) env('MCP_CAP_TOOLS_LIST_CHANGED', true), |
133 | 158 | ],
|
134 | 159 |
|
135 | 160 | 'resources' => [
|
136 |
| - 'enabled' => env('MCP_CAP_RESOURCES_ENABLED', true), |
137 |
| - 'subscribe' => env('MCP_CAP_RESOURCES_SUBSCRIBE', true), |
138 |
| - 'listChanged' => env('MCP_CAP_RESOURCES_LIST_CHANGED', true), |
| 161 | + 'enabled' => (bool) env('MCP_CAP_RESOURCES_ENABLED', true), |
| 162 | + 'subscribe' => (bool) env('MCP_CAP_RESOURCES_SUBSCRIBE', true), |
| 163 | + 'listChanged' => (bool) env('MCP_CAP_RESOURCES_LIST_CHANGED', true), |
139 | 164 | ],
|
140 | 165 |
|
141 | 166 | 'prompts' => [
|
142 |
| - 'enabled' => env('MCP_CAP_PROMPTS_ENABLED', true), |
143 |
| - 'listChanged' => env('MCP_CAP_PROMPTS_LIST_CHANGED', true), |
| 167 | + 'enabled' => (bool) env('MCP_CAP_PROMPTS_ENABLED', true), |
| 168 | + 'listChanged' => (bool) env('MCP_CAP_PROMPTS_LIST_CHANGED', true), |
144 | 169 | ],
|
145 | 170 |
|
146 | 171 | 'logging' => [
|
147 |
| - 'enabled' => env('MCP_CAP_LOGGING_ENABLED', true), |
148 |
| - 'setLevel' => env('MCP_CAP_LOGGING_SET_LEVEL', false), |
| 172 | + 'enabled' => (bool) env('MCP_CAP_LOGGING_ENABLED', true), |
| 173 | + 'setLevel' => (bool) env('MCP_CAP_LOGGING_SET_LEVEL', false), |
149 | 174 | ],
|
150 | 175 | ],
|
151 | 176 |
|
|
0 commit comments