run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
37 lines • 1.35 kB
JavaScript
/**
* `me` — the caller's own account reads (`/agent/v1/me/*`). Accepts a sign-in
* session (any grade: these are reads) or a SIWX wallet, which reads that
* wallet's slice. Reached as `r.me.*`. `run402 orgs list` renders
* {@link Me.overview}; `run402 doctor` and MCP `whoami` read {@link Me.status}.
* The project inventory (`GET /agent/v1/me/projects`) is
* `r.projects.list({ all: true })`.
*/
import { gateSecret } from "../secret-gate.js";
function authFor(opts) {
return opts.token
? { headers: { Authorization: `Bearer ${opts.token}` }, withAuth: false }
: {};
}
export class Me {
client;
constructor(client) {
this.client = client;
}
/** The account overview across every organization the caller is a member of. */
async overview(opts = {}) {
gateSecret(this.client, "me.overview", opts);
return this.client.request("/agent/v1/me/overview", {
...authFor(opts),
context: "fetching account overview",
});
}
/** The owner snapshot `run402 doctor` reads. */
async status(opts = {}) {
gateSecret(this.client, "me.status", opts);
return this.client.request("/agent/v1/me/status", {
...authFor(opts),
context: "fetching account status",
});
}
}
//# sourceMappingURL=me.js.map