# Agent registration

Agents can self-register and receive an API token immediately.
Listed MCP services are **auto-approved**. A system admin may suspend the
agent account or move service access back to `pending`.

Optional identity metadata (`actor_kind`, `org_label`) may be sent for analytics
and future billing — **never required**. Permissions come from
`approved_services`, not from self-declared claims.

## Endpoint

`POST https://mcp.glc-rag.hu/api/auth/register`

## Request

```http
POST https://mcp.glc-rag.hu/api/auth/register
Content-Type: application/json

{
  "email": "agent@example.com",
  "password": "choose-a-strong-password",
  "account_type": "agent",
  "actor_kind": "application",
  "org_label": "Acme Kft."
}
```

### Optional fields

| Field | Values | Notes |
|-------|--------|-------|
| `actor_kind` | `person`, `application`, `enterprise_agent`, `subagent` | Soft label; omit if unknown |
| `org_label` | string ≤200 chars | Organization the actor acts on behalf of |

## Response (selected fields)

```json
{
  "user": {
    "email": "agent@example.com",
    "account_type": "agent",
    "status": "active",
    "role": "org_admin",
    "actor_kind": "application",
    "org_label": "Acme Kft."
  },
  "approved_services": ["hello", "geo", "fetch", "docs", "shot"],
  "api_token": "mcp_...",
  "access_token": "<JWT for web/API>",
  "token_type": "bearer"
}
```

Save `api_token` — it authenticates the MCP endpoint.

## Call MCP

```http
POST https://mcp.glc-rag.hu/mcp
Authorization: Bearer mcp_...
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}
```

## curl

```bash
curl -sS -X POST 'https://mcp.glc-rag.hu/api/auth/register' \
  -H 'Content-Type: application/json' \
  -d '{"email":"agent@example.com","password":"choose-a-strong-password","account_type":"agent","actor_kind":"application","org_label":"Acme Kft."}'
```

## Cursor `mcp.json`

```json
{
  "mcpServers": {
    "glc-mcp": {
      "url": "https://mcp.glc-rag.hu/mcp",
      "headers": {
        "Authorization": "Bearer mcp_YOUR_TOKEN"
      }
    }
  }
}
```

## Human vs agent

| | Human | Agent |
|--|-------|-------|
| `account_type` | `human` (default) | `agent` |
| Service access | Request in Admin → system-admin approve | Auto-approved on register |
| API token | Create in Admin after approval | Returned as `api_token` |
| Suspension | System admin can suspend | Same |
| `actor_kind` / `org_label` | Optional (human defaults `person`) | Optional metadata |

## Links

- Web register (check **Register as agent**): `https://mcp.glc-rag.hu/register`
- This guide: `https://mcp.glc-rag.hu/guide/agent`
- Markdown: `https://mcp.glc-rag.hu/guide/agent.md`
- Catalog: `https://mcp.glc-rag.hu/guide/catalog.md`
- Agent index: `https://mcp.glc-rag.hu/llms.txt`
- MCP: `https://mcp.glc-rag.hu/mcp`
