Skip to content

Guide · Open source

How to use AiToEarn: Docker setup, API key and MCP access

Updated · written with AI from the project's own documentation and checked against our catalogue data

AiToEarn is an open-source content marketing platform that uses AI agents to create, publish and engage with posts across social sites such as Douyin, Xiaohongshu, YouTube and TikTok. This guide covers the three ways to start: the hosted website, an MCP connection for AI assistants like Claude or Cursor, and a self-hosted Docker setup. By the end you will know which option fits you and what each one requires.

AiToEarnyikart/AiToEarn · ★ 27.2k · MIT

Quick start

  1. 1Pick your method. Decide between the hosted website, MCP for an AI assistant, or self-hosting with Docker. Only MCP and Docker need an API Key.
  2. 2Create an API Key. Log in at aitoearn.cn or aitoearn.ai, open Settings, and create a key under API Key.
  3. 3Clone the repository. Run git clone https://github.com/yikart/AiToEarn.git and then cd AiToEarn.
  4. 4Start with Docker Compose. Run docker compose up -d from the project folder.
  5. 5Open the app. Visit http://localhost:8080 in your browser.
  6. 6Configure Relay. In Configuration Management, set Server Relay for publishing and OAuth, and AI Relay for AI models, then click Save and restart.

Choose how you want to use AiToEarn

The README lists several ways to use AiToEarn. The simplest is the hosted website, which needs no setup. The MCP option connects AiToEarn to an AI assistant that supports the MCP protocol. The Docker option runs AiToEarn on your own server.

  • Web: open aitoearn.cn (China) or aitoearn.ai (international) in a browser.
  • MCP: connect Claude, Cursor or another MCP-compatible assistant. Requires an API Key.
  • Docker: self-host on your own server. Requires Docker and Git.
  • Source: run the backend and frontend in development mode for local work.

Get an API Key for MCP and Docker use

The MCP and Docker methods both need an API Key. You only need to create one; the README says it works for all methods. Choose the site that matches your key, because a mismatch returns a 401 error.

  • Open aitoearn.cn (China users) or aitoearn.ai (international users) and sign up or log in.
  • Click Settings in the left menu.
  • Under API Key, click create and copy the generated key.

Connect AiToEarn to Claude, Cursor or another AI assistant

AiToEarn can be used from any AI assistant that supports MCP. The address must match your key's environment: the China version uses aitoearn.cn and the international version uses aitoearn.ai. The key is sent in an x-api-key header.

For Claude Desktop, edit claude_desktop_config.json and add an aitoearn entry with the MCP URL and the x-api-key header. For Cursor, add the MCP address and the authentication header in its MCP settings. Other tools need the same two values: the MCP address and the x-api-key header. An SSE address is also listed for long-connection use.

  • International MCP address: https://aitoearn.ai/api/unified/mcp
  • International SSE address: https://aitoearn.ai/api/unified/sse
  • China MCP address: https://aitoearn.cn/api/unified/mcp
  • If you self-host, replace aitoearn.ai with your own address, such as localhost:8080.
{ "mcpServers": { "aitoearn": { "type": "http", "url": "https://aitoearn.ai/api/unified/mcp", "headers": { "x-api-key": "你的API-Key" } } } }

Self-host with Docker Compose

The README describes Docker as a one-step deployment that avoids manual database installation. You need Docker and Git. Clone the repository, enter the folder, and start the services with Docker Compose. Once it is running, open http://localhost:8080 in your browser.

  • Install Docker first (the README links to Docker's official installation guide).
  • Run the three commands below.
  • Open http://localhost:8080.
git clone https://github.com/yikart/AiToEarn.git cd AiToEarn docker compose up -d

Configure Relay so you can connect social accounts

Publishing requires logging in to social media accounts, and those platforms' OAuth login needs developer credentials. The README says that with Relay configured you can use the official aitoearn.ai credentials for authorization, so you do not have to apply for developer accounts on each platform. The README strongly recommends this step.

In the deployed interface, open Configuration Management. There are two separate Relay settings: Server Relay, used for publishing and social platform OAuth, and AI Relay, used for the AI models the platform provides. After saving, click Save and restart so the services reload the settings. For the full production guide, see DOCKER_DEPLOYMENT_CN.md in the repository.

  • Server → Relay: publishing and social platform authorization.
  • AI → Relay: use of platform-provided AI models.
  • AI → Model providers: enter your own API key and API address for OpenAI, Gemini or Anthropic.
  • Save, then click Save and restart.

Run from source for development

The source route is intended for local development and debugging. The README says you can still use Docker to run MongoDB and Redis, or point the config files at your own services. It uses pnpm and Nx and asks you to copy the config.yaml files to local.config.yaml before starting the backend and frontend.

  • Backend: install with pnpm, copy the config files, then run pnpm nx serve aitoearn-ai and pnpm nx serve aitoearn-server in separate terminals.
  • Frontend: run pnpm install and then pnpm run dev in the aitoearn-web project.

What people use it for

  • Creators posting the same content to several platforms such as Douyin, Xiaohongshu, YouTube and TikTok.
  • Small marketing teams scheduling posts across social accounts in different regions using the calendar scheduling feature.
  • Developers who want to host a multi-platform publishing tool on their own server with Docker.
  • Users of Claude or Cursor who want to call AiToEarn from inside their AI assistant through MCP.

Frequently asked questions

Is AiToEarn free and open source?

The repository is licensed under MIT and is written in TypeScript. The README does not list prices for the hosted service, so check aitoearn.ai for current pricing.

What do I need to install AiToEarn?

For the self-hosted route, the README lists Docker and Git as prerequisites. You then run git clone, cd AiToEarn and docker compose up -d. The web version needs no installation.

Why does my AiToEarn API key return a 401 error?

The README says the environment and key must match. A China key should be used with aitoearn.cn and an international key with aitoearn.ai. Check that the address in your MCP or Relay config matches where the key was created.

Is there a desktop app for AiToEarn?

No. The README says the Electron desktop client was removed and the latest release has no binaries. Use the web version or self-host with Docker.

Do I need to set up developer accounts for each social platform?

The README says you do not have to, if you configure Relay. Relay lets you use the official aitoearn.ai credentials for OAuth, but the README also warns that social account logins then pass through a third-party relay.

How does AiToEarn compare with Postiz, Mixpost or Buffer?

The README does not compare these tools, so this guide cannot rank them. AiToEarn's README emphasises AI agents for creating content, many regional platforms and an MCP option. Test the options yourself against your platforms and privacy needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

AiToEarn suits creators and small teams who post the same content to many platforms, developers who want to self-host, and people who already use an MCP-capable AI assistant. It is less suitable if you only post to one platform, need a desktop app, or are not comfortable routing social logins through a third-party Relay.

Install options & downloads