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

# MCP Setup

> Connect Autoposting to Claude, Cursor, or any MCP client in under 2 minutes.

## Get Your API Key

Generate an API key from your [dashboard settings](https://autoposting.ai/settings) under **API & Integrations → API Keys**.

<Warning>
  Keep your API key secret. Never commit it to version control or share it publicly.
</Warning>

## Install the CLI

The MCP server is built into the CLI package:

```bash theme={null}
npm install -g @autoposting.ai/cli
```

## Connect Your Client

<Tabs>
  <Tab title="Claude Desktop">
    Add to your Claude Desktop MCP settings (`claude_desktop_config.json`):

    ```json theme={null}
    {
      "mcpServers": {
        "autoposting": {
          "command": "ap",
          "args": ["mcp"],
          "env": { "AUTOPOSTING_API_KEY": "sk-social-your-key" }
        }
      }
    }
    ```

    Restart Claude Desktop. The 51 Autoposting tools appear automatically.
  </Tab>

  <Tab title="Cursor">
    Open **Settings → MCP** and add:

    ```json theme={null}
    {
      "autoposting": {
        "command": "ap",
        "args": ["mcp"],
        "env": { "AUTOPOSTING_API_KEY": "sk-social-your-key" }
      }
    }
    ```

    Tools are available in Composer and Agent mode.
  </Tab>

  <Tab title="Claude Code">
    Add to `.claude/settings.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "autoposting": {
          "command": "ap",
          "args": ["mcp"],
          "env": { "AUTOPOSTING_API_KEY": "sk-social-your-key" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Remote (no install)">
    For cloud-hosted agents or Claude.ai, use the remote endpoint:

    ```json theme={null}
    {
      "mcpServers": {
        "autoposting": {
          "url": "https://app.autoposting.ai/mcp",
          "headers": {
            "Authorization": "Bearer sk-social-your-key"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Verify the Connection

Ask your AI assistant:

```
List my brands using Autoposting.
```

You should see your brands returned. If you get an auth error, confirm your API key is valid and not expired.

## Authentication

Use any API key — scopes on the key determine which tools are available.

```bash theme={null}
# CLI MCP uses env var
AUTOPOSTING_API_KEY=sk-social-your-key ap mcp

# Or pass as flag
ap mcp --api-key sk-social-your-key
```

Keys with restricted scopes see fewer tools. Generate a full-access key for the complete 51-tool set.

<CardGroup cols={2}>
  <Card title="Tools Reference" icon="wrench" href="/mcp/tools">
    Input schemas and examples for all 51 tools.
  </Card>

  <Card title="MCP Overview" icon="robot" href="/mcp/overview">
    Architecture and tool summary.
  </Card>

  <Card title="Get an API Key" icon="key" href="/authentication">
    API key creation and scopes.
  </Card>

  <Card title="CLI Commands" icon="terminal" href="/cli/commands">
    Same operations via terminal.
  </Card>
</CardGroup>
