You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mcpproxy token subcommands (create, list, show, revoke) ignore the global --data-dir flag when locating the daemon socket, so they cannot talk to a daemon running on a non-default data directory. This is the same class of bug fixed for doctor/auth/call/code/tools in #854 — token was not included in that pass.
Root cause
newTokenCLIClient() in cmd/mcpproxy/token_cmd.go loads config with a bare config.Load() and derives the socket path from whatever data dir that returns:
// cmd/mcpproxy/token_cmd.go:127funcnewTokenCLIClient() (*cliclient.Client, *config.Config, error) {
cfg, err:=config.Load() // <-- ignores global --data-dir...socketPath:=socket.DetectSocketPath(cfg.DataDir) // wrong data dir...
}
The already-fixed loaders instead thread the resolved globalConfig.DataDir through, e.g. doctor_cmd.go:
detects the default socket (~/.mcpproxy/mcpproxy.sock) instead of /tmp/mydatadir/mcpproxy.sock, and reports mcpproxy daemon is not reachable even though a daemon is running there.
Reproduction (found during v0.52.0-rc.2 QA)
Start a daemon on a scratch data dir: mcpproxy serve --config /tmp/q52/mcp_config.json --data-dir /tmp/q52
mcpproxy token create --name qa --servers "*" --permissions read --data-dir /tmp/q52 → Error: mcpproxy daemon is not reachable.
Minting the token via POST /api/v1/tokens against the same daemon works, confirming the daemon and token subsystem are fine — only the CLI socket detection is wrong.
Suggested fix
Apply the --data-dir override in newTokenCLIClient the same way the #854 loaders do — pass the resolved globalConfig.DataDir into config loading / socket.DetectSocketPath, rather than relying on config.Load()'s default. Extract or reuse the shared daemon-client construction the other five commands adopted so token can't drift again. Add a regression test alongside datadir_flag_test.go covering the token loaders.
Scope / severity
Low-to-medium. Default-data-dir usage (the common case) is unaffected; this only bites when --data-dir is passed (custom/isolated instances, CI, multi-instance setups). Not a v0.52.0-rc.2 regression — pre-existing since token was added.
Summary
The
mcpproxy tokensubcommands (create,list,show,revoke) ignore the global--data-dirflag when locating the daemon socket, so they cannot talk to a daemon running on a non-default data directory. This is the same class of bug fixed fordoctor/auth/call/code/toolsin #854 —tokenwas not included in that pass.Root cause
newTokenCLIClient()incmd/mcpproxy/token_cmd.goloads config with a bareconfig.Load()and derives the socket path from whatever data dir that returns:The already-fixed loaders instead thread the resolved
globalConfig.DataDirthrough, e.g.doctor_cmd.go:Because
newTokenCLIClientnever applies the--data-diroverride, a command like:detects the default socket (
~/.mcpproxy/mcpproxy.sock) instead of/tmp/mydatadir/mcpproxy.sock, and reportsmcpproxy daemon is not reachableeven though a daemon is running there.Reproduction (found during v0.52.0-rc.2 QA)
mcpproxy serve --config /tmp/q52/mcp_config.json --data-dir /tmp/q52mcpproxy upstream list --data-dir /tmp/q52→ works (this loader honors--data-dir, fix(cli): honor global --data-dir flag in doctor, auth, call, code, and tools config loaders #854).mcpproxy token create --name qa --servers "*" --permissions read --data-dir /tmp/q52→Error: mcpproxy daemon is not reachable.Minting the token via
POST /api/v1/tokensagainst the same daemon works, confirming the daemon and token subsystem are fine — only the CLI socket detection is wrong.Suggested fix
Apply the
--data-diroverride innewTokenCLIClientthe same way the #854 loaders do — pass the resolvedglobalConfig.DataDirintoconfigloading /socket.DetectSocketPath, rather than relying onconfig.Load()'s default. Extract or reuse the shared daemon-client construction the other five commands adopted sotokencan't drift again. Add a regression test alongsidedatadir_flag_test.gocovering the token loaders.Scope / severity
Low-to-medium. Default-data-dir usage (the common case) is unaffected; this only bites when
--data-diris passed (custom/isolated instances, CI, multi-instance setups). Not a v0.52.0-rc.2 regression — pre-existing sincetokenwas added.