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

# Connect an agent

Connect an AI agent to Lid over MCP: create a key in Settings, point the agent at mcp.lid.pro/mcp, make the first calls, build a site, publish a product.

In plain words: this page gets an AI agent from zero to its first call on Lid. If you use Lid through the app, you never need it.

## How does an AI agent connect to Lid?

Over MCP (Model Context Protocol), with one API key and one address. Lid runs an MCP server at `https://mcp.lid.pro/mcp` (Streamable HTTP); the agent sends its key as a bearer token and gets the same tools a person has in the dashboard.

{% stepper %}
{% step %}

### Create a key

In the app: **Settings → Development → Create API key**. One key per agent, labeled. Tick only the permissions the agent needs:

* **Site**: write your site's code, publish it and turn pieces on or off.
* **Catalog**: create and edit products and challenges, without funds.
* **Money**: fund challenges and assign prizes with the agent wallet.
* **People data and sales**: contacts, waitlist, questions, members, submissions and sales, through your sites' tools.
* **Lida tasks** and **Chat with Lida**: hand Lida a task, or chat with her, from your own system.

With no permissions, the key can only read. Choose when it expires: 30, 90 or 180 days. The key starts with `lpmcp_`, and you can show it again on that screen with **Show key**. Treat keys like money: one key per agent, and remove what you do not recognize.

![The Development section in Lid's Settings in an earlier capture: a label field, the Create key button, the Site, Catalog and Money permissions, and the expiry set to 90 days.](https://1004546140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQKVT6WDKWT4P06WmWa57%2Fuploads%2FzZ3QzyNan7QV2AElaFsW%2Fdeveloper-create-key.png?alt=media)

The capture above is from an earlier version of this screen. Today it lists the six permissions.
{% endstep %}

{% step %}

### Point the agent at Lid

{% tabs %}
{% tab title="Claude Code" %}

```bash
claude mcp add --transport http lidpro https://mcp.lid.pro/mcp \
  --header "Authorization: Bearer lpmcp_YOUR_KEY"
```

{% endtab %}

{% tab title="Cursor" %}
In `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "lidpro": {
      "url": "https://mcp.lid.pro/mcp",
      "headers": { "Authorization": "Bearer lpmcp_YOUR_KEY" }
    }
  }
}
```

{% endtab %}

{% tab title="Claude Desktop" %}
In `claude_desktop_config.json`, through the `mcp-remote` bridge:

```json
{
  "mcpServers": {
    "lidpro": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://mcp.lid.pro/mcp",
        "--header", "Authorization: Bearer lpmcp_YOUR_KEY"
      ]
    }
  }
}
```

If your client has no field for headers, the key can go in the address as `https://mcp.lid.pro/mcp?key=lpmcp_YOUR_KEY`. A key in an address stays in history and in logs, so use the header whenever the client allows it.
{% endtab %}

{% tab title="Any MCP client" %}

```json
{
  "mcpServers": {
    "lidpro": {
      "url": "https://mcp.lid.pro/mcp",
      "headers": { "Authorization": "Bearer lpmcp_YOUR_KEY" }
    }
  }
}
```

{% endtab %}

{% tab title="REST" %}
Lid also answers over REST at `https://api.lid.pro/api/v1`, with the same bearer key. Routes are named after resources, not after tools: for example `GET /agent/me`, `GET /agent/products` and `GET /agent/sales`.

```bash
curl -H "Authorization: Bearer lpmcp_YOUR_KEY" \
     -H "User-Agent: my-agent/1.0" \
     https://api.lid.pro/api/v1/agent/me
```

The full list of routes is in the developer guide at [lid.pro/en/docs](https://lid.pro/en/docs), linked from **Settings → Development**.
{% endtab %}
{% endtabs %}

The Development tab also gives you a ready-made snippet for Claude (web), Claude Code, Claude Desktop, Cursor and Antigravity, with your new key already in it. A discovery file lives at `https://lid.pro/.well-known/mcp.json`.

{% hint style="info" %}
Send a User-Agent header that names your agent. Default script user agents can be refused at the edge.
{% endhint %}
{% endstep %}

{% step %}

### Make the first three calls

1. `api_health`: confirms the API is reachable. Returns `{ "status": "ok" }`.
2. `my_agent_wallet`: who this key acts as. The user id, the real wallet where revenue goes, and the agent wallet the agent acts from.
3. `get_my_usage`: creation caps, what is left today, and the agent wallet balances. Free to call.
   {% endstep %}

{% step %}

### Build a first site

Needs the **Site** permission.

1. `get_app_guide` first. It is the building guide Lida follows.
2. `create_app` for a new site. It starts as a draft, and nothing is public until you publish.
3. `write_app_files` in batches, and `check_app` after every write.
4. `screenshot_app` to see the draft on a computer and on a phone.
5. `publish_app` only when the person asks. If the site is not paid yet it answers `402 site_payment_required`: the owner finishes that step on lid.pro, and an agent cannot do it.
   {% endstep %}

{% step %}

### Publish a first product

Needs the **Catalog** permission.

1. `upload_file` with `gated: true` for the content buyers pay for. It returns a `key`.
2. `create_product` with `name`, `priceUsdc` (human units, `"5"` is five dollars), `maxSupply`, and the commission you offer sharers (`affiliateCommissionBps`, `1000` is 10%).
3. `update_product` with `extraFiles: [{ key, title }]`. A paid product with no file stays a draft; attaching the file publishes it.
4. `my_products` to read it back: product address, price, supply, status.
   {% endstep %}
   {% endstepper %}

## What can an agent do once it is connected?

An agent can build and publish a site, create and publish products, share other people's products, run and fund challenges and campaigns, review results, read sales and analytics, work a site's admin and receive signed webhooks. Each call needs the matching permission on the key. Every sale settles like a human sale: one transaction, flat 3%, revenue in the key owner's real wallet.

## What to read next

* [Tool reference](https://docs.lid.pro/agents/tools.md): the tools, grouped by job.
* [Webhooks and events](https://docs.lid.pro/agents/webhooks.md): get called when a sale, a prize or a conversion happens.
* [Usage and limits](https://docs.lid.pro/agents/limits.md): caps and quotas.

Building something on this? Email <hello@lid.pro> with what you are making. Early builders shape what we build.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lid.pro/agents/connect.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
