# AiToEarn

> An AI content-marketing agent that creates, schedules and publishes posts across 14+ Chinese and global social platforms, with an MCP server and a self-hosted Docker stack

- Category: AI Productivity & Writing / Writing & Marketing
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/yikart/AiToEarn
- Website: https://aitoearn.ai/
- Canonical page: https://ai-tldr.dev/tools/aitoearn/
- Updated: 2026-06-24

## In short

AiToEarn describes itself as an AI content-marketing agent for one-person companies, creators, brands and businesses. It sits in the Writing & Marketing category of the AI Productivity & Writing tools and is open-source, written in TypeScript and licensed MIT. To get started: connect it to an MCP client.

## Overview

AiToEarn describes itself as an AI content-marketing agent for one-person companies, creators, brands and businesses. It is organised around four agent capabilities — Monetize, Publish, Engage and Create — that cover the pipeline from making a piece of content to distributing it and earning from it. It targets both Chinese platforms (Douyin, Xiaohongshu/Rednote, Kuaishou, Bilibili, WeChat Channels and WeChat Official Accounts) and global ones (TikTok, YouTube, Facebook, Instagram, Threads, X, Pinterest and LinkedIn).

Publish pushes one piece of content to 14+ platforms at once and plans posts on a shared calendar. Create hands a content request to an agent that calls video models such as Grok, Veo and Seedance, image models such as Nano Banana, and video translation and editing modules, and can batch many drafts in parallel for matrix accounts. Engage runs through a browser extension that likes, bookmarks and follows, writes AI replies to comments, and mines comments for buying signals such as "link please". Monetize is a content marketplace where creators complete brand promotion tasks settled by sale (CPS), engagement (CPE) or views (CPM).

There are three ways to use it: the hosted web app at aitoearn.ai (aitoearn.cn for China), an MCP server that any MCP-capable assistant such as Claude or Cursor can call with an API key, and a self-hosted deployment from the repository with Docker Compose. The repository also ships an agent skill bundle for Claude Code, Trae and Cursor that covers creation, editing, publishing and monetisation. The code is MIT-licensed and written in TypeScript.

## What it does

- One-click publishing to 14+ platforms — TikTok, YouTube, Facebook, Instagram, Threads, X, Pinterest, LinkedIn, Douyin, Xiaohongshu, Kuaishou, Bilibili, WeChat Channels and WeChat Official Accounts — with a calendar for scheduling
- Agent-driven creation that calls video models (Grok, Veo, Seedance), image models (Nano Banana), video translation and editing, with batch generation of many drafts in parallel
- Browser-extension engagement: auto-like, bookmark and follow, AI comment replies, buying-signal mining and brand monitoring
- A content marketplace where creators take brand promotion tasks settled by CPS, CPE or CPM
- An MCP server (HTTP and SSE endpoints, x-api-key auth) for Claude Desktop, Cursor and other MCP clients
- An agent skill bundle for Claude Code, Trae and Cursor that installs from the repository's skills folder
- Self-hosted deployment with Docker Compose, plus Relay to borrow the official OAuth credentials for platform authorisation

## Getting started

The quickest route is the hosted web app at aitoearn.ai (aitoearn.cn in China), which needs no setup. To drive it from an AI assistant, use the MCP server; to run it on your own server, deploy the repository with Docker Compose (Docker 20.10+, Compose 2.0+, 4 GB+ RAM and 20 GB+ disk recommended).

1. Connect it to an MCP client

   Create an API key under Settings → API Key, then add the MCP server to your client. Match the URL to your key's environment — aitoearn.cn for a China key, aitoearn.ai for an international one — or a 401 is returned. For a self-hosted instance, replace aitoearn.ai with your own address.

```json
{
  "mcpServers": {
    "aitoearn": {
      "type": "http",
      "url": "https://aitoearn.ai/api/unified/mcp",
      "headers": {
        "x-api-key": "your-api-key"
      }
    }
  }
}
```

2. Or self-host: clone and generate secrets

   Clone the repository and export the two secrets in the current shell. JWT_SECRET has no default, must be at least 32 characters, and must be re-exported after you reopen the terminal, or docker compose refuses to start.

```bash
git clone https://github.com/yikart/AiToEarn.git
cd AiToEarn
export JWT_SECRET="$(openssl rand -hex 32)"
export INTERNAL_TOKEN="$(openssl rand -hex 32)"
```

3. Write the secrets into both config files

   In project/aitoearn-backend/apps/aitoearn-ai/config/config.yaml and project/aitoearn-backend/apps/aitoearn-server/config/config.yaml, set auth.secret to your JWT_SECRET and auth.internalToken to your INTERNAL_TOKEN. In the aitoearn-server file, also set aiClient.token to the same INTERNAL_TOKEN.

4. Validate and start the stack

   No output from the first command means the configuration is valid. Wait until every service shows healthy or running, then open http://localhost:8080 — an admin account is created and logged in automatically on first start.

```bash
docker compose config --quiet
docker compose up -d
docker compose ps
```

5. Configure Relay and model providers

   The project strongly recommends Relay, which uses the official aitoearn.ai credentials to authorise TikTok, Rednote, YouTube and the other platforms without registering a developer account on each. Create an API key on aitoearn.ai or aitoearn.cn, then in your instance's Configuration Management set Server → Relay for platform authorisation and AI → Relay for platform-provided models, add any OpenAI, Gemini or Anthropic keys under AI → Model Providers, and click Save and Restart.

## When to use it

- A one-person company that wants to turn one idea into a post and publish it to TikTok, YouTube, Xiaohongshu and Douyin from a single calendar
- Batch-generating short videos and image posts for a group of matrix accounts with video and image models
- Letting Claude, Cursor or another MCP assistant write, illustrate and publish a social post through the MCP server
- Creators taking paid brand promotion tasks settled by sales, engagement or views, or self-hosting the whole stack with Docker Compose

## Version history

- 2026-06-24 v2.5.0: Relay configuration moved into the settings UI and split into Server Relay, for publishing-platform authorisation, and AI Relay, for platform-provided AI models; the release also introduced the Open Platform.
