ezremoteDocs

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

CredentialHow you get itWorks withRenewal
OAuthSign in when your MCP client adds https://tunnel.masti.lol/mcpMCPThe client refreshes it until someone revokes it.
Agent tokenAgents, then Connect agent, in the dashboardMCP header or RESTPOST /api/agent-tokens/renew while its access is lasting
Temporary secretA temporary connectionMCP header or RESTOnly 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/register with token_endpoint_auth_method: "none".
  • S256 PKCE, exact registered redirects, and resource=https://tunnel.masti.lol/mcp on 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_jwt are 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_grant with reconnect_required means 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.

CallEndpoint
List computersGET /api/devices
Run an operationPOST /api/invoke
Recent activityGET /api/operations
Resolve an unknown outcomePOST /api/operations/resolve
Queue workPOST /api/jobs, then /api/jobs/wait, /status or /cancel
Rotate the tokenPOST /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.