# Codex

## Option 1: the plugin

The plugin bundles the anyshare [skill](/docs/skill) and the MCP server.

```sh
codex plugin marketplace add anyshare/anyshare
codex plugin add anyshare@anyshare
```

## Option 2: the local MCP server

The local server reads files from disk, so Codex can share a folder in one step and the bytes never pass through the model.

```sh
codex mcp add anyshare -- npx -y @anyshare/cli mcp
```

That writes this to `~/.codex/config.toml`, which you can also add by hand:

```toml
[mcp_servers.anyshare]
command = "npx"
args = ["-y", "@anyshare/cli", "mcp"]
```

## Option 3: the remote MCP server

No Node.js needed.

```sh
codex mcp add anyshare --url https://anyshare.ai/mcp
```

Or in `~/.codex/config.toml`:

```toml
[mcp_servers.anyshare]
url = "https://anyshare.ai/mcp"
```

To publish into your account, put your API key (from `npx -y @anyshare/cli login`, saved in `~/.config/anyshare/auth.json`) in an environment variable and pass its name: `codex mcp add anyshare --url https://anyshare.ai/mcp --bearer-token-env-var ANYSHARE_API_KEY`, or `bearer_token_env_var = "ANYSHARE_API_KEY"` in the config.

## Check it works

```sh
codex mcp list
```

Then ask Codex: "build the site and share dist/ with anyshare". It prints the link when it's done, with 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). Run `npx -y @anyshare/cli login` once and links from the CLI or the local server go straight into your account.

## Skill only

If you'd rather not run an MCP server, install just the skill. It tells Codex to use `npx -y @anyshare/cli` (or curl) when sharing makes sense:

```sh
npx skills add anyshare/anyshare --skill anyshare
```

## Sandboxing

Uploading needs network access. If your sandbox settings block network access for shell commands, approve the upload when Codex asks, or use one of the MCP options so Codex doesn't need to run the CLI through its shell.
