import { useState, type FormEvent } from "react"; import { api, ApiError, type Project } from "../api"; import { useFetch, fmtDate } from "../hooks"; import { Badge, Confirm, CopyBox, Empty, ErrorBox, KV, Loading, Td } from "../components/ui"; import { useMe } from "../App"; type Token = { id: string; name: string; prefix: string; scopes: string[]; project_id: string | null; project_slug: string | null; created_at: string; last_used_at: string | null; revoked_at: string | null }; type User = { id: string; email: string; role: string; disabled: boolean; created_at: string; last_login_at: string | null }; const SCOPES = ["read", "execute", "discover", "export", "mcp", "admin"]; export default function Settings() { const { me } = useMe(); const tokens = useFetch<{ tokens: Token[] }>("auth/tokens"); const projects = useFetch<{ projects: Project[] }>("projects"); const users = useFetch<{ users: User[] }>(me?.role === "admin" ? "auth/users" : null); const settings = useFetch<{ settings: { key: string; value: unknown }[]; env: Record }>("settings"); const [tf, setTf] = useState({ name: "", scopes: ["read", "execute", "discover", "mcp"], project_id: "" }); const [minted, setMinted] = useState(null); const [pw, setPw] = useState({ current_password: "", new_password: "" }); const [pwOk, setPwOk] = useState(false); const [uf, setUf] = useState({ email: "", password: "", role: "operator" }); const [err, setErr] = useState(null); const publicUrl = (settings.data?.env?.public_url as string) ?? window.location.origin; const mint = async (e: FormEvent) => { e.preventDefault(); setErr(null); try { const r = await api<{ token: string }>("auth/tokens", { body: { name: tf.name, scopes: tf.scopes, project_id: tf.project_id || null } }); setMinted(r.token); setTf({ ...tf, name: "" }); tokens.reload(); } catch (ex) { setErr(ex as ApiError); } }; const changePw = async (e: FormEvent) => { e.preventDefault(); setErr(null); setPwOk(false); try { await api("auth/password", { body: pw }); setPw({ current_password: "", new_password: "" }); setPwOk(true); } catch (ex) { setErr(ex as ApiError); } }; const createUser = async (e: FormEvent) => { e.preventDefault(); setErr(null); try { await api("auth/users", { body: uf }); setUf({ email: "", password: "", role: "operator" }); users.reload(); } catch (ex) { setErr(ex as ApiError); } }; return (

Settings

Account

], ["Session", me?.kind]]} />

Change password

setPw({ ...pw, current_password: e.target.value })} />
setPw({ ...pw, new_password: e.target.value })} />
{pwOk &&
Password changed.
}

Connect Claude Code

Mint a token with the mcp scope, then register the AKOS MCP endpoint at user scope (adds only the akos server; nothing else in your Claude settings is touched):

"}" -s user`} />

CLI: pip install -e . in the AKOS checkout then akos login --url {publicUrl}. SDK: from akos.sdk import Akos.

Runtime

{settings.data && }

API tokens

{minted &&
New token (shown once):
}
setTf({ ...tf, name: e.target.value })} />
{SCOPES.map((s) => )}
{tokens.loading && } {tokens.data && tokens.data.tokens.length === 0 && No tokens yet.} {tokens.data && tokens.data.tokens.length > 0 && {tokens.data.tokens.map((t) => )}
NamePrefixScopesProjectCreatedLast usedStatus
{t.name}{t.prefix}…{t.scopes.join(", ")}{t.project_slug ?? "all"}{fmtDate(t.created_at)}{fmtDate(t.last_used_at)}{t.revoked_at ? : }{!t.revoked_at && { try { await api(`auth/tokens/${t.id}`, { method: "DELETE" }); tokens.reload(); } catch (ex) { setErr(ex as ApiError); } }} />}
}
{me?.role === "admin" &&

Users (admin)

{users.loading && } {users.data && {users.data.users.map((u) => )}
EmailRoleStatusCreatedLast login
{u.email}{u.disabled ? : }{fmtDate(u.created_at)}{fmtDate(u.last_login_at)}
}
setUf({ ...uf, email: e.target.value })} />
setUf({ ...uf, password: e.target.value })} />
}
); }