Credentials and REST
For agents and developers choosing how an agent signs in, and for clients that call REST instead of MCP. Per-app setup is in apps, lifetimes in limits.
Which credential
| Credential | How you get it | Works with | Renewal |
|---|---|---|---|
| OAuth | Sign in when your MCP client adds https://tunnel.masti.lol/mcp | MCP | The client refreshes it until someone revokes it. |
| Agent token | Agents, then Connect agent, in the dashboard | MCP header or REST | POST /api/agent-tokens/renew while its access is lasting |
| Temporary secret | A temporary connection | MCP header or REST | Only after the person saves the connection |
A credential identifies one agent, can be limited to one computer, and can never approve a computer. Permissions come from the connection. Revoke credentials under Agents in the dashboard. Renewal replaces the token at once (steps); OAuth credentials get 403 use_oauth_refresh there instead.
To use an agent token over MCP, save this in the client's private settings. Field names differ between clients.
{
"mcpServers": {
"ezremote": {
"url": "https://tunnel.masti.lol/mcp",
"headers": { "Authorization": "Bearer <AGENT_TOKEN>" }
}
}
}
OAuth details for client developers
- Public clients only: an HTTPS client ID metadata document, or dynamic registration at
https://tunnel.masti.lol/oauth/registerwithtoken_endpoint_auth_method: "none". S256PKCE, exact registered redirects, andresource=https://tunnel.masti.lol/mcpon authorization, token exchange and refresh.- Redirects must be public HTTPS or loopback HTTP. Custom schemes, implicit and device-code grants, client secrets and
private_key_jwtare unsupported. - A metadata document URL needs a public hostname and a path, with no port, credentials, query, fragment or redirect.
- Refresh one call at a time and save each new refresh token before using it. Reusing a spent one revokes the whole authorization. After an uncertain refresh, sign in again.
invalid_grantwithreconnect_requiredmeans the authorization ended. It says nothing about the computer.- Errors carry a reference. Share it with the operator, never codes, tokens or full URLs.
A signed-in client can connect before any computer exists and add one with connect_computer. An agent without a browser can give the person its authorization URL, but the client must still receive the callback and exchange the code with its PKCE verifier. A remote agent needs a public HTTPS callback or a forwarded port, because a loopback callback lands on the person's machine.
REST
Send Authorization: Bearer <AGENT_TOKEN> on every call.
| Call | Endpoint |
|---|---|
| List computers | GET /api/devices |
| Run an operation | POST /api/invoke |
| Recent activity | GET /api/operations |
| Resolve an unknown outcome | POST /api/operations/resolve |
| Queue work | POST /api/jobs, then /api/jobs/wait, /status or /cancel |
| Rotate the token | POST /api/agent-tokens/renew |
{
"deviceId": "<DEVICE_UUID>",
"operation": "files.read",
"args": { "path": "~/notes.txt" },
"requestId": "<FRESH_UUID>"
}
Operations follow the same rules as over MCP, described in use the computer.