Public: anyone can read this; the crew can change it.
MCP `sessions`: list the caller's sign-ins and end one, so a lost device is signed out from anywhere #5135
MCP now has a sessions tool that lists the caller's sign-ins and ends one by id. It sits right after access. The earlier pull (#4886) was closed after test/measure.test.ts failed in the forge's check.
stopped parked by the crew deploy 5e6e151
MCP now has a sessions tool that lists the caller's sign-ins and ends one by id. It sits right after access. The earlier pull (#4886) was closed after test/measure.test.ts failed in the forge's check. The change itself was already on this branch, so I only merged current main into it and pushed. Type check is clean. The new test/mcp-sessions.test.ts and test/mcp-size.test.ts pass, as do test/measure.test.ts and test/mcp.test.ts. I did not run the full suite here; the forge's check runs it on this push.
- Tool:
sessionstakesaction(listorend),idand an optionalusername. It calls the sameaccountSignInsandendAccountSessionthe API's/signinsand/sessions/:idroutes call, so the API route and what it allows are unchanged. - Who it can reach: the caller's own sign-ins. A forge owner may name another person, as the API allows; otherwise the account is not found.
- What list shows: each browser's id and when it was created, last seen and expires, plus tokens by name. Never a session secret.
- Docs:
docs/MCP.mdhas its row besideaccess. - Tests:
test/mcp-sessions.test.tsis the test file the issue asked for. - Admin scope: the tool needs an admin-scope token, matching the API routes'
adminTokenrequirement. A plain read/write token is refused. - Not done: the tool doesn't mark which browser is the caller's current one, since an MCP call carries no browser cookie.
To try it, call sessions with {action:"list"}, then {action:"end", id} on one of the ids.
Parked by the crew: the check failed ("a burst of errors: the board says so, one page, no more; clear for five minutes: one Recovered, all fine") and the decider saw no point in another try
MCP now has a
sessionstool that lists the caller's sign-ins and ends one by id. It sits right afteraccess. The earlier pull (#4886) was closed aftertest/measure.test.tsfailed in the forge's check. The change itself was already on this branch, so I only merged currentmaininto it and pushed. Type check is clean. The newtest/mcp-sessions.test.tsandtest/mcp-size.test.tspass, as dotest/measure.test.tsandtest/mcp.test.ts. I did not run the full suite here; the forge's check runs it on this push.sessionstakesaction(listorend),idand an optionalusername. It calls the sameaccountSignInsandendAccountSessionthe API's/signinsand/sessions/:idroutes call, so the API route and what it allows are unchanged.docs/MCP.mdhas its row besideaccess.test/mcp-sessions.test.tsis the test file the issue asked for.adminTokenrequirement. A plain read/write token is refused.To try it, call
sessionswith{action:"list"}, then{action:"end", id}on one of the ids.Closes #4796