Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

18.6 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MCP in chat</title>
<style>
  :root {
    --page: #e9ece9;
    --pane: #ffffff;
    --bubble: #f1f3f1;
    --ink: #0f1a13;
    --ink2: #3e4a42;
    --ink3: #5f6b63;
    --ring: rgba(15, 26, 19, 0.10);
    --chip: rgba(15, 26, 19, 0.07);
    --chip-hover: rgba(15, 26, 19, 0.12);
    --inset: rgba(15, 26, 19, 0.045);
    --success: #1f7a4d;
    --kiwi: #1f7f6e;
    --dodo: #c2621b;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; background: var(--page); color: var(--ink);
    font: 15px/22px -apple-system, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
  .bar { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 16px 10px; background: var(--page); }
  .tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(15,26,19,0.07); }
  .tabs button { border: 0; background: transparent; font: 500 13px/20px inherit; font-family: inherit; color: var(--ink2);
    padding: 4px 14px; border-radius: 999px; cursor: pointer; }
  .tabs button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 0 0 0.5px var(--ring); }
  .caption { font-size: 13px; line-height: 18px; color: var(--ink3); text-align: center; max-width: 720px; min-height: 18px; }
  .window { width: 752px; max-width: calc(100vw - 32px); height: 720px; margin: 0 auto 32px; background: var(--pane);
    border-radius: 12px; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.16), 0 12px 40px rgba(0,0,0,0.10);
    display: flex; flex-direction: column; overflow: hidden; }
  .head { position: relative; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; }
  .botpill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px 5px 8px; border-radius: 999px;
    background: #fff; box-shadow: 0 0 0 0.5px var(--ring); font-weight: 500; font-size: 15px; }
  .botpill img { width: 26px; height: 26px; border-radius: 50%; }
  .model { position: absolute; right: 52px; top: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    border-radius: 999px; box-shadow: 0 0 0 0.5px var(--ring); font-size: 13px; color: var(--ink2); }
  .screen { position: absolute; right: 18px; top: 18px; color: var(--ink2); }
  .thread { flex: 1; overflow-y: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; }
  .row { display: flex; flex-direction: column; align-items: flex-start; }
  .row.gap { margin-top: 12px; }
  .bubble { max-width: 560px; background: var(--bubble); border-radius: 18px; padding: 10px 12px; }
  .bubble p { margin: 0; }
  .bubble p + p { margin-top: 8px; }
  .bubble code { font: 13px/18px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(15,26,19,0.06); padding: 1px 4px; border-radius: 5px; }
  .user { align-self: flex-end; max-width: 520px; color: #fff; border-radius: 18px; padding: 8px 14px; margin-top: 12px; }
  .activity { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink3); padding: 6px 2px; max-width: 560px; }
  .activity .sep { opacity: 0.6; }
  .activity .more { margin-left: 2px; color: var(--ink3); display: inline-flex; align-items: center; cursor: default; }
  .activity b { font-weight: 500; color: var(--ink2); }
  .card { width: 100%; max-width: 560px; border-radius: 20px; padding: 12px 16px 14px; background: #fff; box-shadow: 0 0 0 0.5px var(--ring); }
  .card .who { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink2); margin-bottom: 6px; }
  .card .who img { width: 16px; height: 16px; border-radius: 50%; }
  .card .title { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 15px; line-height: 22px; }
  .card .title svg { margin-top: 3px; color: var(--ink2); flex: none; }
  .card .expl { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--ink2); }
  .card .detail { margin-top: 8px; border-radius: 12px; background: var(--inset); padding: 8px 12px; color: var(--ink2);
    font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
  .card .detail .k { color: var(--ink3); }
  .card .field { margin-top: 12px; display: flex; }
  .card .field input { flex: 1; height: 36px; border-radius: 999px; border: 1px solid rgba(15,26,19,0.16); background: #f7f8f7;
    padding: 0 14px; font: 14px/20px inherit; font-family: inherit; color: var(--ink); outline: none; }
  .card .foot { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 16px; border-radius: 999px; border: 0;
    font: 500 14px/20px inherit; font-family: inherit; cursor: pointer; background: var(--chip); color: var(--ink); }
  .btn:hover { background: var(--chip-hover); }
  .btn.primary { color: #fff; }
  .btn.primary:hover { filter: brightness(1.08); }
  .settled { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink3); max-width: 560px; padding: 4px 2px; }
  .settled .s { color: var(--ink2); }
  .ok { color: var(--success); }
  .spin { animation: spin 0.9s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .composer { flex: none; margin: 0 20px 14px; height: 48px; border-radius: 999px; background: #fff;
    box-shadow: 0 0 0 1px #e3e9e4; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 10px; }
  .composer .plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); box-shadow: 0 0 0 1px #e3e9e4; }
  .composer .ph { flex: 1; color: #8a948d; font-size: 15px; }
  .composer .mic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
  .divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; font-size: 13px; color: var(--ink3); }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(15,26,19,0.08); }
  .fade-in { animation: fade 0.25s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
</style>
</head>
<body>
<svg width="0" height="0" style="position:absolute">
  <defs>
    <symbol id="i-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></symbol>
    <symbol id="i-x" viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></symbol>
    <symbol id="i-login" viewBox="0 0 24 24"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" x2="3" y1="12" y2="12"/></symbol>
    <symbol id="i-plug" viewBox="0 0 24 24"><path d="M12 22v-5"/><path d="M9 8V2"/><path d="M15 8V2"/><path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"/></symbol>
    <symbol id="i-power" viewBox="0 0 24 24"><path d="M12 2v10"/><path d="M18.4 6.6a9 9 0 1 1-12.77.04"/></symbol>
    <symbol id="i-trash" viewBox="0 0 24 24"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></symbol>
    <symbol id="i-key" viewBox="0 0 24 24"><path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"/><circle cx="16.5" cy="7.5" r=".5" fill="currentColor"/></symbol>
    <symbol id="i-ext" viewBox="0 0 24 24"><path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3"/></symbol>
    <symbol id="i-plus" viewBox="0 0 24 24"><path d="M5 12h14"/><path d="M12 5v14"/></symbol>
    <symbol id="i-chev" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></symbol>
    <symbol id="i-chevd" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></symbol>
    <symbol id="i-load" viewBox="0 0 24 24"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></symbol>
    <symbol id="i-audio" viewBox="0 0 24 24"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></symbol>
    <symbol id="i-monitor" viewBox="0 0 24 24"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></symbol>
    <symbol id="i-pencil" viewBox="0 0 24 24"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/></symbol>
  </defs>
</svg>

<div class="bar">
  <div class="tabs" role="group" aria-label="State">
    <button data-tab="today">Today</button>
    <button data-tab="signin">Sign-in · Full access</button>
    <button data-tab="ask">Sign-in · Ask mode</button>
    <button data-tab="fix">Fix or remove</button>
  </div>
  <div class="caption" id="caption"></div>
</div>

<div class="window">
  <div class="head">
    <span class="botpill"><img id="headAvatar" alt=""><span id="headName"></span></span>
    <span class="model">GPT-5.6-Terra <svg width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#i-chevd"/></svg></span>
    <span class="screen"><svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><use href="#i-monitor"/></svg></span>
  </div>
  <div class="thread" id="thread"></div>
  <div class="composer">
    <span class="plus"><svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><use href="#i-plus"/></svg></span>
    <span class="ph" id="placeholder"></span>
    <span class="mic" id="mic"><svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><use href="#i-audio"/></svg></span>
  </div>
</div>

<script>
const BOTS = {
  kiwi: { name: "Kiwi", avatar: "./kiwi.png", color: "var(--kiwi)" },
  dodo: { name: "DODO", avatar: "./dodo.png", color: "var(--dodo)" },
};
const icon = (id, size = 13, extra = "") =>
  `<svg width="${size}" height="${size}" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="${extra}"><use href="#i-${id}"/></svg>`;

const thread = document.getElementById("thread");
let bot = BOTS.kiwi;
let timers = [];

function add(html, cls = "") {
  const el = document.createElement("div");
  el.className = `row ${cls}`;
  el.innerHTML = html;
  thread.appendChild(el);
  thread.scrollTop = thread.scrollHeight;
  return el;
}
const user = (text) => { const el = document.createElement("div"); el.className = "user"; el.style.background = bot.color; el.textContent = text; thread.appendChild(el); };
const say = (paras, gap = false) => add(`<div class="bubble">${paras.map((p) => `<p>${p}</p>`).join("")}</div>`, gap ? "gap" : "");
const activity = (iconId, parts) => add(`<div class="activity">${icon(iconId)}<span>${parts.join(' <span class="sep">·</span> ')}</span><span class="more">${icon("chev", 12)}</span></div>`);
const settled = (html, iconHtml = icon("check", 13, "ok")) => add(`<div class="settled">${iconHtml}<span>${html}</span></div>`);
const later = (ms, fn) => timers.push(setTimeout(fn, ms));

function card({ who, iconId, title, expl, detail, field, buttons }) {
  const el = add(`<div class="card">
    <div class="who"><img src="${bot.avatar}" alt="">${who}</div>
    <div class="title">${icon(iconId, 15)}<span>${title}</span></div>
    ${expl ? `<div class="expl">${expl}</div>` : ""}
    ${detail ? `<div class="detail">${detail}</div>` : ""}
    ${field ? `<div class="field"><input placeholder="${field}" type="password" value="sk_live_••••••••••••••••"></div>` : ""}
    <div class="foot">${buttons.map((b, i) => `<button class="btn ${b.primary ? "primary" : ""}" data-i="${i}" style="${b.primary ? `background:${bot.color}` : ""}">${b.icon ? icon(b.icon, 14) : ""}${b.label}</button>`).join("")}</div>
  </div>`, "fade-in");
  el.querySelectorAll("button").forEach((btn) => btn.addEventListener("click", () => buttons[+btn.dataset.i].onClick(el)));
  return el;
}
function replace(el, html) { el.outerHTML = html; }
function settleInto(el, html, iconHtml = icon("check", 13, "ok")) {
  const s = document.createElement("div");
  s.className = "row";
  s.innerHTML = `<div class="settled fade-in">${iconHtml}<span>${html}</span></div>`;
  el.replaceWith(s);
  return s;
}

function signInCard() {
  return card({
    who: "Kiwi needs you to sign in",
    iconId: "login",
    title: "Sign in to Linear",
    expl: "Kiwi added Linear's MCP server (mcp.linear.app). Linear's login opens in your browser. Kiwi carries on by itself when you're done.",
    buttons: [
      { label: "Not now", icon: "x", onClick: (el) => { settleInto(el, `<span class="s">Linear</span> · Not signed in. Kiwi was told.`, icon("x", 13)); later(500, () => say(["No problem. I'll leave the Linear server switched on but signed out. Say the word when you want to sign in, or I can remove it."])); } },
      { label: "Sign in to Linear", icon: "ext", primary: true, onClick: (el) => {
        const waiting = settleInto(el, `<span class="s">Linear's login is open in your browser</span> · Waiting for you to finish`, icon("load", 13, "spin"));
        later(2200, () => {
          settleInto(waiting, `<span class="s">Signed in to Linear</span> · Kiwi carried on`);
          later(600, () => activity("plug", ["Tested <b>linear</b>", "23 tools"]));
          later(1200, () => say(["Connected. Linear gave me 23 tools, so I filed today's three Discord bug reports:", "MOCA-301 Composer loses draft on reload<br>MOCA-302 Voice note stuck at 0:00 on Android<br>MOCA-303 Routine calendar shows UTC times"]));
        });
      } },
    ],
  });
}

const SCENES = {
  today: {
    bot: "dodo",
    caption: "What happens now. The bot can only save a new server switched off, then sends you to Settings.",
    run() {
      user("The Dodo MCP server is still on test mode. Swap it for the live one with my new key.");
      say(["I don't have a tool to delete an existing MCP server — I can only add a new one, and I can't modify or replace one that already exists (that's a hard restriction on my side)."], true);
      say(["I saved a new server, <code>dodo-live</code>, switched off. To finish: open Settings → MCP servers, turn on dodo-live, paste your live key there, and remove the old <code>dodo</code> server yourself."]);
    },
  },
  signin: {
    bot: "kiwi",
    caption: "Full access bot. It adds, turns on and tests the server by itself. You only tap Sign in. Try the buttons.",
    run() {
      user("File today's Discord bug reports in Linear.");
      later(300, () => say(["I can't reach Linear yet. Linear has an official MCP server, so I'll add it and test it."], true));
      later(900, () => activity("plug", ["Added MCP server <b>linear</b>", "Turned on", "Test: needs sign-in"]));
      later(1500, () => signInCard());
    },
  },
  ask: {
    bot: "kiwi",
    caption: "Same bot on Ask, Edits or Auto. Turning a server on (and editing or removing one) waits for one tap.",
    run() {
      user("File today's Discord bug reports in Linear.");
      later(300, () => say(["I can't reach Linear yet. Linear has an official MCP server. I've added it, and turning it on needs your OK."], true));
      later(900, () => activity("plug", ["Added MCP server <b>linear</b>", "Switched off"]));
      later(1500, () => card({
        who: "Kiwi asks to turn on an MCP server",
        iconId: "power",
        title: "Turn on Linear?",
        expl: "Reached over the internet. Once on, all your bots can use its tools.",
        detail: `<span class="k">url</span> https://mcp.linear.app/mcp`,
        buttons: [
          { label: "Not now", icon: "x", onClick: (el) => { settleInto(el, `<span class="s">Linear</span> · Left off`, icon("x", 13)); } },
          { label: "Turn on", icon: "power", primary: true, onClick: (el) => {
            settleInto(el, `<span class="s">Turned on Linear</span> · Kiwi carried on`);
            later(600, () => activity("plug", ["Tested <b>linear</b>", "Needs sign-in"]));
            later(1200, () => signInCard());
          } },
        ],
      }));
    },
  },
  fix: {
    bot: "dodo",
    caption: "Same request as Today. The bot edits the existing server, asks for the key on the existing secure card, tests it and cleans up.",
    run() {
      user("The Dodo MCP server is still on test mode. Swap it for the live one with my new key.");
      later(300, () => say(["I'll switch the <code>dodo</code> server to live mode. I need your live API key for that."], true));
      later(900, () => card({
        who: "DODO needs a secret",
        iconId: "key",
        title: "Dodo Payments live API key",
        expl: "For the dodo MCP server. OpenMausBot puts it in the server's settings. DODO never sees it.",
        field: "Paste the key",
        buttons: [
          { label: "Decline", icon: "x", onClick: (el) => settleInto(el, `<span class="s">Dodo Payments live API key</span> · Declined`, icon("x", 13)) },
          { label: "Save", icon: "check", primary: true, onClick: (el) => {
            settleInto(el, `<span class="s">Saved Dodo Payments live API key</span> · DODO carried on`);
            later(600, () => activity("pencil", ["Changed MCP server <b>dodo</b>", "Live mode, new key", "Test: 14 tools"]));
            later(1200, () => activity("trash", ["Removed MCP server <b>dodo-test</b>", "No other bot used it"]));
            later(1800, () => say(["Done. The <code>dodo</code> server now runs in live mode with your new key, and the test passed with 14 tools.", "I also removed <code>dodo-test</code>, the extra copy I added last week. No other bot used it."]));
          } },
        ],
      }));
    },
  },
};

function show(name) {
  timers.forEach(clearTimeout); timers = [];
  const scene = SCENES[name];
  bot = BOTS[scene.bot];
  document.getElementById("headAvatar").src = bot.avatar;
  document.getElementById("headName").textContent = bot.name;
  document.getElementById("placeholder").textContent = `Message ${bot.name}`;
  document.getElementById("mic").style.background = bot.color;
  document.getElementById("caption").textContent = scene.caption;
  document.querySelectorAll(".tabs button").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.tab === name)));
  thread.innerHTML = `<div class="divider">Today 11:40</div>`;
  scene.run();
  try { history.replaceState(null, "", `#${name}`); } catch {}
}
document.querySelectorAll(".tabs button").forEach((b) => b.addEventListener("click", () => show(b.dataset.tab)));
show(SCENES[location.hash.slice(1)] ? location.hash.slice(1) : "signin");
</script>
</body>
</html>