feat(saas): live interactive health dashboard, MCP protocol explorer, sandbox widgets & unified navigation
This commit is contained in:
@@ -0,0 +1,495 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Aura Courier MCP — Protocol Explorer & Interactive Playground</title>
|
||||
<meta name="description" content="Interactive Streamable-HTTP Model Context Protocol Explorer & Sandbox for Aura Courier MCP." />
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237c5cff'%3E%3Cpath d='M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z'/%3E%3C/svg%3E" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<style>
|
||||
:root {
|
||||
--bg: #07080a;
|
||||
--bg-elev: #0d0e11;
|
||||
--bg-card: #0f1115;
|
||||
--line: rgba(255, 255, 255, 0.08);
|
||||
--line-strong: rgba(255, 255, 255, 0.16);
|
||||
--text: #f4f5f7;
|
||||
--text-dim: #a4a8b3;
|
||||
--text-faint: #6b7080;
|
||||
--accent: #7c5cff;
|
||||
--accent-glow: rgba(124, 92, 255, 0.35);
|
||||
--cyan: #00d4ff;
|
||||
--good: #10b981;
|
||||
--radius: 12px;
|
||||
--font-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
|
||||
--font-mono: "Geist Mono", "SF Mono", monospace;
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: var(--font-sans);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image:
|
||||
radial-gradient(ellipse at 50% 0%, rgba(124, 92, 255, 0.18), transparent 70%),
|
||||
radial-gradient(ellipse at 20% 30%, rgba(0, 212, 255, 0.08), transparent 50%);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
header {
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: rgba(7, 8, 10, 0.85);
|
||||
backdrop-filter: blur(16px);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
}
|
||||
.nav-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 16px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.logo-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.brand-mark {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(135deg, #7c5cff, #00d4ff);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 16px var(--accent-glow);
|
||||
}
|
||||
.brand-title {
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
.brand-sub {
|
||||
font-size: 12px;
|
||||
color: var(--text-dim);
|
||||
margin-left: 6px;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
.nav-btn {
|
||||
padding: 6px 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
border: 1px solid var(--line);
|
||||
background: var(--bg-card);
|
||||
color: var(--text-dim);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.nav-btn:hover {
|
||||
color: var(--text);
|
||||
border-color: var(--line-strong);
|
||||
background: var(--bg-elev);
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
max-width: 1200px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 36px 24px;
|
||||
}
|
||||
|
||||
.hero-banner {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.hero-title {
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.02em;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.hero-desc {
|
||||
color: var(--text-dim);
|
||||
font-size: 14px;
|
||||
max-width: 800px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.endpoint-card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
padding: 24px;
|
||||
margin-bottom: 32px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
.endpoint-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 12px 16px;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 14px;
|
||||
}
|
||||
.method-tag {
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
background: rgba(124, 92, 255, 0.2);
|
||||
color: #a78bfa;
|
||||
border: 1px solid rgba(124, 92, 255, 0.4);
|
||||
}
|
||||
.endpoint-url {
|
||||
flex: 1;
|
||||
color: var(--cyan);
|
||||
overflow-x: auto;
|
||||
}
|
||||
.copy-btn {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--line);
|
||||
color: var(--text);
|
||||
padding: 6px 12px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.copy-btn:hover {
|
||||
background: var(--line-strong);
|
||||
}
|
||||
|
||||
/* Sandbox Console */
|
||||
.sandbox-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20px;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
@media (max-width: 860px) {
|
||||
.sandbox-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
.panel {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.panel-head {
|
||||
padding: 12px 18px;
|
||||
background: var(--bg-elev);
|
||||
border-bottom: 1px solid var(--line);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.panel-body {
|
||||
padding: 18px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
color: #93c5fd;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12px;
|
||||
resize: vertical;
|
||||
}
|
||||
.action-btn {
|
||||
align-self: flex-start;
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(135deg, #7c5cff, #6366f1);
|
||||
border: none;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 4px 14px var(--accent-glow);
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.action-btn:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.response-view {
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
color: #86efac;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12px;
|
||||
min-height: 220px;
|
||||
max-height: 380px;
|
||||
overflow-y: auto;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Tools Catalog */
|
||||
.tools-section-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.tools-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
.tool-box {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.tool-name {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--cyan);
|
||||
}
|
||||
.tool-desc {
|
||||
font-size: 13px;
|
||||
color: var(--text-dim);
|
||||
line-height: 1.4;
|
||||
}
|
||||
.tool-schema {
|
||||
font-size: 11px;
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
padding: 6px 10px;
|
||||
color: var(--text-faint);
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
footer {
|
||||
border-top: 1px solid var(--line);
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--text-faint);
|
||||
margin-top: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="nav-container">
|
||||
<div class="logo-group">
|
||||
<div class="brand-mark">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="white"><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<span class="brand-title">Aura Courier MCP</span>
|
||||
<span class="brand-sub">Protocol Explorer & Playground</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:12px;align-items:center;">
|
||||
<a href="/" class="nav-btn">← Courier Hub</a>
|
||||
<a href="/health" class="nav-btn">📊 Live Health Status</a>
|
||||
<a href="https://auraajenticai.cloud" target="_blank" class="nav-btn">Aura Main ↗</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="hero-banner">
|
||||
<h1 class="hero-title">Streamable-HTTP MCP Protocol Explorer</h1>
|
||||
<p class="hero-desc">Test MCP JSON-RPC 2.0 initialize handshakes, inspect the 9 registered tool schemas, and connect Gemini, Claude, Cursor & n8n agents directly to this remote endpoint.</p>
|
||||
</div>
|
||||
|
||||
<!-- Endpoint Overview -->
|
||||
<div class="endpoint-card">
|
||||
<div style="font-size:13px;font-weight:600;color:var(--text-dim);text-transform:uppercase;letter-spacing:0.04em;">Official MCP Remote Endpoint</div>
|
||||
<div class="endpoint-row">
|
||||
<span class="method-tag">POST / GET</span>
|
||||
<span class="endpoint-url" id="ep-url">https://courier.auraajenticai.cloud/mcp</span>
|
||||
<button class="copy-btn" onclick="copyEndpoint()">Copy URL</button>
|
||||
</div>
|
||||
<div style="display:flex;gap:20px;flex-wrap:wrap;font-size:12px;color:var(--text-dim);">
|
||||
<div><strong>Protocol:</strong> Model Context Protocol <code>2024-11-05</code></div>
|
||||
<div><strong>Transport:</strong> Streamable-HTTP (SSE + Chunked Transfer)</div>
|
||||
<div><strong>Session Management:</strong> Automatic 1-hour TTL idle sweep</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Interactive Handshake Sandbox -->
|
||||
<div class="sandbox-grid">
|
||||
<div class="panel">
|
||||
<div class="panel-head">
|
||||
<span>Client Request Payload (JSON-RPC 2.0)</span>
|
||||
<span style="font-size:11px;font-family:var(--font-mono);color:var(--cyan);">method: initialize</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<textarea id="req-body">{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"protocolVersion": "2024-11-05",
|
||||
"capabilities": {},
|
||||
"clientInfo": {
|
||||
"name": "Aura-Playground",
|
||||
"version": "2.4.0"
|
||||
}
|
||||
}
|
||||
}</textarea>
|
||||
<button class="action-btn" id="run-btn" onclick="executeHandshake()">Send JSON-RPC Handshake ⚡</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-head">
|
||||
<span>Server Response & Session Headers</span>
|
||||
<span id="res-status" style="font-size:11px;font-family:var(--font-mono);color:var(--good);">Ready</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="response-view" id="res-view">Click "Send JSON-RPC Handshake" to execute a live initialization against https://courier.auraajenticai.cloud/mcp...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Registered Tools Catalog -->
|
||||
<h2 class="tools-section-title">Registered MCP Tools (9 Tools)</h2>
|
||||
<div class="tools-list">
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">1. list_couriers</div>
|
||||
<div class="tool-desc">Returns configured couriers, live credential statuses, and API connectivity.</div>
|
||||
<div class="tool-schema">Input: {} · Returns: Carrier status matrix</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">2. create_parcel</div>
|
||||
<div class="tool-desc">Automated order dispatch with carrier targeting (steadfast, pathao, redx, paperfly) or auto-cascade.</div>
|
||||
<div class="tool-schema">Input: recipient_name, recipient_phone, recipient_address, cod_amount...</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">3. track_parcel</div>
|
||||
<div class="tool-desc">Unified consignment tracking across all 4 Bangladeshi carriers with normalized statuses.</div>
|
||||
<div class="tool-schema">Input: tracking_code, carrier? · Returns: unified tracking history</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">4. get_balance</div>
|
||||
<div class="tool-desc">Merchant COD wallet balance, pending payouts, and carrier ledger synchronization.</div>
|
||||
<div class="tool-schema">Input: carrier? · Returns: current_balance, pending_amount</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">5. check_fraud_risk</div>
|
||||
<div class="tool-desc">Nationwide delivery history, return rate & risk scoring. Zero mock data.</div>
|
||||
<div class="tool-schema">Input: phone_number · Returns: risk_score (0-100), success_rate</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">6. validate_and_geocode_address</div>
|
||||
<div class="tool-desc">Google Maps Platform sublocality, Thana, District and rooftop coordinate geocoding.</div>
|
||||
<div class="tool-schema">Input: address, city? · Returns: lat, lng, formatted_address</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">7. calculate_delivery_zone_and_fee</div>
|
||||
<div class="tool-desc">Dhaka (৳80), Sub-Dhaka (৳100), and Outside Dhaka (৳150) zone tariff calculator.</div>
|
||||
<div class="tool-schema">Input: destination_address, weight_kg? · Returns: zone, base_fee</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">8. compare_courier_rates</div>
|
||||
<div class="tool-desc">Side-by-side cost and SLA quote comparison across all 4 carriers.</div>
|
||||
<div class="tool-schema">Input: destination, weight_kg, cod_amount · Returns: carrier rates</div>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<div class="tool-name">9. resolve_ndr_issue</div>
|
||||
<div class="tool-desc">Non-Delivery Report triage with automated WhatsApp templates and re-dispatch commands.</div>
|
||||
<div class="tool-schema">Input: tracking_code, reason · Returns: triage plan & whatsapp text</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>Aura Courier MCP v2.4 · Built with pride by <a href="https://auraajenticai.cloud" style="color:var(--text);font-weight:600;">Aura Ajentic AI</a> · Apache 2.0 License</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
function copyEndpoint() {
|
||||
navigator.clipboard.writeText("https://courier.auraajenticai.cloud/mcp");
|
||||
alert("Copied Streamable-HTTP endpoint: https://courier.auraajenticai.cloud/mcp");
|
||||
}
|
||||
|
||||
async function executeHandshake() {
|
||||
const btn = document.getElementById('run-btn');
|
||||
const statusEl = document.getElementById('res-status');
|
||||
const viewEl = document.getElementById('res-view');
|
||||
const bodyText = document.getElementById('req-body').value;
|
||||
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Executing...';
|
||||
statusEl.textContent = 'Connecting...';
|
||||
statusEl.style.color = 'var(--cyan)';
|
||||
|
||||
try {
|
||||
const t0 = performance.now();
|
||||
const res = await fetch('/mcp', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json, text/event-stream'
|
||||
},
|
||||
body: bodyText
|
||||
});
|
||||
const elapsed = Math.round(performance.now() - t0);
|
||||
|
||||
const sid = res.headers.get('mcp-session-id') || 'Generated by server';
|
||||
const contentType = res.headers.get('content-type') || '';
|
||||
const resText = await res.text();
|
||||
|
||||
statusEl.textContent = `${res.status} ${res.statusText} (${elapsed}ms)`;
|
||||
statusEl.style.color = res.ok ? 'var(--good)' : 'var(--danger)';
|
||||
|
||||
let formattedOutput = `// HTTP Status: ${res.status} ${res.statusText}\n// Roundtrip: ${elapsed}ms\n// mcp-session-id: ${sid}\n// content-type: ${contentType}\n\n`;
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(resText);
|
||||
formattedOutput += JSON.stringify(parsed, null, 2);
|
||||
} catch {
|
||||
formattedOutput += resText;
|
||||
}
|
||||
|
||||
viewEl.textContent = formattedOutput;
|
||||
} catch (err) {
|
||||
statusEl.textContent = 'Failed';
|
||||
statusEl.style.color = 'var(--danger)';
|
||||
viewEl.textContent = `Error: ${err.message}`;
|
||||
} finally {
|
||||
btn.disabled = false;
|
||||
btn.textContent = 'Send JSON-RPC Handshake ⚡';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user