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

# Connect the CLI to Studio

> Configure the endpoint, managed token, workspace and tool allowlist.

The CLI connects to a Studio MCP endpoint and uses managed tool grants to prepare transfers. Configure [managed MCP connections](https://studio.bjanczak.com/mcp-access.md#managed-credentials) on the host, then create a credential with access to the required workspace and tools.

## Set the endpoint and token

Set the complete endpoint, including its configured path. The following URL is illustrative. Use the URL supplied by your Studio installation.

```bash theme={null}
export FLEX_STUDIO_URL='https://studio.example.com/media-studio/mcp'
```

Supply `FLEX_STUDIO_TOKEN` through your shell or CI secret store. The CLI reads it from the environment for each process. The endpoint must use HTTPS. HTTP is accepted for localhost, loopback and .test development hosts.

## Grant tools for the intended workflow

| Workflow | Required tools |
| - | - |
| Inspect upload limits | `studio_get_upload_policy` |
| Ordinary source upload | `studio_prepare_file_upload` |
| Preserve image conversions | `studio_prepare_image_import` |
| Resolve nested destination folders | `studio_resolve_import_folder` |
| Resumable source upload | `studio_begin_upload`, `studio_complete_upload` |
| Direct S3 parts | `studio_sign_upload_part`, `studio_record_upload_part`, plus resumable tools |
| Search one page | `studio_search_files` |
| Prepare an original or version download | `studio_prepare_file_download` |

A resumable import also reads upload policy. A client that must work with either session or ordinary uploads needs the tools for both paths. Include folder resolution when local files or manifest records contain destination folders.

## Verify the credential

```bash theme={null}
flex-studio search 'campaign' --workspace 01J9GQ4ZPS9Z91FMY3JC5M8HJX --json
```

An empty search page can be a valid response. A permission error requires checking the tool grant, workspace allowlist and the credential owner's current workspace permissions. The CLI requires the explicit `--workspace` on remote operations. Use the workspace public ULID from Studio.

The CLI follows the server's prepared upload and download paths on the same origin. For a provider redirect during a download, it forwards the managed token only if the destination remains on the Studio origin.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.