Repository navigation
Accounts: each account's MCP servers, connectors and plugins (--mcp) - #51
Merged
Merged
Conversation
Every account has its own configuration directory, so its MCP servers,
claude.ai / ChatGPT connectors and plugins can differ from the machine's
own login and need authenticating separately. `--mcp` asks each usable
account's CLI with the account's environment:
- Claude Code: the control protocol's `mcp_status` (connectors and
plugin servers included, asked again until nothing is pending), plus
`claude plugin list --json`; falls back to `claude mcp list`.
- Codex: `codex mcp list --json` merged with app-server's
`mcpServerStatus/list` (connection state, tool counts, errors), plus
`codex plugin list`.
Only URLs and command lines are kept, never headers or env values.
Surfaces: `accounts show <name> --mcp`, `accounts --mcp` (7/9 column),
`accounts check --mcp`, `GET /accounts?mcp=1`, MCP `list_accounts
{mcp: true}`, and `account <name> mcp <server>` rows in deep health.
Attention codes mcp_needs_auth, mcp_failed and mcp_missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #50. Each named account has its own
CLAUDE_CONFIG_DIR/CODEX_HOME, so its MCP servers, claude.ai / ChatGPT connectors and plugins can differ from the machine's own login, and each needs authenticating separately.skillhook healthonly probed the default login.What it does
--mcpasks each usable login/token account's own CLI, withwithAccountEnv, which servers its runs get and whether each connects:mcp_statusrequest (claude -p --input-format stream-json, hooks off, no session saved, without--strict-mcp-config/ENABLE_CLAUDEAI_MCP_SERVERS=false, so connectors and plugin servers are included). It asks again every 500 ms until no server ispending, waiting at least 3 s so the background connector fetch lands. Plusclaude plugin list --json. A CLI withoutmcp_statusfalls back toclaude mcp list.codex mcp list --json(configured/enabled) merged withcodex app-server'smcpServerStatus/list, which connects and reports tool counts and errors; OAuth "authorization required" →needs_auth. Servers not in the config are plugins' orcodex_apps(ChatGPT apps,source: connector). Pluscodex plugin list.I picked the control protocol over
claude mcp listbecause it's one process, reports connectors (scope: claudeai) thatmcp listomits, and gives structurederror/error_codeand tool counts.Surfaces
AccountView.mcp = {servers: [{name, target, transport?, state: connected|needs_auth|failed|disabled|unknown, detail?, source?, plugin?, tools?}], plugins?, via?, error?, checked_at}, only when asked; each probe is bounded byhealth.probe_timeout_seconds.skillhook accounts show <name> --mcp(server table + plugins),accounts --mcp(anmcpcolumn, e.g.8/19 (3 need auth, 8 failed)),accounts check --mcp,GET /accounts?mcp=1, MCPlist_accounts {mcp: true}.mcp_needs_auth(warn; fixskillhook accounts exec <name> -- claudethen/mcp, or… -- codex mcp login <server>),mcp_failed(warn;… mcp get <server>, orskillhook secret set VARwhen the CLI says an environment variable is missing),mcp_missing(info; servers the machine's own login has and the account lacks, connectors excluded; that login is probed once per runner).skillhook healthdeep mode:account <name> mcp <server>rows in thetoolsgroup (accounts using the machine's own directory are already covered by theclaude mcp/codex mcprows).mcp_status(first answer stillpending, header/env secrets planted,no-mcp-statusfor the fallback); fake-codex answersmcpServerStatus/listandplugin list.docs/accounts.md, plusdocs/api.md,docs/mcp.md,docs/operations.md, README, llms.txt, CHANGELOG.No new outbound requests from skillhook itself. Only the account's own CLI is spawned, with argv only.
Verified
pnpm run checkis green (418 tests).~/.claude/~/.codex, in a scratch skillhook home:accounts show cdx --mcptook 9.9 s for 19 active servers: 3 need auth, 8 fail on a variable the job environment lacks, 8 connected, 6 disabled.probeClaudeMcpagainst the real CLI took 3.5 s for 10 servers, correct states and tool counts, no header values kept.accounts show mine --mcppath for Claude said "not probed: login expired", because~/.claude's own keychain login is expired on this machine (the desktop app authenticates its own way).🤖 Generated with Claude Code