> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onlyfansapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Develop with AI Agents (/introduction/guides/develop-with-ai-agents)

import {
    BookOpenTextIcon,
    PlugZapIcon,
    BoxIcon,
    LightbulbIcon,
} from 'lucide-react';

import {
    SiModelcontextprotocol,
} from "@icons-pack/react-simple-icons";

## Not sure where to start? \[!toc]

<Cards>
  <Card icon={<BookOpenTextIcon className="text-fd-primary" />} title="AI-ready docs resources" href="#ai-ready-docs-resources">
    `llms.txt`, `llms-full.txt`, per-page `.mdx` URLs, and the OpenAPI schema.
  </Card>

  <Card icon={<SiModelcontextprotocol className="text-fd-primary" />} title="Connect our docs via MCP" href="#connect-our-docs-via-mcp">
    One-click install for Cursor, VS Code, Claude, ChatGPT, and any other MCP client.
  </Card>

  <Card icon={<PlugZapIcon className="text-fd-primary" />} title="Call the API via MCP" href="#call-the-api-via-mcp">
    350+ tools across OnlyFans and Fansly — let your agent run the API, not just read about it.
  </Card>

  <Card icon={<BoxIcon className="text-fd-primary" />} title="Install onlyfansapi-skill" href="#install-onlyfansapi-skill-from-skillssh">
    Drop-in skill from skills.sh that teaches your agent the API surface.
  </Card>

  <Card icon={<LightbulbIcon className="text-fd-primary" />} title="Prompting tips" href="#prompting-tips-for-better-agent-output">
    Small prompt tweaks that produce dramatically better agent output.
  </Card>
</Cards>

## AI-ready docs resources

When building with AI agents, point them to these resources first:

* [docs.onlyfansapi.com/llms.txt](https://docs.onlyfansapi.com/llms.txt) - canonical AI-friendly docs entrypoint
* [docs.onlyfansapi.com/llms-full.txt](https://docs.onlyfansapi.com/llms-full.txt) - complete LLM-friendly docs (also used for backward compatibility)
* [API Reference](/api-reference) - interactive endpoint docs by category
* [OpenAPI schema](https://app.onlyfansapi.com/scribe-docs/openapi.yaml) - machine-readable API spec

### Per-page `.mdx` URLs

For individual guides or API endpoints, just append `.mdx` to the page URL and feed that directly to the AI agent.

Examples:

* `https://docs.onlyfansapi.com/introduction/guides/develop-with-ai-agents.mdx`
* `https://docs.onlyfansapi.com/api-reference/account/list-accounts.mdx`
* `https://docs.onlyfansapi.com/api-reference/chats/list-chats.mdx`

## Two MCP servers, different jobs

We run **two** MCP servers. They are easy to confuse and do completely different things — pick by whether you want your agent to *read the docs* or *run the API*.

|                       | **Docs MCP**                                      | **API MCP**                                  |
| --------------------- | ------------------------------------------------- | -------------------------------------------- |
| URL                   | `docs.onlyfansapi.com/api/mcp`                    | `app.onlyfansapi.com/mcp/onlyfans-mcp`       |
| Use it to             | Search and read this documentation                | Actually call the API                        |
| Tools                 | 3 (`search_docs`, `get_doc_page`, `get_overview`) | 350+ — one per endpoint, OnlyFans and Fansly |
| Auth                  | None — public, read-only                          | API key or OAuth                             |
| Touches your accounts | No                                                | Yes                                          |

Most developer setups want **both**: the Docs MCP so the agent writes correct calls, and the API MCP so it can execute them.

## Connect our docs via MCP

We host a remote [Model Context Protocol](https://modelcontextprotocol.io) server at:

```
https://docs.onlyfansapi.com/api/mcp
```

Hook it into Claude, Cursor, VS Code, ChatGPT, or any other MCP-compatible client and your agent gets three tools that query these docs directly — no copy/paste, always up to date:

* `search_docs(query, limit?)` — full-text search across the docs (Algolia).
* `get_doc_page(path)` — raw Markdown for a single page (path or full URL).
* `get_overview()` — the entire docs as one Markdown document ([`llms.txt`](https://docs.onlyfansapi.com/llms.txt)).

<Callout>
  The MCP server is public, read-only, and requires no API key. It only exposes content already published at [docs.onlyfansapi.com](https://docs.onlyfansapi.com).
</Callout>

### Cursor

[**→ Add to Cursor (one click)**](cursor://anysphere.cursor-deeplink/mcp/install?name=onlyfansapi-docs\&config=eyJ1cmwiOiJodHRwczovL2RvY3Mub25seWZhbnNhcGkuY29tL2FwaS9tY3AifQ==)

Or manually: **Settings** → **MCP** → **Add new server**, type **HTTP**, URL `https://docs.onlyfansapi.com/api/mcp`.

### VS Code (GitHub Copilot)

[**→ Add to VS Code (one click)**](vscode:mcp/install?%7B%22name%22%3A%22onlyfansapi-docs%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdocs.onlyfansapi.com%2Fapi%2Fmcp%22%7D)

Or manually: open the Command Palette → **MCP: Add Server** → **HTTP** → URL `https://docs.onlyfansapi.com/api/mcp`.

### Claude Desktop

Open **Settings** → **Connectors** → **Add custom connector** and paste the URL:

```
https://docs.onlyfansapi.com/api/mcp
```

Alternatively, add this entry to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows) and restart the app:

```json
{
  "mcpServers": {
    "onlyfansapi-docs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://docs.onlyfansapi.com/api/mcp"]
    }
  }
}
```

### Claude.ai (web)

In Claude.ai: **Settings** → **Connectors** → **Add custom connector** → URL `https://docs.onlyfansapi.com/api/mcp`. Requires a paid plan that supports custom connectors.

### ChatGPT

In ChatGPT: **Settings** → **Connectors** → **Create** → paste `https://docs.onlyfansapi.com/api/mcp`. Custom connectors are available on plans that include MCP support (Pro / Business / Enterprise at the time of writing).

### Other MCP clients

Any client that speaks Streamable HTTP MCP works — point it at `https://docs.onlyfansapi.com/api/mcp`. For stdio-only clients, bridge with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):

```bash
npx -y mcp-remote https://docs.onlyfansapi.com/api/mcp
```

## Call the API via MCP

The docs MCP above only reads documentation. To let an agent **run** the API — send messages, pull earnings, publish posts — connect the API MCP server:

```
https://app.onlyfansapi.com/mcp/onlyfans-mcp
```

It exposes **350+ tools**, one per documented endpoint, across both creator platforms: 290+ OnlyFans (unprefixed) and 80+ Fansly (prefixed `fansly_`).

For stdio-only clients, bridge with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote). The server supports OAuth, so this opens a browser to authorize — no key handling in your config:

```bash
npx -y mcp-remote https://app.onlyfansapi.com/mcp/onlyfans-mcp
```

Backend integrations authenticate instead with an API key from [app.onlyfansapi.com/api-keys](https://app.onlyfansapi.com/api-keys), passed as `Authorization: Bearer …`. See [Embed in your app](/onlyfans-ai/mcp/embed) for that pattern.

Working with one platform only? Append `?platforms=onlyfans` or `?platforms=fansly` to cut the tool list down before it reaches your model.

<Callout type="warn">
  Unlike the docs MCP, this server **acts on your real accounts**. Use a scoped API key, keep write access on `Needs approval` in your client, and review the audit log.
</Callout>

Full setup guides: [Claude](/onlyfans-ai/mcp/claude) · [ChatGPT](/onlyfans-ai/mcp/chatgpt) · [Manus](/onlyfans-ai/mcp/manus) · [Embed in your own app](/onlyfans-ai/mcp/embed). Platform specifics: [OnlyFans](/onlyfans-ai/mcp/onlyfans) · [Fansly](/onlyfans-ai/mcp/fansly).

## Install `onlyfansapi-skill` from skills.sh

Skill page:
[skills.sh/onlyfansapi/skill/onlyfansapi-skill](https://skills.sh/onlyfansapi/skill/onlyfansapi-skill)

Install command shown on the skill page:

```bash
npx skills add https://github.com/onlyfansapi/skill --skill onlyfansapi-skill
```

<Callout>
  Restart your agent/CLI session after installation so the new skill is loaded.
</Callout>

### Configure your API key

The skill expects `ONLYFANSAPI_API_KEY` in your environment:

```bash
export ONLYFANSAPI_API_KEY="your_api_key_here"
```

Get your key from:
[app.onlyfansapi.com/api-keys](https://app.onlyfansapi.com/api-keys)

Quick auth check:

```bash
curl -s -H "Authorization: Bearer $ONLYFANSAPI_API_KEY" \
  "https://app.onlyfansapi.com/api/accounts" | jq .
```

## Prompting tips for better agent output

* Ask the agent to read `llms.txt` or `llms-full.txt` before generating calls.
* Include exact date ranges and timezone when requesting analytics.
* Ask for tables with totals when comparing multiple accounts.
* Ask the agent to show endpoint path + params before execution if you want to review requests first.