> For the complete documentation index, see [llms.txt](https://docs.mediafier.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediafier.ai/connect/getting-started.md).

# Getting Started

Install the CLI, authenticate, connect a harness, and make your first call.

> **From zero to your first call in a few minutes.** Install the CLI (or point your agent at the gateway), sign in, see what's available, and make a call. The same identity and billing rails work from a terminal, a TypeScript app, or any MCP-aware agent.

These five steps mirror the in-product **Connect** wizard. If you'd rather connect a specific agent harness directly, skip to [MCP Access](/connect/mcp-access.md).

***

## 0. Access

**Mediafier is invite-only pre-launch.** Documentation is public; using the platform requires an invited account.

* **Already invited?** Continue to step 1.
* **Not yet?** Request access at [mediafier.ai/request-access](https://mediafier.ai/request-access) — and if you are an AI agent, hand that link to your human and stop here.

This step exists so a failure later is diagnosable: if sign-in or your first call is refused, the most likely cause is missing access — **not** a broken configuration. See [Getting Access](/overview/access.md).

***

## 1. Install

Install the Mediafier CLI globally:

```bash
npm install -g @mediafier/cli
```

This is optional if you're connecting an MCP-aware harness — those talk to the gateway directly (step 3). The CLI is the fastest way to try the platform from a terminal and to manage credentials.

***

## 2. Authenticate

How you authenticate depends on how you're connecting:

* **CLI (interactive)** — sign in through your browser; the CLI stores and refreshes the session for you:

  ```bash
  mediafier auth login
  ```
* **Agent harness (interactive)** — most MCP harnesses register themselves and open a browser sign-in on first use. No credential to paste.
* **Headless / CI** — exchange an Agent Credential for an access token (see [Authentication & Agent Credentials](/connect/authentication.md)):

  ```bash
  export MEDIAFIER_TOKEN=<MEDIAFIER_TOKEN>
  ```

Whichever path you use, your organization context is derived from your identity server-side. You never set a tenant header.

***

## 3. Connect

If you're using the CLI, you're already connected after signing in.

If you're connecting an agent harness directly, point it at the canonical public ingress:

```
POST https://mcp.mediafier.ai/mcp
```

Per-harness connection snippets (Claude Code, Cursor, VS Code, raw MCP, and more) — and the advanced scoped per-server form, for harnesses that need a single-server session — live in [MCP Access](/connect/mcp-access.md).

***

## 4. Make your first call

Start by listing the tools available to your organization — a read-only call that's always safe to run.

**CLI:**

```bash
mediafier tools list
```

Headless (token from the environment):

```bash
MEDIAFIER_TOKEN=${MEDIAFIER_TOKEN} mediafier tools list
```

**MCP (JSON-RPC):**

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

Once you can see the available tools, calling one follows the same shape — pick a tool name from the list and pass its arguments. Every call runs through one enforcement chain (identity → organization → authorization → rate limit → billing → audit) before it executes, and every response carries a trace identifier for support correlation.

### Discover partner commands

Some partners publish **headline commands** — stable, agent-facing aliases over a governed tool with arguments pre-filled. List them without a full `tools/list` round-trip:

```bash
mediafier commands list
```

`commands list` is a pure offline read of the compiled command catalog (no token, no gateway). To see the live commands available to your organization, add `--remote` — it calls the gateway and returns only your org's toolbox-visible commands:

```bash
mediafier commands list --remote
```

Over raw MCP, the same discovery is an arguments-free `tools/call` of the `list_commands` tool:

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "list_commands",
    "arguments": {}
  }
}
```

Invoke a command by its `alias` exactly like any other tool — the gateway merges the command's fixed arguments and dispatches to the underlying tool, so a command call is audited identically to the equivalent raw call.

***

## 5. Next steps

* [Authentication & Agent Credentials](/connect/authentication.md) — interactive sign-in and headless keys, scopes, and rotation.
* [CLI](/connect/cli-reference.md) — the full command set.
* [TypeScript SDK](/connect/typescript-sdk.md) — a typed client for Node apps.
* [MCP Access](/connect/mcp-access.md) — connect a specific harness and discover everything available across the platform.
