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

# Claude Code

> Connect TryPost to Claude Code for AI-powered social media management from the terminal

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's CLI tool for working with Claude directly in your terminal. You can connect it to TryPost's MCP server to manage your social media scheduling with natural language.

## Prerequisites

* Claude Code installed (`npm install -g @anthropic-ai/claude-code`)
* A TryPost Cloud account with an active trial or subscription ([start a 7-day free trial](/knowledge-base/plans-and-billing))

## Setup

<Steps>
  <Step title="Add the TryPost MCP server">
    Run the following command in your terminal:

    ```bash theme={null}
    claude mcp add --transport http trypost https://app.trypost.it/mcp/trypost
    ```

    This registers the server in the project's `.mcp.json`. Append `--scope user` to make it available across all projects.
  </Step>

  <Step title="Sign in through your browser">
    Start Claude Code and trigger the first TryPost call:

    ```bash theme={null}
    claude
    ```

    ```
    List all my scheduled posts
    ```

    Claude Code opens a browser window asking you to sign in to TryPost and authorize the connection. Click **Allow** — Claude Code stores the OAuth token and refreshes it automatically from then on.
  </Step>
</Steps>

## Manual configuration

If you prefer to edit the config file directly, this is what `claude mcp add` writes (no `Authorization` header — OAuth is discovered from the URL):

```json theme={null}
{
  "mcpServers": {
    "trypost": {
      "type": "http",
      "url": "https://app.trypost.it/mcp/trypost"
    }
  }
}
```

Drop it in `.mcp.json` for project scope or `~/.claude.json` for user scope.

<Accordion title="Bearer token fallback (CI, scripts, no browser available)">
  When you can't open a browser — CI runners, remote SSH boxes, scripts — use a Personal Access Token instead:

  ```bash theme={null}
  claude mcp add --transport http trypost https://app.trypost.it/mcp/trypost \
    --header "Authorization: Bearer YOUR_API_KEY"
  ```

  Create the key from **Settings > API Keys** in the [TryPost dashboard](https://app.trypost.it). Store it in your secrets manager, not in a committed file.
</Accordion>

## Example prompts

```
Create a new post scheduled for tomorrow at 10am
```

```
Show me all my connected social accounts
```

```
Create a signature called "SaaS Marketing" with #saas #marketing #growth #startup
```

```
List all my labels
```
