Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["8088"],{97799(e,r,n){n.r(r),n.d(r,{metadata:()=>t,default:()=>h,frontMatter:()=>d,contentTitle:()=>c,toc:()=>i,assets:()=>l});var t=JSON.parse('{"id":"cloud/mercury-cloud","title":"Mercury Cloud","description":"Hosted backend for Mercury Agent \u2014 terminal pairing, auto-rotating JWTs, Cloud WebSocket, shared memory pool, and remote dashboard. Plug-and-play setup with no port forwarding.","source":"@site/docs/cloud/mercury-cloud.mdx","sourceDirName":"cloud","slug":"/cloud/mercury-cloud","permalink":"/docs/cloud/mercury-cloud","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/cloud/mercury-cloud.mdx","tags":[],"version":"current","frontMatter":{"title":"Mercury Cloud","sidebar_label":"Mercury Cloud","description":"Hosted backend for Mercury Agent \u2014 terminal pairing, auto-rotating JWTs, Cloud WebSocket, shared memory pool, and remote dashboard. Plug-and-play setup with no port forwarding."},"sidebar":"docsSidebar","previous":{"title":"v1.1.6","permalink":"/docs/releases/1.1.6"}}'),s=n(74848),o=n(28453);let d={title:"Mercury Cloud",sidebar_label:"Mercury Cloud",description:"Hosted backend for Mercury Agent \u2014 terminal pairing, auto-rotating JWTs, Cloud WebSocket, shared memory pool, and remote dashboard. Plug-and-play setup with no port forwarding."},c="Mercury Cloud",l={},i=[{value:"Quick start",id:"quick-start",level:2},{value:"How it works",id:"how-it-works",level:2},{value:"Authentication & self-recovery",id:"authentication--self-recovery",level:2},{value:"Shared memory pool",id:"shared-memory-pool",level:2},{value:"Remote dashboard",id:"remote-dashboard",level:2},{value:"Models",id:"models",level:2},{value:"CLI commands",id:"cli-commands",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Disconnect",id:"disconnect",level:2}];function a(e){let r={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.header,{children:(0,s.jsx)(r.h1,{id:"mercury-cloud",children:"Mercury Cloud"})}),"\n",(0,s.jsx)(r.p,{children:"Mercury Cloud is a hosted backend that turns a local Mercury install into a remotely managed, always-on agent. Pair once from the terminal, and Mercury maintains a persistent WebSocket to the cloud \u2014 no port forwarding, no reverse proxy, no certificate management."}),"\n",(0,s.jsx)(r.h2,{id:"quick-start",children:"Quick start"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-sh",children:"mercury cloud connect\n"})}),"\n",(0,s.jsx)(r.p,{children:"This opens a browser-based pairing URL. Once paired, Mercury saves your credentials and starts a background daemon that keeps the Cloud WebSocket alive even after you exit the terminal."}),"\n",(0,s.jsx)(r.h2,{id:"how-it-works",children:"How it works"}),"\n",(0,s.jsxs)(r.ol,{children:["\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Pair"})," \u2014 ",(0,s.jsx)(r.code,{children:"mercury cloud connect"})," opens a browser URL. Poll-based completion with structured failure codes (e.g. agent capacity reached)."]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Authenticate"})," \u2014 Mercury receives a JWT (short-lived), a refresh token (single-use), and an agent API key (long-lived)."]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Connect"})," \u2014 A background daemon maintains a persistent WSS connection to ",(0,s.jsx)(r.code,{children:"wss://backend.mercuryagent.sh/ws"})," with 30-second heartbeats and automatic reconnect."]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Stay online"})," \u2014 The daemon keeps the WebSocket alive even after you close the terminal. The agent API key enables headless self-recovery without browser re-pairing."]}),"\n"]}),"\n",(0,s.jsx)(r.h2,{id:"authentication--self-recovery",children:"Authentication & self-recovery"}),"\n",(0,s.jsx)(r.p,{children:"Mercury Cloud uses a three-tier token strategy:"}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Token"}),(0,s.jsx)(r.th,{children:"Lifetime"}),(0,s.jsx)(r.th,{children:"Purpose"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"JWT"})}),(0,s.jsx)(r.td,{children:"Short-lived"}),(0,s.jsx)(r.td,{children:"API and WebSocket auth. Auto-refreshed before expiry."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Refresh token"})}),(0,s.jsx)(r.td,{children:"Single-use"}),(0,s.jsx)(r.td,{children:"Rotated on every refresh. Used to get a new JWT."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Agent API key"})}),(0,s.jsx)(r.td,{children:"Long-lived"}),(0,s.jsx)(r.td,{children:"Headless self-recovery. Never expires."})]})]})]}),"\n",(0,s.jsx)(r.p,{children:"If the JWT expires, Mercury tries the refresh token. If the refresh token is also dead, Mercury redeems the agent API key to get fresh tokens \u2014 no browser re-pairing needed. This means a server or Termux deployment stays online indefinitely."}),"\n",(0,s.jsx)(r.h2,{id:"shared-memory-pool",children:"Shared memory pool"}),"\n",(0,s.jsxs)(r.p,{children:["Mercury Cloud agents can search a ",(0,s.jsx)(r.strong,{children:"shared memory pool"})," \u2014 cross-agent context that lives in the cloud. After local Second Brain retrieval, the agent calls ",(0,s.jsx)(r.code,{children:"searchPool()"})," to fetch additional context from other agents in your fleet. Results are cached locally for 5 minutes per query."]}),"\n",(0,s.jsx)(r.h2,{id:"remote-dashboard",children:"Remote dashboard"}),"\n",(0,s.jsxs)(r.p,{children:["Manage your agent from ",(0,s.jsx)(r.a,{href:"https://cloud.mercuryagent.sh",children:"cloud.mercuryagent.sh"})," \u2014 send messages, install skills, view memory, and monitor status. The dashboard communicates with your local agent over the Cloud WebSocket."]}),"\n",(0,s.jsx)(r.h2,{id:"models",children:"Models"}),"\n",(0,s.jsx)(r.p,{children:"Mercury Cloud offers multiple models. At pairing time, Mercury fetches the available models and prompts you to choose:"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{children:"Available models:\n 1. Mercury Flash (mercury-flash)\n 2. Mercury Pro (mercury-pro)\n ...\nChoose a model [1-N, Enter for 1]:\n"})}),"\n",(0,s.jsxs)(r.p,{children:["Switch models later with ",(0,s.jsx)(r.code,{children:"/cloud use <model-id>"})," or ",(0,s.jsx)(r.code,{children:"mercury doctor"}),"."]}),"\n",(0,s.jsx)(r.h2,{id:"cli-commands",children:"CLI commands"}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Command"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.code,{children:"mercury cloud connect"})}),(0,s.jsx)(r.td,{children:"Pair with Mercury Cloud via browser"})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.code,{children:"mercury cloud disconnect"})}),(0,s.jsx)(r.td,{children:"Clear Cloud credentials and stop the agent"})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.code,{children:"mercury cloud status"})}),(0,s.jsx)(r.td,{children:"Show Cloud connection status and usage"})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.code,{children:"mercury cloud login"})}),(0,s.jsx)(r.td,{children:"Refresh the JWT using the stored refresh token"})]})]})]}),"\n",(0,s.jsx)(r.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(r.p,{children:["Mercury Cloud config is stored in ",(0,s.jsx)(r.code,{children:"mercury.yaml"})," under the ",(0,s.jsx)(r.code,{children:"cloud"})," section:"]}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-yaml",children:"cloud:\n enabled: true\n apiUrl: https://backend.mercuryagent.sh\n wsUrl: wss://backend.mercuryagent.sh/ws\n agentId: your-agent-id\n tier: free\n"})}),"\n",(0,s.jsx)(r.p,{children:"The JWT, refresh token, and agent API key are also stored here (they auto-rotate). You don't need to manage them manually."}),"\n",(0,s.jsx)(r.h2,{id:"disconnect",children:"Disconnect"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-sh",children:"mercury cloud disconnect\n"})}),"\n",(0,s.jsx)(r.p,{children:"This stops the running agent, clears all Cloud credentials, switches the default provider back to your offline provider, and restarts Mercury in offline mode. The agent remains registered on the cloud dashboard \u2014 delete it there to revoke server-side credentials."})]})}function h(e={}){let{wrapper:r}={...(0,o.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},28453(e,r,n){n.d(r,{R:()=>d,x:()=>c});var t=n(96540);let s={},o=t.createContext(s);function d(e){let r=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function c(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),t.createElement(o.Provider,{value:r},e.children)}}}]);