Files
excalidraw-mcp-sentinel/frontend/index.html
T
7143b5e41e feat: add SQLite persistence, multi-tenancy, auto-sync, and CI/Docker improvements (#1)
Replace in-memory storage with SQLite (WAL mode), add workspace-based
multi-tenancy with auto-detection via server.listRoots(), and embed the
canvas server into the MCP process for single-process operation.

🔧 Core enhancements:
- SQLite persistence with versioning, element history, and search
- Multi-tenancy: isolated canvases per workspace (SHA-256 tenant IDs)
- Embedded canvas lifecycle (single node process starts MCP + canvas)
- Auto-sync with 3s debounce and manual override toggle
- Configurable canvas port via CANVAS_PORT env var
- 6 new MCP tools (search, history, tenants, projects)
- Workspace switcher UI with dropdown search
- Sync normalization to prevent bound-text breakage on reload

🐳 Docker & CI improvements:
- BuildKit cache mounts for faster npm installs across builds
- Skip native compilation in frontend-builder stage (--ignore-scripts)
- Build only linux/amd64 on PRs, multi-arch on push to main
- Docker Hub registry with proper build tools for better-sqlite3
- CI and Docker status check gates (github/ci-status-check, github/docker-build-check)

📦 Package & publishing:
- Renamed to @sanjibdevnath/mcp-excalidraw-local (v3.0.0)
- Updated npm-publish workflow for scoped package
- Updated bin entry, keywords, and files list

📝 Documentation:
- README with UI screenshots, architecture diagram, and full feature docs
- Updated agent skill with 32-tool cheatsheet and workflow playbooks
- Fork attribution and upstream comparison table

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 10:17:29 +05:30

420 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Excalidraw POC - Backend API Integration</title>
<style>
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
background-color: #f5f5f5;
}
.header {
position: relative;
background: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}
.header h1 {
margin: 0;
color: #333;
font-size: 24px;
}
.controls {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
button {
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.2s;
}
.btn-primary {
background-color: #007bff;
color: white;
}
.btn-primary:hover {
background-color: #0056b3;
}
.btn-secondary {
background-color: #6c757d;
color: white;
}
.btn-secondary:hover {
background-color: #545b62;
}
.btn-success {
background-color: #28a745;
color: white;
}
.btn-success:hover {
background-color: #218838;
}
.btn-danger {
background-color: #dc3545;
color: white;
}
.btn-danger:hover {
background-color: #c82333;
}
.status {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
}
.status-connected {
background-color: #28a745;
}
.status-disconnected {
background-color: #dc3545;
}
.canvas-container {
height: calc(100vh - 80px);
width: 100%;
position: relative;
}
.api-panel {
position: fixed;
right: 20px;
top: 100px;
background: white;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
padding: 20px;
width: 300px;
max-height: 400px;
overflow-y: auto;
z-index: 1000;
}
.api-panel h3 {
margin: 0 0 15px 0;
color: #333;
font-size: 18px;
}
.api-form {
display: flex;
flex-direction: column;
gap: 10px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 5px;
}
label {
font-weight: 500;
color: #555;
font-size: 14px;
}
input, select {
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-row {
display: flex;
gap: 10px;
}
.form-row .form-group {
flex: 1;
}
.toggle-panel {
position: fixed;
right: 20px;
top: 60px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
padding: 10px;
cursor: pointer;
font-size: 14px;
z-index: 1001;
}
.api-panel.hidden {
display: none;
}
.notification {
position: fixed;
top: 20px;
right: 20px;
padding: 12px 16px;
border-radius: 4px;
color: white;
font-size: 14px;
z-index: 1002;
animation: slideIn 0.3s ease;
}
.notification.success {
background-color: #28a745;
}
.notification.error {
background-color: #dc3545;
}
@keyframes slideIn {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.element-count {
font-size: 14px;
color: #666;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 16px;
color: #666;
}
.loading-content {
text-align: center;
}
.loading-content div:first-child {
margin-bottom: 10px;
}
/* Button group — joined buttons with shared style */
.btn-group {
display: inline-flex;
border-radius: 6px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-group .btn-group-item {
border-radius: 0;
border: none;
padding: 8px 14px;
font-size: 13px;
font-weight: 500;
background: #4caf50;
color: #fff;
transition: background 0.2s;
border-right: 1px solid rgba(255,255,255,0.18);
}
.btn-group .btn-group-item:last-child { border-right: none; }
.btn-group .btn-group-item:hover:not(:disabled) { background: #43a047; }
.btn-group .btn-group-item:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-group .btn-group-item.btn-group-busy { opacity: 0.7; cursor: wait; }
/* Floating toast — centered in the header */
.toast {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #333;
color: #fff;
font-size: 13px;
font-weight: 500;
padding: 5px 16px;
border-radius: 999px;
pointer-events: none;
white-space: nowrap;
animation: toast-in 0.25s ease, toast-out 0.4s ease 1.6s forwards;
z-index: 10;
}
@keyframes toast-in {
from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes toast-out {
from { opacity: 1; }
to { opacity: 0; }
}
/* Header left group */
.header-left {
display: flex;
align-items: center;
gap: 10px;
}
.header-left h1 { margin: 0; color: #333; font-size: 24px; }
/* Clickable tenant badge — opens workspace switcher */
.tenant-badge-btn {
font-size: 12px;
font-weight: 600;
background: #e9ecef;
color: #495057;
padding: 4px 12px;
border-radius: 999px;
white-space: nowrap;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
border: 1px solid transparent;
transition: background 0.15s, border-color 0.15s;
}
.tenant-badge-btn:hover {
background: #dee2e6;
border-color: #ced4da;
}
.tenant-label {
color: #868e96;
font-weight: 400;
}
/* Menu overlay + panel */
.menu-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.15);
z-index: 2000;
}
.menu-panel {
position: absolute;
top: 56px;
left: 100px;
width: 320px;
max-height: calc(100vh - 80px);
background: #fff;
border-radius: 10px;
box-shadow: 0 8px 30px rgba(0,0,0,0.18);
overflow: hidden;
display: flex;
flex-direction: column;
}
.menu-header {
padding: 14px 16px 10px;
font-size: 13px;
font-weight: 700;
color: #888;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid #f0f0f0;
}
.menu-search-wrap {
padding: 8px 10px 4px;
}
.menu-search {
width: 100%;
padding: 7px 10px;
font-size: 13px;
border: 1px solid #ddd;
border-radius: 6px;
outline: none;
box-sizing: border-box;
transition: border-color 0.15s;
}
.menu-search:focus {
border-color: #4caf50;
}
.menu-list {
overflow-y: auto;
max-height: 320px;
padding: 6px;
}
.menu-item {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
padding: 10px 12px;
border: none;
background: none;
border-radius: 6px;
cursor: pointer;
text-align: left;
font-size: 14px;
position: relative;
transition: background 0.15s;
}
.menu-item:hover { background: #f5f5f5; }
.menu-item-active { background: #e8f5e9; }
.menu-item-active:hover { background: #c8e6c9; }
.menu-item-name {
font-weight: 600;
color: #333;
}
.menu-item-path {
font-size: 11px;
color: #999;
margin-top: 2px;
word-break: break-all;
}
.menu-item-check {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
color: #4caf50;
font-weight: 700;
font-size: 16px;
}
.menu-empty {
padding: 20px;
text-align: center;
color: #aaa;
font-size: 13px;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/main.tsx"></script>
</body>
</html>