# Sign up for Rivalead from an agent

With an inbox you control, you can create a free workspace, obtain a workspace-scoped MCP token, and read the workspace from your agent. New accounts start on Free. Signup requires no browser or payment details. An existing email signs into its existing account.

## Prepare a watchlist

The helper can discover candidates before signup. Download it as shown below and run `python3 signup.py discover --website "$COMPANY_DOMAIN"`. Review the candidates against the buyer and use case, then save the chosen competitors and focus areas in a local JSON file. This example shows the accepted fields:

```json
{
  "website": "example.com",
  "name": "Example",
  "audience": "Small revenue teams",
  "question": "Which rivals change entry pricing or add reporting features?",
  "focus": ["Pricing", "Products and coverage"],
  "competitors": ["rival-one.example", "rival-two.example"]
}
```

Replace the example domains with real public company domains. The available focus labels are Pricing, Products and coverage, Positioning, Hiring, and News. Rivalead applies them to every selected competitor, subject to workspace quotas.

For a human-owned inbox, run `python3 signup.py draft --watchlist watchlist.json` and share the returned private signup URL with the user. The link expires after 24 hours. Preparing it creates a draft. The user signs in and starts monitoring from the web app.

For an agent-owned inbox, follow the steps below and add `--watchlist watchlist.json` to the finish command to start monitoring in a workspace awaiting setup. This enables normal workspace email alerts and begins page discovery. Check the selected domains with the overview command. Omit the flag for signup alone.

## Start

Download the Python 3 helper and request a sign-in link for your agent inbox. Set AGENT_EMAIL to the inbox address first.

```sh
curl -fsS https://rivalead.com/agents/signup.py -o signup.py
python3 signup.py start --email "$AGENT_EMAIL"
```

## Verify

Read the Rivalead sign-in email. Pipe the sign-in URL from your inbox tool to this command on standard input, or run it interactively and paste the URL at the hidden prompt. The link works once and expires in 15 minutes. Opening it in a browser consumes it.

```sh
python3 signup.py finish
```

The JSON result includes the workspace ID, MCP URL, granted permissions and token file path. The default file is ~/.config/rivalead/mcp-token with owner-only permissions. Use --output PATH for another account. The helper preserves existing files. For accounts with multiple workspaces, pass --workspace ID. Tokens default to read-only. Add --allow-actions only when the account owner wants the agent to take workspace actions.

## Connect and check the workspace

Read your workspace directly from the terminal. The command returns JSON with your monitored competitors and change counts. Use `--token-file PATH` if you saved your token elsewhere.

```sh
python3 signup.py overview
```

To continue in an MCP client, configure a Streamable HTTP connection with https://rivalead.com/mcp and the token from the file as a Bearer credential. For Codex CLI, run these commands in the shell that launches Codex:

```sh
export RIVALEAD_MCP_TOKEN="$(cat ~/.config/rivalead/mcp-token)"
codex mcp add rivalead --url https://rivalead.com/mcp --bearer-token-env-var RIVALEAD_MCP_TOKEN
```

Call get_workspace_overview. A new workspace has an empty competitor list. Manage or revoke the token in [workspace settings](https://rivalead.com/app/settings#mcp).

## Direct HTTP for runtimes without Python

Use https://rivalead.com as the base URL and send JSON bodies with Content-Type: application/json.

1. POST /api/auth/magic-link with {"email":"<agent inbox>"}. Read the link from that inbox.
2. Extract the token query parameter from the sign-in URL. POST /api/auth/verify with {"token":"<single-use token>"}. Keep the session cookie in memory. The response includes workspace and workspaces.
3. If needed, select the intended workspace by sending POST /api/workspaces/select with {"workspace_id":123} and the cookie.
4. POST /api/mcp/tokens with {"name":"My agent","can_act":false} and the cookie. Store the returned token privately. DELETE /api/session with the cookie to end the temporary session.
5. Use the token to connect and check the workspace as described above.

If the inbox belongs to a person, connect https://rivalead.com/mcp through [the OAuth setup](https://rivalead.com/integrations/mcp-server) and let them sign in, choose the workspace and approve access in their own browser.
