# MCP server

> Avtrz ships a remote MCP server, so Claude, ChatGPT, and any MCP client can resolve real business profile photos and enriched profile data inline — no API key, no glue code. Add one connector URL, authorize once, and pick the workspace it bills to.

```
https://avtrz.dev/mcp
```

The Avtrz MCP server speaks the Model Context Protocol over streamable HTTP. `https://avtrz.dev/mcp` is the connector URL you paste into your client — not an endpoint you POST to yourself; the MCP transport handles the calls. It exposes the same avatar engine behind `GET /v1/avatar` as a set of read-only tools an LLM can call mid-conversation. Usage meters the same workspace quotas — there is no separate MCP billing.

## What it is

A connector your AI client adds once. When a model needs the face or the facts behind a LinkedIn URL, it calls an Avtrz tool and gets the answer back inline:

- **`get_profile_avatar`** — the real profile photo as an inline image (or deterministic initials art while enrichment runs), plus a ready-to-paste `imageUrl`.
- **`get_profile`** — structured person data (name, headline, summary, industry, location, picture URL, open-to-work) plus a readable Markdown block.
- **`get_publishable_key`** — your workspace's publishable avatar key and a URL template, so the model can hand you durable `<img>` URLs that render anywhere.

All three tools are **read-only**. The connection can't write data, change billing, or message your team.

## Working image URLs

The MCP server doesn't just return image bytes — it can hand the model a **durable Avtrz image URL** to drop into a CRM, doc, email, or static site, where it renders immediately:

```
https://avtrz.dev/v1/avatar?key=pk_…&linkedin_url=https://www.linkedin.com/in/janedoe&size=128
```

These URLs are powered by your workspace's **publishable key**, provisioned automatically the first time the connector is used. `get_profile_avatar` returns one as `imageUrl` alongside the inline image, and `get_publishable_key` returns the key plus a URL template so the model can build URLs for a whole list of people at once. The key is unrestricted by design (no domain firewall) so the images load from any context — see [MCP tools](https://avtrz.dev/docs/mcp/tools) for the full reference and caveats.

## How you connect

1. Add the connector URL `https://avtrz.dev/mcp` in your client (Claude, ChatGPT, Cursor, or any MCP client).
2. The client discovers the authorization server and starts an **OAuth 2.1 + PKCE** handshake.
3. You land on the Avtrz consent screen, sign in, and **pick the workspace** this connection binds to.
4. Authorize. The client gets a scoped access token and the tools light up.

The consent screen auto-detects which client is connecting (Claude, ChatGPT, or a generic MCP client) from its redirect URI, and shows you the exact scopes, the read-only guarantee, and the workspace switcher. You can revoke the connection anytime from your dashboard.

See [Connect Claude & ChatGPT](https://avtrz.dev/docs/mcp/connect) for the step-by-step.

## Workspace binding, quota, and billing

The handshake binds the connection to **one Avtrz organization** (workspace). Every tool call is metered against that workspace, exactly like an API-key request:

- Tool calls write to the same `avatarRequest` analytics the HTTP API uses, so MCP traffic shows up in your dashboard alongside everything else.
- Every metered tool call counts as one `avatar_requests` unit — whether or not a photo is found — and a profile your workspace hasn't looked up before also counts against `avatar_new_profiles`.
- Hit a monthly limit and the tool returns a clear "quota exceeded for this workspace" message — no surprise charges.

If you belong to more than one workspace, switch which one you're granting access as on the consent screen before you authorize. To move a connection to a different workspace, revoke it and reconnect.

## Who it's for

- **Sales and RM teams** who live in Claude or ChatGPT and want a real face and one-line profile next to every prospect they discuss.
- **Builders** wiring Avtrz into an agent via Cursor or the MCP Inspector without hand-rolling an HTTP client.
- **Anyone already using the [`GET /v1/avatar`](https://avtrz.dev/docs/api/avatar) API** who wants the same engine available conversationally, on the same quota.

## How it relates to the API

The MCP server is a second front door to the same avatar engine — not a separate product:

| | `GET /v1/avatar` (API) | MCP server |
| --- | --- | --- |
| Auth | Publishable / secret API key | OAuth 2.1 + PKCE, workspace-bound |
| Caller | Your code | Your AI client (Claude, ChatGPT, …) |
| Returns | `302` to a CDN image, or SVG fallback | Inline image + a durable image URL + structured profile data |
| Quota | `avatar_requests`, `avatar_new_profiles` | Same quotas, same workspace |

Reach for the API when you render avatars in your own product. Reach for the MCP server when a model should resolve them in conversation.

## Where to go next

- [Connect Claude & ChatGPT](https://avtrz.dev/docs/mcp/connect): Add the connector and authorize in each client.
- [MCP tools](https://avtrz.dev/docs/mcp/tools): The full reference for `get_profile_avatar`, `get_profile`, and `get_publishable_key` — inputs, outputs, and edge cases.
