{"record":{"id":"27e7a382763062fe","repo":"paperclipai/paperclip","slug":"add-token-your-token-to-this-url","errorCode":null,"errorMessage":"Add #token=YOUR_TOKEN to this URL","messagePattern":"Add #token=YOUR_TOKEN to this URL","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/kv-demo-mcp-server/src/render.ts","lineNumber":99,"sourceCode":"      document.getElementById(\"count\").textContent = state.count;\n      document.getElementById(\"revision\").textContent = state.revision;\n      const rows = document.getElementById(\"rows\");\n      if (!state.entries.length) {\n        rows.innerHTML = '<tr class=\"empty\"><td colspan=\"3\">No values yet — call the <code>kv_set</code> tool to add one.</td></tr>';\n        return;\n      }\n      rows.innerHTML = state.entries.map((entry) =>\n        '<tr><td class=\"key\">' + escapeHtml(entry.key) +\n        '</td><td class=\"value\">' + escapeHtml(entry.value) +\n        '</td><td class=\"updated\">' + escapeHtml(entry.updatedAt) + '</td></tr>'\n      ).join(\"\");\n    }\n    async function refresh() {\n      const status = document.getElementById(\"status\");\n      try {\n        const headers = { accept: \"application/json\" };\n        if (token) headers.authorization = \"Bearer \" + token;\n        if (TOKEN_REQUIRED && !token) throw new Error(\"Add #token=YOUR_TOKEN to this URL\");\n        const res = await fetch(\"/api/state\", { headers });\n        if (!res.ok) throw new Error(\"HTTP \" + res.status);\n        render(await res.json());\n        status.textContent = \"Auto-refreshing every 2s.\";\n      } catch (err) {\n        status.textContent = \"Refresh failed: \" + err.message;\n      }\n    }\n    setInterval(refresh, 2000);\n  </script>\n</body>\n</html>`;\n}\n","sourceCodeStart":81,"sourceCodeEnd":113,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/kv-demo-mcp-server/src/render.ts#L81-L113","documentation":"This message originates in the client-side JavaScript embedded in the HTML returned by the kv-demo render module. In refresh(), when TOKEN_REQUIRED is true and the page was loaded without a #token= fragment, the function throws before issuing the fetch. The status element then displays 'Refresh failed: Add #token=YOUR_TOKEN to this URL'.","triggerScenarios":"The operator started the kv-demo server with token auth enabled (TOKEN_REQUIRED) but the user opened the dashboard URL without appending #token=<the configured token> to the URL hash.","commonSituations":"Sharing the dashboard URL without the token fragment; token rotated server-side but the bookmark still has the old/empty hash; user clears the URL hash.","solutions":["Append #token=YOUR_TOKEN to the dashboard URL in the browser address bar and reload.","If token auth is not required, restart the server without the token / with TOKEN_REQUIRED=false.","Distribute the full URL including the #token= fragment to users."],"exampleFix":"// before\nhttps://host:8848/\n// after\nhttps://host:8848/#token=correct-token-here","handlingStrategy":"validation","validationCode":"// client-side, in the dashboard boot script\nif (TOKEN_REQUIRED && !new URL(location.href).hash.match(/^#token=.+/)) {\n  prompt('Token required: append #token=YOUR_TOKEN to the URL');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Distribute the dashboard URL with the #token= fragment included.","When rotating the token, update all shared bookmarks.","If token auth is unnecessary, disable TOKEN_REQUIRED server-side."],"tags":["auth","client-side","kv-demo-mcp","url-fragment"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}