From d6344bde5ea1edf3140e37c4d6ebd11fac0021e2 Mon Sep 17 00:00:00 2001 From: Chingfeng Li Date: Fri, 24 Oct 2025 10:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0MCP=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91MCP=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/test/test_page.css | 6 +- main/xiaozhi-server/test/test_page.html | 836 ++++++++++++++++++++++-- 2 files changed, 774 insertions(+), 68 deletions(-) diff --git a/main/xiaozhi-server/test/test_page.css b/main/xiaozhi-server/test/test_page.css index c70c9706..bea04994 100644 --- a/main/xiaozhi-server/test/test_page.css +++ b/main/xiaozhi-server/test/test_page.css @@ -21,9 +21,9 @@ h1 { } .section { - margin-bottom: 20px; - padding: 15px; - border-radius: 8px; + margin-bottom: 5px; + padding: 10px; + border-radius: 10px; background-color: #f9f9f9; } diff --git a/main/xiaozhi-server/test/test_page.html b/main/xiaozhi-server/test/test_page.html index 879d627b..2cf9a0ff 100644 --- a/main/xiaozhi-server/test/test_page.html +++ b/main/xiaozhi-server/test/test_page.html @@ -56,6 +56,163 @@ #fileProtocolWarning button:hover { background-color: #45a049; } + + /* MCP 工具管理样式 */ + .mcp-tools-container { + display: grid; + gap: 12px; + margin-top: 10px; + } + + .mcp-tool-card { + background-color: white; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 15px; + transition: all 0.2s; + } + + .mcp-tool-card:hover { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + } + + .mcp-tool-card.disabled { + opacity: 0.6; + pointer-events: none; + } + + .mcp-tool-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; + } + + .mcp-tool-name { + font-size: 15px; + font-weight: 600; + color: #333; + flex: 1; + } + + .mcp-tool-actions { + display: flex; + gap: 6px; + } + + .mcp-tool-description { + color: #666; + font-size: 13px; + line-height: 1.5; + margin-bottom: 8px; + } + + .mcp-tool-info { + background-color: #f9f9f9; + border: 1px solid #e0e0e0; + border-radius: 4px; + padding: 8px; + font-size: 12px; + } + + .mcp-tool-info-row { + display: flex; + gap: 15px; + margin-bottom: 4px; + } + + .mcp-tool-info-label { + color: #999; + min-width: 60px; + } + + .mcp-tool-info-value { + color: #333; + font-family: 'Courier New', monospace; + } + + .mcp-property-item { + background-color: white; + border: 1px solid #e0e0e0; + border-radius: 5px; + padding: 12px; + margin-bottom: 10px; + } + + .mcp-property-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; + } + + .mcp-property-name { + font-weight: 600; + color: #333; + } + + .mcp-property-row { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + margin-bottom: 8px; + } + + .mcp-property-row-full { + margin-bottom: 8px; + } + + .mcp-small-label { + display: block; + margin-bottom: 4px; + font-size: 12px; + color: #666; + } + + .mcp-small-input { + width: 100%; + padding: 6px 8px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 13px; + } + + .mcp-checkbox-label { + display: flex; + align-items: center; + gap: 6px; + font-size: 13px; + color: #666; + cursor: pointer; + } + + .mcp-error { + background-color: #ffebee; + color: #c62828; + padding: 10px; + border-radius: 5px; + margin-bottom: 15px; + font-size: 14px; + } + + .mcp-badge { + display: inline-block; + padding: 2px 8px; + border-radius: 12px; + font-size: 11px; + font-weight: 500; + margin-left: 8px; + } + + .mcp-badge-required { + background-color: #ffebee; + color: #c62828; + } + + .mcp-badge-optional { + background-color: #e3f2fd; + color: #1976d2; + }