---
id: "use-cases/ai-agent-setup"
type: "doc"
url: "https://affitor.com/docs/use-cases/ai-agent-setup"
kind: "concept"
updated: "2026-11-07"
---
# Set up with an AI agent, connect your program in one sign-in

> What an AI tool can do with Affitor today: read your account over the hosted MCP server with one sign-in, or create a program and add tracking with the CLI.

An AI app can read your Affitor account through the hosted MCP server, after one sign-in. A coding agent can create a program and add Affitor tracking to your site's code with the Affitor CLI.

| | MCP server | Affitor CLI |
|---|---|---|
| Best for | Asking an AI app about your program, partners, commissions and billing, or about your earnings as a partner | A coding agent that adds tracking to your site's code |
| Sign-in | Your Affitor account, in the browser. No API key | `npx affitor login` opens your browser; `npx affitor init` saves the program API key in `.affitor/.env` |
| What it can do | Read-only: it cannot change data or move money. With a brand connection, `get_program` returns the tracker install snippet, where it goes and how to verify it | Create a program and write `.affitor/AGENTS.md` for your coding agent. `npx affitor onboard` fires a test click, lead and sale, and exits with an error until the integration is verified |
| Programs | All current and future programs, or up to 50 you select when you sign in | One program per API key: the new one `npx affitor init` creates, or one you already have when you pass its key with `--api-key` or `AFFITOR_API_KEY` |
| Start here | [Connect your AI tool](/docs/api-reference/connect-ai-tool) | [CLI quickstart](/docs/brand/cli/quickstart) |

In the dashboard, **Program settings** › **Tracking** › **With AI** gives you a prompt that has your AI tool add tracking with your program API key; [Connect your AI tool](/docs/api-reference/connect-ai-tool) shows it.

[Set up a coding agent](/docs/brand/cli/agent-setup) gives Claude Code, Cursor or Codex Affitor's local tracking MCP server, which uses a program API key. It is separate from the hosted server: it does tracking, not reporting.

## Related

- [Connect your AI tool](/docs/api-reference/connect-ai-tool): the steps for each AI app
- [MCP server reference](/docs/api-reference/mcp): sign-in, tools, limits and removing access
- [CLI quickstart](/docs/brand/cli/quickstart): create a program and add tracking from your terminal
- [Set up a coding agent](/docs/brand/cli/agent-setup): the local tracking MCP server for Claude Code, Cursor or Codex

<div className="aff-uc-cta not-prose">
  <a href="https://affitor.com/signup" className="aff-btn aff-btn-primary">Create free account</a>
  <a href="/docs/api-reference/connect-ai-tool" className="aff-btn aff-btn-secondary">Connect your AI tool</a>
</div>
