Files
ulthon_admin/config/mcp.php

22 lines
1.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use think\facade\Env;
// +----------------------------------------------------------------------
// | MCP 服务配置(/mcp 端点app/mcp 独立应用)
// +----------------------------------------------------------------------
return [
// 是否启用 MCP 端点false 时所有请求 403
'enable' => Env::get('mcp.enable', true),
// MCP serverInfo.nameinitialize 响应中的服务名)
'server_name' => Env::get('mcp.server_name', 'ulthon_admin'),
// DNS rebinding 防护 Host 白名单(不含端口)。
// 为空(默认):不启用 DNS rebinding 防护中间件——端点已有 Bearer 密钥认证,
// 且生产部署的 Host 是业务域名SDK 默认白名单(仅 localhost 变体)会导致全部 403。
// 非空(如本地调试场景):启用 SDK DnsRebindingProtectionMiddleware仅放行列表内 Host/Origin。
'allowed_hosts' => array_filter(array_map('trim', explode(',', (string) Env::get('mcp.allowed_hosts', '')))),
];