feat(mcp): 设置 → MCP 子页 + 策略 API + 官网/文档接入

借鉴 DBX:安装检测(Node/npm/包/Go 二进制)、只读与 allow_dangerous、
连接白名单、多客户端配置片段;GET/PUT /api/ai/mcp-policy、/mcp-install;
文档 /docs/mcp 与落地页 AI/MCP 块;对照 docs/16 勾选设置项、列仍未完清单。
This commit is contained in:
logan committed 2026-10-15 14:13:20 +08:00
1 parent 5416e86379
commit 1513f4bc2d
20 files changed
+1567 -98

No files matched your search

+2
View File
@@ -15,6 +15,7 @@ type MCPStatus struct {
Mode string `json:"mode"`
WhitelistCount int `json:"whitelistCount"`
WritesEnabled bool `json:"writesEnabled"`
AllowDangerous bool `json:"allowDangerous"`
Active bool `json:"active"` // 近 5 分钟有 source=mcp 审计
Recent []AuditEntry `json:"recent,omitempty"`
PolicyPath string `json:"policyPath,omitempty"`
@@ -37,6 +38,7 @@ func GetMCPStatus() MCPStatus {
}
st.WhitelistCount = len(p.AllowedConnectionIDs)
st.WritesEnabled = p.WritesEnabled()
st.AllowDangerous = p.AllowDangerous
st.Configured = st.Configured || st.WhitelistCount > 0
}
if ap, err := AuditPath(); err == nil {