# Connect an agent

Connect Claude Code, Claude.ai, ChatGPT or any MCP client to your Linkio account.

Your agent is part of self-serve: it works on the same account and placements as the app, and you can mix the
two at any step. The steps, each in the app and with your agent: [Buy links yourself](/docs/self-serve).

An agent works inside your Linkio account through Linkio's MCP server. It sees only the tools its key allows.
Every paid step says what it will hold before it runs.

## 1. Make a key

Make a key at https://www.linkio.com/account/api-keys. The key starts with `acc_` and is shown once.

| Level | What the agent can do |
|---|---|
| Reporting, Read only | Read only. Every write tool is missing from its tool list. |
| Automation | Search, order, write, send, pass or fail, record payments. It cannot change the account's spending limits or card, and cannot make keys. |
| Full access | Everything, the spending limits and the card included. |

Use Automation for an agent that does the work. A key can also be limited to one brand.

On a managed account the keys page opens on Reporting, and the agent's jobs are different: it reads, follows
your approvals and invoices, and asks Linkio's team. See [Linkio does it for you](/docs/managed).

## 2. Connect Claude Code

With the Linkio plugin:

```
export LINKIO_API_KEY=acc_your_key
claude plugin marketplace add ajaypag/linkio-link-building-agent
claude plugin install linkio@linkio
```

Without the plugin, any MCP client:

```
claude mcp add --transport http linkio https://mcp.linkio.com/mcp --header "Authorization: Bearer acc_your_key"
```

The server is `https://mcp.linkio.com/mcp`, with the header `Authorization: Bearer <your key>`. If the client
reads the key from the environment (`${LINKIO_API_KEY}`), export the variable before you start the client.

## 3. Or connect Claude.ai or ChatGPT

Both connectors sign in with your Linkio account instead of a key. Server URL: `https://mcp.linkio.com/mcp`.

### Claude.ai (web, desktop, mobile)

1. Customize → Connectors → Add → Add custom connector → URL `https://mcp.linkio.com/mcp` → Add → Connect.
2. Claude opens a Linkio sign-in; use the email and password of your Linkio account. No key needed: the connection acts as your account with the same permissions a key would have. Claude asks before each tool runs; choose Allow.

### ChatGPT (Plus or Pro)

1. Plugins → Add → Create custom MCP server → Server URL `https://mcp.linkio.com/mcp`, Authentication OAuth → tick "I understand" → Create as a plugin → Continue to Linkio.
2. Sign in with your Linkio account's email and password when asked.

Under the hood this is OAuth 2.1: the connector reads `https://www.linkio.com/.well-known/oauth-authorization-server`, registers itself at `POST https://www.linkio.com/api/oauth/register` and exchanges the code at `https://www.linkio.com/api/oauth/token`. The [API reference](/docs/api) has the grants.

## 4. Give it the first job

Tell the agent your site and the page you want links to. The walk: [Your first guest post in five
minutes](/docs/agents/first-job). What the server tells every agent: [The rules your agent gets](/docs/agents/rules).

## Scripts

A script calls the same work over HTTP with the key in `X-API-Key` or `Authorization: Bearer`. Start at the
[API reference](/docs/api).
