# Claude Code

Pick one of three setups. Each takes a single command, and you can ask "share this with anyshare" as soon as it's done.

## Option 1: the plugin (recommended)

The plugin installs the anyshare [skill](/docs/skill), which tells Claude when sharing makes sense and how to do it safely, together with the anyshare MCP server. Run these inside Claude Code:

```text
/plugin marketplace add anyshare/anyshare
/plugin install anyshare@anyshare
```

Restart Claude Code if it asks you to. From your shell, `claude plugin marketplace add anyshare/anyshare` does the same as the first line.

## Option 2: the local MCP server

The local server reads files from your disk, so Claude can share a whole `dist/` folder in one tool call without the bytes passing through the conversation.

```sh
claude mcp add --scope user anyshare -- npx -y @anyshare/cli mcp
```

`--scope user` makes it available in every project. Leave it out to add it to the current project only, or use `--scope project` to write it to the project's `.mcp.json` and share it with your team:

```json
{
  "mcpServers": {
    "anyshare": { "command": "npx", "args": ["-y", "@anyshare/cli", "mcp"] }
  }
}
```

## Option 3: the remote MCP server

No Node.js needed. Claude publishes the text it writes directly, and for files on disk it gets a command to run.

```sh
claude mcp add --transport http --scope user anyshare https://anyshare.ai/mcp
```

To publish into your account, add your API key (from `npx -y @anyshare/cli login`, saved in `~/.config/anyshare/auth.json`) as a header:

```sh
claude mcp add --transport http --scope user anyshare https://anyshare.ai/mcp \
  --header "Authorization: Bearer as_key_…"
```

## Check it works

```sh
claude mcp list
```

Then, in a session:

```text
> make a one-page HTML summary of this repo and share it with anyshare
```

Claude writes the page, publishes it and prints a link like `https://sunny-otter-4821.anyshare.site`, plus a claim link: without an account the page expires in 1 hour unless you open it and sign in or create a free account (then it lasts 30 days).

## Tips

- Run `npx -y @anyshare/cli login` once and links Claude publishes with the CLI or the local server go straight into your account, with no claim step.
- "Update the link" works later in the same or a new session: the local server keeps the token in `~/.config/anyshare/sites.json`.
- Ask for a custom address: "share dist/ as q3-report" gives `https://q3-report.anyshare.site`.
- Claude Code can also run the CLI directly with its Bash tool, which needs no setup at all: `npx -y @anyshare/cli ./dist`.
- Secrets never go up: `.env` files, keys and credentials are skipped or refused.
