u-chan-secrets
v5.2.0U-Chan Secrets: local MCP server for Bitwarden-backed logins
A local MCP server that signs into approved websites with Bitwarden credentials. A privileged service performs credential entry in an isolated browser and transfers filtered session state into a dedicated Chrome or Edge profile. The service owns the allowlist, settings, audit log, runtime, dependencies, Bitwarden executable, and isolated Chromium bundle. The thin client holds no vault credentials. Windows prompts require SYSTEM identity and a separate input desktop; replies cross sessions through a SYSTEM-only named pipe. macOS uses secure password entry and permits hardcore mode only.
Summary extracted from the README.
U-Chan Secrets
A local MCP server that signs into approved websites with Bitwarden credentials. A privileged service performs credential entry in an isolated browser and transfers filtered session state into a dedicated Chrome or Edge profile.
Verification: Windows/macOS build and test CI is separate from installed-service security verification. Native process identity, input isolation, permissions, and installation rehearsals remain release gates. See V5 validation evidence and SECURITY.md.
Contents: Install · Upgrade · Daily commands · MCP tools · Setup reference · Discord broker · Release history
Architecture
flowchart TD
AI["Claude Code / other MCP client"] --> MCP["Thin MCP client: user account"]
MCP --> IPC["Local IPC with caller identity checks"]
IPC --> SERVICE["Privileged service: SYSTEM / root"]
SERVICE --> VAULT["Bitwarden CLI and private vault data"]
SERVICE --> PROMPT["Service-owned native prompts"]
SERVICE --> BROWSER["Isolated service-owned Chromium"]
BROWSER -->|"Filtered cookies and localStorage"| CHROME["Dedicated user Chrome"]
AI --> PW["Playwright MCP"]
PW -->|"Shared CDP endpoint"| CHROME
The service owns the allowlist, settings, audit log, runtime, dependencies, Bitwarden executable, and isolated Chromium bundle. The thin client holds no vault credentials. Windows prompts require SYSTEM identity and a separate input desktop; replies cross sessions through a SYSTEM-only named pipe. macOS uses secure password entry and permits hardcore mode only.
A Bitwarden session is held in service memory and passed to privileged Bitwarden subprocesses when needed. It is not stored in desktop configuration or a session file. Vault access expires after the configured idle interval (12 hours by default), manual lock, restart, or reboot. This does not claim cryptographic zeroization of JavaScript strings or OS memory.
After session transfer, the AI can use the signed-in website. Grant expiry and revocation stop future U-Chan logins; they do not invalidate existing Chrome sessions or prevent actions inside those sessions. Revocation waits for an earlier queued login to finish.
Prerequisites
- Windows or macOS.
- Node.js 24+.
- A native Bitwarden CLI executable:
bw.exeon Windows orbwon macOS. The Windows npm.cmdshim is unsupported. - Google Chrome or Microsoft Edge for the user-side dedicated profile.
- The matching Playwright Chromium installation for service staging.
Install from a trusted shell before granting an AI unrestricted user-account access. On Windows, use UAC Always notify or run the AI from a standard user account. Existing administrator/root compromise is outside the threat model.
Install
A fresh installation has four steps. Steps 1–2 run once from a trusted shell; steps 3–4 run from a normal user terminal.
1. Build from a reviewed checkout
Use a reviewed checkout for the desired source version. Unversioned npm installation can select a different published version; the package metadata in this repository is not proof of npm publication.
git clone https://github.com/anchuwithdeadline/u-chan-secrets.git
cd u-chan-secrets
npm ci
npm run build
npx playwright install chromium
The following setup commands use node dist/cli.js from that checkout. After a matching package is globally installed, u-chan invokes the same CLI. The globally installed MCP command is u-chan-secrets.
2. Install the privileged service
Windows
From a trusted elevated PowerShell terminal in the checkout:
node dist/cli.js install --mode hardcore
Windows also supports --mode easy; omitting the mode uses the Windows installer default, easy. The installer generates a phrase unless one is supplied. Reinstall preserves existing owner/settings and grants rather than applying new mode/phrase arguments over them.
install runs the one-time login to the service's private Bitwarden store itself when needed (interactive terminal required) and locks it right after. Manual fallback, in the same elevated terminal using the copied native executable:
$env:BITWARDENCLI_APPDATA_DIR = Join-Path $env:ProgramData 'u-chan-secrets\bw-data'
Remove-Item Env:\BW_SESSION -ErrorAction SilentlyContinue
& (Join-Path $env:ProgramData 'u-chan-secrets\bin\bw.exe') login
Remove-Item Env:\BITWARDENCLI_APPDATA_DIR
Do not use scripts/debug-install.bat as a V3 setup or upgrade path. That legacy script invokes uninstall, which deletes service data, and exports protected settings into the checkout. Use the CLI installer above.
macOS
From the trusted checkout:
sudo "$(command -v node)" dist/cli.js install
install runs the service Bitwarden login itself when needed (interactive terminal required) and locks it right after. Manual fallback:
sudo env -u BW_SESSION \
BITWARDENCLI_APPDATA_DIR="/Library/Application Support/u-chan-secrets/bw-data" \
"/Library/Application Support/u-chan-secrets/bin/bw" login
The daemon uses /Library/Application Support/u-chan-secrets and /Library/LaunchDaemons/com.uchan.secrets.plist. macOS always uses hardcore approval; easy mode is refused.
3. Connect AI clients and the browser
Windows. From a normal, non-administrator terminal (use u-chan.cmd if PowerShell blocks npm's launcher):
u-chan setup --json
u-chan setup --apply --start-browser
The first command only inspects. The second registers u-chan-secrets and a shared-CDP playwright server for every Codex and Claude Code CLI found on PATH, saves the browser choice, and starts the dedicated browser. Pass --client codex, --client claude, or --client all to choose clients explicitly, --browser edge to use Edge instead of the default Chrome, and --replace-existing to replace recognized simple registrations. Restart the AI session when setup reports restart required: true. See the setup reference for states, backups, and exit codes.
macOS and other MCP clients. Register the absolute path to the thin client manually:
claude mcp add u-chan-secrets -- node "/absolute/path/to/u-chan-secrets/dist/index.js"
claude mcp add playwright -- npx @playwright/mcp@latest --cdp-endpoint http://127.0.0.1:9222
If a Playwright MCP registration already exists, replace it with the shared-CDP configuration and restart the AI session. A globally installed matching package can instead register claude mcp add u-chan-secrets -- u-chan-secrets. Start the dedicated browser profile with bash scripts/start-chrome.sh (macOS) or powershell -File scripts\start-chrome.ps1 (Windows, manual setup).
4. Daily start
u-chan start
start launches the dedicated browser if needed, unlocks a locked vault through the protected prompt, and prints doctor.
Check the phrase in the genuine protected prompt before entering a password. Never send passwords, TOTP seeds/codes, or vault session keys to an AI conversation.
From a source checkout, use node dist/cli.js in place of u-chan.
Upgrade
Pick the path for the version you have now (u-chan doctor reports both CLI and service versions):
| Installed | Path |
|---|---|
| 5.0.x → 5.1.0 | Trusted reinstall. 5.1.0 changes native helpers (protected unlock dialog, Discord review). Build the reviewed 5.1.0 checkout (step 1), rerun the service install (step 2) from an elevated terminal, then from a normal terminal run npm.cmd install --global u-chan-secrets@5.1.0, u-chan.cmd setup --apply, and u-chan unlock. |
5.1.0 or later with coordinated_update |
u-chan update --check, then u-chan update from a normal terminal. See coordinated updates. |
| 4.x / 5.0.0 → 5.0.1 | npm.cmd install --global u-chan-secrets@5.0.1, u-chan.cmd update, u-chan.cmd setup --apply, u-chan doctor. |
| 3.0.0–3.0.2 | See older versions. |
| V2 data | See backup and rollback. |
| V1 data | See older versions. |
Reinstall preserves the existing owner, settings, grants, and vault data. Every service restart except a coordinated update clears the in-memory vault unlock: enter the master password only in u-chan unlock's protected prompt. Do not uninstall as an upgrade shortcut: uninstall deletes the data.
Coordinated updates
Run u-chan update --check for a read-only plan, then u-chan update from a normal desktop terminal. The service and desktop independently verify the same signed registry artifact. Compatibility checks run before either installation changes. Windows application supports unchanged native helpers, dependency declarations, and a compatible Node runtime. macOS application is currently unsupported; planning remains available. Services without coordinated_update require a matching trusted desktop/service bootstrap; there is no legacy service-only fallback.
The command reports phases and elapsed time. It stages both components before restarting the service, waits for authenticated readiness from the target boot, then installs the desktop package with npm scripts disabled. A desktop-only change does not restart or relock the service. An unlocked vault stays unlocked across the update restart: the old service leaves its session in the admin-only transaction directory for at most two minutes, and the new boot (or a rollback to the source) reads and deletes it. A locked vault stays locked, an idle timeout still applies, and reinstall, reboot, or crash still locks. Update never prompts for a password or launches a browser. u-chan start checks for a published update and applies it when compatible; one that needs a trusted reinstall is only reported. Restart existing AI sessions when the final result requests it.
Interrupted terminal? Rerun u-chan update to observe the protected transaction and resume desktop work. A duplicate desktop invocation reports busy. A 15-minute observation timeout does not cancel an active service transaction. Unknown artifact identity, same-version local changes, and builds ahead of the published release require explicit trusted reconciliation, not an automatic downgrade. A completed npm install with a missing receipt can recover only from its matching desktop checkpoint and a fresh exact artifact verification.
Service rollback copies remain under %ProgramData%\u-chan-secrets\#0 backup\update-<transaction-id>. Failed target programs and job status remain under updates\<transaction-id>. Desktop rollback tarballs remain under %APPDATA%\u-chan-secrets\#0 backup\update-<stage-id>\before; the bounded desktop-update.json checkpoint identifies that stage. No automatic cleanup scans historical backups. Target startup failure restores the source program and verifies source readiness. recovery_required blocks credential work until trusted recovery. If automatic recovery fails, stop the service in an administrator terminal, preserve both programs, and restore the retained source using the trusted installer procedure. If desktop verification fails, rerun update; if its files are incomplete, reinstall the matching verified desktop release or its retained rollback tarball from a normal terminal using npm with --ignore-scripts, then repair managed registrations with u-chan setup --apply.
Source validation and native process fixtures do not publish the feature or upgrade an installed service. See the validation boundaries.
Backup and rollback
Use a trusted administrator reinstall for the first V3 installation; the thin client alone does not upgrade native helpers or private executables. Windows reinstall stops the service, waits for shutdown, stages a fresh private program copy, preserves the old program under protected #0 backup, and reuses service registration. Existing settings and grants remain.
Before the first grant-state mutation, the service creates a protected #0 backup/v2-before-v3 snapshot and a schema.json marker. The snapshot may contain privileged configuration and encrypted vault data: never copy it into a user-readable checkout. Incomplete backups block mutation rather than being overwritten.
Supported V3 tooling refuses V2 downgrade after migration. Historical V2 administrator tools cannot enforce a newer schema guard. A deliberate rollback requires stopping the service, inspecting/restoring the protected pre-V3 state, and acknowledging that old permanent approvals return. Do not uninstall as an upgrade shortcut: uninstall deletes the data.
Package updates verify registry signatures and integrity and retain private dependencies. Changed dependencies or native helpers require a trusted administrator reinstall. Expired/exhausted grants and already transferred website sessions are separate from vault lock and upgrade state.
Older versions
Versions 3.0.0–3.0.2 have an npm signature-verification defect and cannot reliably bootstrap their own update. Install the matching corrected package from a trusted shell, then use the administrator reinstall above. Version 3.0.3 requires SHA-512 integrity and a valid signature from its pinned npm key; unsigned repository-attestation JSON cannot replace that signature. Future signing-key rotation fails closed and requires a trusted verifier upgrade.
For V1 data, use u-chan import-v1 [path]: each entry requires protected approval. Retire user-side Bitwarden sessions and the old bw-session file through a trusted migration process; never copy them into the service as trusted authorization.
5.0.1 update notes. The signed service update restarts U-Chan and clears its in-memory vault unlock. Run u-chan unlock afterward and enter the master password only in the protected prompt. The explicit .cmd spelling bootstraps setup when npm's PowerShell launcher is blocked; afterward the short u-chan command works. Restart the AI session if setup requests it. Existing browser choice, grants, and vault data remain local; a site's success condition must be approved separately on each installation. Older versions with changed dependencies or native helpers may require the trusted administrator reinstall described above.
Daily commands
The table uses the globally installed u-chan spelling; from source use node dist/cli.js with the same arguments.
In Windows PowerShell, use u-chan.cmd if execution policy blocks npm's .ps1 shim, for example u-chan.cmd doctor --json. No machine execution-policy change is needed.
| Command | Purpose |
|---|---|
start |
Windows daily start: apply a compatible published update, dedicated browser, protected unlock if locked, doctor report |
doctor [--json] |
Read-only diagnostic report and safe next actions |
setup [--client codex|claude|all] [--browser chrome|edge] [--apply] [--replace-existing] [--start-browser] [--json] |
Windows desktop inspection and explicit Codex and/or Claude Code/browser setup; without --client, configures every client CLI found on PATH |
allow [<domain>] --login-url <https-url> [--item <name|id>] [--once|--minutes N|--permanent] [--success-url URL|--success-selector SELECTOR] |
Propose a scoped grant through protected approval |
manage |
Native status, grant pages, recent activity, lock/unlock, and revocation |
unlock |
Request the protected master-password prompt |
lock |
Forget the service's vault session and request vault lock |
mode <easy|hardcore> |
Change approval mode; lowering protection requires a protected password check |
audit [limit] |
Read recent service audit records |
import-v1 [path] |
Approve each imported entry in a protected window; imported grants are permanent |
update [--check] [--json] |
Plan or apply a coordinated compatible desktop/service update, printed as a short summary (--json prints the raw result); some changes require trusted reinstall |
install [--mode <easy|hardcore>] [--phrase <phrase>] |
Privileged install/reinstall; existing settings are preserved |
uninstall |
Privileged removal of the service and all its data |
Doctor reports pass, fail, or unknown. Exit 0 means required checks passed; 1 means a required check failed; 2 means required checks remain unknown without a failure. A locked vault is a valid state with an unlock instruction. Unobservable Playwright sharing is advisory; a known mismatch fails doctor. Diagnosis never retrieves credentials, opens an unlock prompt, or changes configuration.
Manage shows 20 grants per page. It cannot create or extend a grant. Unlock closes the management dialog before opening the protected password prompt.
MCP tools and approvals
The five AI-facing tools remain:
| Tool | Behavior |
|---|---|
status |
Vault state, approval mode, and observable Playwright sharing |
request_allow(domain, login_url, item?, selectors?, grant?, success?) |
Request protected approval of the complete entry and duration. Without item, the user picks from the vault login items matching login_url in a protected window |
login(domain) |
Check/reserve the grant, sign in privately, and transfer permitted session state |
list_allowed |
Show authorized item/hosts and permanent, timed, expired, or exhausted grant state |
revoke(domain) |
Remove a grant without another approval; waits behind an earlier login |
Use the Bitwarden item ID or name supplied by the user; do not guess a vault item. Optional selectors cover username, password, submit, and OTP fields.
Example request_allow arguments:
{
"domain": "example.com",
"login_url": "https://example.com/login",
"item": "the Bitwarden item ID supplied by the user",
"grant": { "kind": "timed", "minutes": 30 },
"success": { "url": "https://example.com/dashboard" }
}
| Grant | Meaning |
|---|---|
{ "kind": "once" } |
One attempt after vault/Chrome preflight; it is consumed once the password is requested, even if sign-in then fails. A failure before the password is requested returns the use |
{ "kind": "timed", "minutes": 30 } |
Future logins until the exact approved UTC expiry; integer range 1–1,440 minutes |
{ "kind": "permanent" } |
Permanent future logins |
| Omitted | Permanent, preserving existing callers; the protected prompt states this |
The AI proposes policy; the human authorizes it through the protected prompt. V3 clients refuse new options against a service that lacks the corresponding capability.
Changing identity, hosts, selectors, duration, or success conditions requires a new approval. A timed request that expires while its window is open is refused. Detected backward-clock changes invalidate affected persisted timed grants; renewed approval is required. Clock changes while the service is stopped cannot be reconstructed.
Easy mode exists only on Windows. Hardcore approvals require the master password. Protected prompts time out after two minutes. Five incorrect password attempts lock password-checked operations for 15 minutes.
Login results and 2FA
A success condition is one exact approved HTTPS URL or a visible-element selector, such as { "selector": "#signed-in-account" }. Choose evidence specific to the authenticated page: body or another generic element is not meaningful proof. The service checks the allowed host around evidence evaluation and transfer.
Without approved evidence, a generic completed flow may transfer filtered state but returns ok: false with authentication_unconfirmed. Inspect Chrome before continuing. An unmet configured condition prevents transfer. Other fixed result codes distinguish grant expiry/exhaustion, vault/Chrome availability, human verification, timeout, and transfer failure.
The service supports Bitwarden TOTP for recognized one-time-code fields. Passwords, TOTP seeds, and generated codes stay inside the privileged login flow. CAPTCHA, device verification, and unsupported challenges require the user; the AI must not request the underlying credentials.
Setup reference
Use a normal, non-administrator terminal after installing the matching trusted service:
u-chan setup --json
u-chan setup --apply
u-chan setup --apply --replace-existing --start-browser
The first command only inspects. --apply adds missing MCP registrations through the official Codex and Claude Code CLIs (codex mcp, claude mcp --scope user). --replace-existing also permits replacement of recognized simple registrations. Existing configuration is backed up before mutation, under ~/.codex/#0 backup (or $CODEX_HOME) and ~/.claude/#0 backup (or $CLAUDE_CONFIG_DIR). Compatible enabled registrations retain custom environment, working directory, tool filters, timeouts, and other settings. Incompatible custom registrations, conflicting target overrides, disabled entries, and HTTP transports require manual configuration and remain untouched. Partial failures retain completed changes and the backup; setup never restores an obsolete whole configuration over concurrent edits.
--start-browser explicitly starts the selected dedicated browser profile in the background when its endpoint is unhealthy. No startup task is added. Setup refuses elevated execution and known service/desktop browser-target mismatches. It never installs the privileged service or changes UAC. Run u-chan install separately from a trusted administrator terminal.
Setup reports configured or needs_attention, plus sharing and restartRequired. process_configured means matching process arguments were observed; it does not verify active AI-session ownership. Unobservable sharing remains unobserved. Restart the AI session after registration changes. Exit codes: 1 means attention required, 2 means configured with restart required, and 0 means configured without a known restart requirement. A locked vault remains a valid installed state.
Automatic registration supports Codex and Claude Code on Windows only. Configure other clients and platforms manually (see step 3). macOS runtime remains unverified. doctor compares the actual CLI and installed service versions, both browser targets, and Windows UAC policy; missing metadata remains unknown. manage shows the installed service version and browser status.
On Windows, setup --apply also makes the short u-chan command work when PowerShell blocks scripts. It moves the recognized npm-generated u-chan.ps1 launcher into the npm directory's #0 backup, leaving u-chan.cmd available for PowerShell to resolve automatically. Execution policy and PowerShell profiles are unchanged. Inspection without --apply is read-only, and custom launchers are preserved. If the first setup command is blocked, run u-chan.cmd setup --apply. Rerun setup after a manual npm installation recreates the PowerShell launcher; u-chan update does not need it. Shell results and the backup path appear in the setup JSON report.
Browser choice and session transfer
Choose your browser from a normal Windows terminal:
u-chan setup --browser edge --json
u-chan setup --browser edge --apply --replace-existing --start-browser
u-chan setup --browser chrome --apply --replace-existing --start-browser
The first command inspects the proposed choice. --apply saves it in user-side browser.json and registers the matching MCP environment through the official Codex CLI. Later commands without --browser keep the saved choice; a new installation defaults to Chrome. Browser and Codex configuration backups are retained under their respective #0 backup directories. Each user's choice is independent.
Chrome and Edge use separate dedicated profiles. Only one browser owns the configured U-Chan CDP endpoint at a time. When switching, close the previous dedicated U-Chan instance and rerun setup; keep your personal browser windows open. U-Chan refuses wrong, unknown, personal-profile, or non-loopback listeners instead of silently attaching, selecting another port/browser, or terminating processes. It does not install browsers or change enterprise debugging policy. The legacy scripts/start-chrome.ps1 explicitly selects Chrome; scripts/start-browser.ps1 -Browser edge selects Edge.
The service independently checks the installed owner's SID and dedicated profile before accessing the Windows destination. It derives that user's AppData paths from the profile registry. Advanced installations with a custom desktop profile root must align the trusted service environment's U_CHAN_DESKTOP_HOME with the user-side home; changing only a user-side environment variable does not redirect privileged session transfer.
An approved exact URL or visible selector must match in both the private login context and a new verification tab in the destination browser before login returns success. Existing user tabs are left alone. Missing evidence returns authentication_unconfirmed; private success with unverified desktop state returns destination_unconfirmed. Transfer failure/cancellation can leave partial session state and does not log the browser out. Expired or consumed grants are not refunded.
The private credential-bearing context uses a per-attempt HTTP/CONNECT proxy to block network destinations outside approved hosts, including redirect chains and worker/frame requests. Service workers are disabled. Private Chromium disables HTTP/2 and QUIC so connections cannot coalesce across approved and unapproved origins; HTTP/2-only sites may be unsupported. TLS remains end-to-end with normal browser certificate validation. Some sites requiring third-party resources or external identity providers also remain unsupported; U-Chan does not silently broaden host approval. CAPTCHA, passkey, push approval, or unavailable/rejected TOTP returns needs_human with manual sign-in guidance. V5 does not expose or resume the private challenge context, repeat credential submissions, or ask for passwords/codes in AI chat.
A V5 client requires the service's verified_session_transfer capability before login and binds the request to its selected browser. Update both CLI and service; an older service is refused before a login attempt is sent. An old client without a browser field retains its legacy Chrome destination. A stale MCP browser environment that conflicts with the saved choice is refused until the AI session restarts. Existing grants and vault data remain compatible. Native macOS runtime and ownership by an already-running AI session remain unverified.
Other MCP clients may set U_CHAN_BROWSER=edge (or chrome) and the matching loopback U_CHAN_CDP in their own registration, then launch the matching dedicated browser. Automatic registration remains Windows/Codex only; setting a desktop environment variable does not change the privileged service's endpoint.
Site grants from the CLI
Propose a site grant with an explicit success condition:
u-chan allow example.com --login-url https://example.com/login --item "Example account" --once --success-url https://example.com/dashboard
u-chan allow --login-url https://example.com/login --item "Example account" --once
u-chan allow --login-url https://example.com/login --once # pick the item in a protected window (vault must be unlocked)
u-chan allow example.com --login-url https://example.com/login --item "Example account" --minutes 30 --success-selector "button[data-action='sign-out']"
The service still requires protected approval. The CLI defaults to one login attempt; timed approvals accept 1–1440 whole minutes, and --permanent requests permanent future logins. URL and selector success conditions are mutually exclusive. Without one, login may return authentication_unconfirmed; independently verify the signed-in page. Grant expiry does not log out an already transferred browser session.
Discord broker
The Windows service can use a Bitwarden bot token to configure existing approved Discord servers, without returning the token to the agent. This source upgrade requires a trusted administrator reinstall because its protected review helper changes. It is not available merely by updating the desktop MCP package. Existing website tools remain unchanged; macOS Discord requests fail closed.
The bot must already belong to the target server and have the needed Discord permissions and role hierarchy. Approve one connection for server/role/channel metadata. Every write batch then requires a protected prompt displaying its exact changes. The connection never authorizes unattended writes.
- Keep the token in the login password or an explicitly named hidden custom field of your Bitwarden item. A username is not required for password-field token use. Never put the token in the following JSON files, chat, command arguments, or MCP configuration.
- Create
discord-connection.jsonusing the exact server ID and your item reference (prefer its UUID). Example IDs below are placeholders, not a real target:
{
"alias": "vdn",
"item": "VDN Discord Bot",
"field": { "kind": "password" },
"guildId": "123456789012345678"
}
For a custom field, replace field with { "kind": "hidden", "name": "Bot token" }. Missing, visible, or duplicate matching custom fields fail without fallback.
If the item already contains the setup information, use just { "alias": "vdn", "item": "VDN Discord Bot" }. U-Chan first requests protected permission to discover metadata, then separately requests approval of the exact server ID, resolved item UUID, and token-field selector. No token value or raw note content is returned. Discovery accepts one server ID labeled Guild ID, Server ID, Discord Guild ID, or Discord Server ID in custom fields, note lines, or a top-level JSON note object. Application/client IDs are not server IDs. A single password or hidden field named Token, Bot token, Discord token, or Discord bot token supplies the selector. Ambiguous IDs/fields fail; provide both explicit guildId and field to resolve ambiguity. Protected state always stores the complete exact connection, never an unresolved discovery request.
- After the trusted service reinstall, run from a normal terminal:
u-chan doctor
u-chan unlock
u-chan discord allow discord-connection.json
u-chan discord list
u-chan discord test vdn
u-chan discord inspect vdn
u-chan discord inspect vdn --page 1
Enter the master password only in the protected unlock prompt. Confirm the connection's item, field, and exact server ID in the protected approval. Metadata pages return one channel and one role, with nextPage and totals. Follow pages for complete results. An optional member ID inspects that member's role IDs: u-chan discord inspect vdn 223456789012345678.
u-chan discord test <alias> (PowerShell may require u-chan.cmd) checks an existing approved connection through read-only metadata inspection. Success reports status: "connected", server ID, channel count, and role count. Failures retain service guidance for locked vaults, missing approval, unavailable services, or Discord rejection. It never grants access, changes resources, returns raw metadata, or proves write permissions. Agents can use the equivalent discord_test_connection tool. This desktop-only feature works with an installed service that already supports discord_broker; no service reinstall or vault relock is needed.
- Put a requested tournament setup batch in
discord-operations.json, then review it through U-Chan:
[
{ "type": "role_create", "name": "Debater", "permissions": "1024" },
{ "type": "role_create", "name": "Adjudicator", "permissions": "1024" },
{ "type": "channel_create", "kind": "category", "name": "Tournament" }
]
u-chan discord apply vdn discord-operations.json
u-chan discord revoke vdn
New resource IDs are returned after creation. Use those IDs in a later approved batch to create child channels, assign roles, or set permissions. Each batch is limited to 10 operations and 8 KiB of canonical JSON; larger review displays must be split further. Overlapping existing targets are rejected before approval; combine fields into one edit or use separate batches. Server state is checked again after approval, so conflicting changes and indirect role-position shifts may stop execution. Revoke also works from u-chan manage using the distinctly labeled Discord target.
Supported operations and payload fields:
type |
Fields |
|---|---|
role_create |
name; optional permissions (decimal string, default "0"), color (integer), hoist, mentionable |
role_edit |
roleId, nonempty changes using the role fields above |
role_reorder |
positions: array of { "id": "...", "position": 1 } |
channel_create |
kind: category, text, or voice; name; optional parentId, topic (text only), overwrites |
channel_edit |
channelId, nonempty changes: name, parentId, topic, overwrites |
channel_reorder |
positions: array of { "id": "...", "position": 1 } |
member_role_add, member_role_remove |
memberId, roleId |
An overwrite is { "id": "...", "type": 0, "allow": "1024", "deny": "2048" }: type 0 targets a role; type 1 targets a verified server member. Supplying overwrites replaces that channel's overwrite list, which can expose private channels. The protected review displays numeric bits and known permission names; the server ID denotes @everyone. Unknown permission bits and administrator grants, including assignment of an existing administrator role, are refused. Managed roles and the bot's authority roles are protected. Discord itself also enforces permissions and hierarchy.
No deletion, messages, kicks/bans, server creation, webhook access, arbitrary HTTP, or secret-injected shell execution is exposed. A batch stops at its first failure without rollback. Results distinguish completed operations, operations not sent, and unknown write outcomes. Inspect the server before retrying an unknown outcome; U-Chan does not replay uncertain writes. Rate-limit results provide retryAfter where available.
Agents get six additional tools: discord_request_allow, discord_list_allowed, discord_test_connection, discord_inspect, discord_apply, and discord_revoke. Website login and Discord approval are separate. An old service returns an upgrade-required error. Restart the AI session after configuring the updated desktop package to discover the additional tools.
Connection metadata resides in protected discord-allowlist.json; tokens remain in Bitwarden and service memory. The service snapshots protected metadata under protected #0 backup before its first broker state mutation per process. Reinstallation preserves connections; a compatible older service leaves the separate file inert. Revocation and vault lock cannot undo completed Discord changes or recall an already dispatched request. See validation status before treating source checks as installed verification.
GitHub connector and agent unlock
5.1.0 adds agent-triggered protected unlock and a repository-scoped GitHub connector. A matching installed service and fresh AI session are required. See setup, supported actions, and boundaries and validation scope.
Release history
5.1
- Claude Code setup:
u-chan setup --client claude [--apply] [--replace-existing]checks the user-scopeu-chan-secretsandplaywrightregistrations in~/.claude.json(or$CLAUDE_CONFIG_DIR/.claude.json) and repairs a Playwright entry missing--cdp-endpoint. Inspection reads the file without changing it; changes go throughclaude mcp remove/add-json --scope userafter a backup in~/.claude/#0 backup. Custom registrations are preserved and reported for manual configuration. - Multi-client setup: without
--client,u-chan setupinspects (and with--apply, configures) every Codex and Claude Code CLI found on PATH;--client alltargets both explicitly. Each client is attempted independently, the report lists per-client results, and the overall state is the least ready one. - Daily start:
u-chan startstarts the selected dedicated browser when its endpoint is down, opens the protected unlock prompt only when the vault is locked, then prints the doctor report. It needs no administrator rights and changes no configuration. It exits 1 if a required check fails or the vault remains locked. Windows only.
V5
Version 5.0.0 adds selectable Chrome/Edge desktop destinations and checks approved login evidence before and after session transfer. Chrome remains the default when no browser has been selected. Protocol and protected-state schema remain version 3. Source integration, publication, and installed verification are separate events.
V4
The Windows V4 rollout records matching service/CLI versions, preserved protected state, real setup and fresh MCP/browser checks. It builds on the tightened V3.0.3 native closeout. macOS runtime remains unverified; source merge, installed verification, and package publication are recorded separately.
V3
- Diagnose:
u-chan doctorexplains service, vault, permission, Chrome, and browser-sharing problems without fetching credentials or repairing configuration. - Limit approval: approve one login attempt, a fixed duration, or permanent future logins.
- Confirm outcomes: an approved URL or selector provides authentication evidence; generic form completion remains explicitly unconfirmed.
- Manage access:
u-chan manageshows grant pages and recent sanitized activity, with lock, unlock, and revoke actions. - Preserve state: privileged migration backup, schema/downgrade guards, and state-preserving reinstall replace manual editing of protected files.
Windows Hello and Touch ID remain research only. Linux, general SSO/OAuth, passkeys, and automated CAPTCHA solving are outside V3.
See CHANGELOG.md for full notes.
Validation and security
npm test
npm run build
CI runs builds/tests on Windows and macOS. CodeQL checks source separately. Passing these checks does not prove actual SYSTEM/root prompt isolation or certify an installed service.
Before release or reliance on the security boundary, perform the manual attack checklist. See validation and remaining native checks, security policy, and V3 change notes.
Releasing
Push a vX.Y.Z tag matching package.json to run the release workflow: it reruns the Windows/macOS tests, then publishes to npm with provenance. Configure npm trusted publishing for this repository and workflow on npmjs.com, or add an automation token as the NPM_TOKEN secret of the npm environment. A version already on npm is skipped, so rerunning a tag is safe.