Add MCP server (v1 read-only): toggle, per-pane gate, panel UI

This commit is contained in:
megaproxy 2026-05-25 21:31:49 +01:00
parent 6068522ee3
commit 83d8932c98
15 changed files with 1235 additions and 7 deletions

191
src/components/McpPanel.css Normal file
View file

@ -0,0 +1,191 @@
.mcp-panel {
position: fixed;
top: 8vh;
left: 50%;
transform: translateX(-50%);
width: min(680px, 92vw);
max-height: 84vh;
background: #161616;
color: #ccc;
border: 1px solid #2a2a2a;
border-radius: 8px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
z-index: 100;
display: flex;
flex-direction: column;
overflow: hidden;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
}
.mcp-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
border-bottom: 1px solid #2a2a2a;
}
.mcp-title { font-weight: 600; font-size: 13px; }
.mcp-close {
background: transparent; border: none; color: #888;
font-size: 18px; line-height: 1; padding: 2px 8px;
cursor: pointer; border-radius: 3px;
}
.mcp-close:hover { background: #2a2a2a; color: #ddd; }
.mcp-body {
padding: 14px 18px;
overflow-y: auto;
font-size: 12px;
line-height: 1.45;
}
.mcp-blurb {
color: #aaa;
margin: 0 0 12px;
}
.mcp-toggle-row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
.mcp-toggle {
font: inherit;
font-family: inherit;
font-size: 12px;
font-weight: 600;
padding: 6px 14px;
border-radius: 4px;
cursor: pointer;
background: #222;
color: #999;
border: 1px solid #2a2a2a;
display: inline-flex;
align-items: center;
gap: 8px;
}
.mcp-toggle:hover:not(:disabled) { background: #2a2a2a; color: #ddd; }
.mcp-toggle:disabled { opacity: 0.5; cursor: progress; }
.mcp-toggle.on {
background: #1a3a1a;
color: #80e080;
border-color: #2a6a2a;
}
.mcp-dot {
width: 8px; height: 8px;
border-radius: 50%;
background: #555;
}
.mcp-toggle.on .mcp-dot {
background: #80e080;
box-shadow: 0 0 6px rgba(128, 224, 128, 0.6);
}
.mcp-allow-count {
color: #888;
font-size: 11px;
}
.mcp-allow-warn {
color: #d8a040;
}
.mcp-field {
margin-bottom: 12px;
}
.mcp-field label {
display: block;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #777;
margin-bottom: 3px;
}
.mcp-field-row {
display: flex;
gap: 6px;
}
.mcp-field input {
flex: 1 1 auto;
font: inherit;
font-family: inherit;
font-size: 12px;
color: #e6e6e6;
background: #0c0c0c;
border: 1px solid #2a2a2a;
border-radius: 3px;
padding: 4px 8px;
outline: none;
}
.mcp-field button {
font: inherit;
font-family: inherit;
font-size: 11px;
background: #222;
color: #aac;
border: 1px solid #2a2a3a;
border-radius: 3px;
padding: 0 10px;
cursor: pointer;
}
.mcp-field button:hover {
background: #2a2a3a;
color: #ccd;
}
.mcp-snippet {
font: inherit;
font-family: inherit;
font-size: 11px;
background: #0c0c0c;
border: 1px solid #2a2a2a;
border-radius: 3px;
padding: 8px 10px;
margin: 0 0 6px;
color: #cce6ff;
white-space: pre-wrap;
word-break: break-all;
}
.mcp-tips {
background: #1a2030;
border: 1px solid #2a3040;
border-radius: 4px;
padding: 10px 12px;
color: #aac;
font-size: 11px;
margin: 12px 0;
}
.mcp-tips strong { color: #cce6ff; }
.mcp-tips code {
background: #0c0c0c;
padding: 1px 4px;
border-radius: 2px;
font-family: inherit;
}
.mcp-tips pre {
font: inherit;
font-family: inherit;
background: #0c0c0c;
padding: 6px 8px;
border-radius: 3px;
margin: 4px 0;
color: #cce6ff;
}
.mcp-off-hint {
color: #888;
font-size: 11px;
font-style: italic;
margin: 8px 0 12px;
}
.mcp-security {
margin: 12px 0 0;
padding-top: 10px;
border-top: 1px solid #2a2a2a;
color: #888;
font-size: 11px;
line-height: 1.45;
}
.mcp-security strong { color: #d8a040; }
.mcp-security em { color: #d88; font-style: normal; }