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

# Strand AI connector for Claude

> Connect Claude to Strand AI over a remote MCP server to run virtual multiplex immunofluorescence (H&E to spatial proteomics) from chat, using your existing Strand AI organization and credits.

The Strand AI remote MCP server lets Claude operate the Strand AI platform
directly. From a Claude conversation you can upload an H\&E whole-slide image,
then inspect samples and estimate or submit a Lattice virtual-staining run.
Claude tracks the run and downloads the predicted marker channels, authorized
against your existing Strand AI organization.

The server is an authenticated layer over the same [Strand AI REST
API](/api/overview). It exposes tools only, never a database or storage
credential, and slide bytes never pass through it (see [Remote file
transfer](#remote-file-transfer)).

## Pick your client

Every client gets the same tools. Setup differs because slide bytes travel from
the client to storage, and some clients restrict outbound network access.

| Client                         | Slide upload from chat                 | Setup                                       |
| ------------------------------ | -------------------------------------- | ------------------------------------------- |
| Claude Code, Strand AI SDK     | Works as installed                     | [Below](#claude-code-and-the-strand-ai-sdk) |
| claude.ai web and desktop apps | Works after a one-time network setting | [Below](#claude-web-and-desktop-apps)       |

## Claude Code and the Strand AI SDK

Claude Code runs on your own machine, so it can send slide bytes to storage
without extra configuration.

```bash theme={"dark"}
claude mcp add --transport http strand https://mcp.strandai.com/mcp
```

Run `/mcp` in Claude Code, authorize with your Strand AI account, and pick the
organization this connection may act on. The authorized session supports
upload, inference, and result access.

The [Python SDK](/sdks/python) and [REST API](/api/overview) connect directly
without an MCP connector. Use them for scripted or bulk uploads.

## Claude web and desktop apps

These steps cover claude.ai in a browser and the Claude desktop app.

<Steps>
  <Step title="Add the connector">
    In Claude, add a custom connector with the server URL
    `https://mcp.strandai.com/mcp` over the Streamable HTTP transport.
  </Step>

  <Step title="Authorize with Strand AI">
    Claude opens Strand AI's sign-in and consent screen. Sign in with your Strand AI
    account and approve the requested scopes.
  </Step>

  <Step title="Choose an organization">
    Pick the Strand AI organization this connection may act on. The connection is
    bound to that organization and to your user, and runs are billed to that
    organization's credits.
  </Step>

  <Step title="Allow uploads to reach storage (upload prerequisite)">
    Before your first upload, open your organization's Settings, Capabilities,
    Allow network egress, and add `storage.googleapis.com`. This setting applies
    to the organization, so an administrator must change it on team and
    enterprise plans. Start a new chat after changing the setting. An open
    conversation retains its original sandbox configuration.

    Claude sends slide bytes to storage from its sandbox. Until the host is
    allowed, uploads fail with `host_not_allowed`; the other tools continue to
    work. The setting is required once per organization. Claude Code and the
    Strand AI SDK run on your machine and do not require it.

    **Why `storage.googleapis.com` is required.** Slides are sent directly from
    the client to the Google Cloud Storage bucket for your organization's data.
    The bytes are not sent through the model or MCP server. Each presigned
    session is restricted to one object in your organization's storage and
    cannot be redirected.
  </Step>
</Steps>

After this setup, the Claude conversation supports upload, inference, and
result access.

<Tip>
  **For large slides or uploads without an egress setting**, use the browser at
  [app.strandai.com/samples/upload](https://app.strandai.com/samples/upload).
  The browser uploader runs on your machine and does not use Claude's sandbox.
  This is the recommended path for multi-GB whole-slide images. After upload,
  use the connector to estimate, run, and read results.
</Tip>

## Authorization

The connector uses OAuth 2.1 with PKCE. A connection is scoped to one
organization and acts as you. Strand AI re-checks your grant, scopes, organization
membership, and object ownership on every request, and uses short-lived access
tokens throughout.

You can review or revoke a connection at any time from
[Settings, Connected Apps](https://app.strandai.com/settings/connected-apps) in
the Strand AI dashboard. Revoking takes effect immediately.

## Remote file transfer

Slide bytes are not sent to Claude or to the MCP server:

* **Upload**: `upload_slide` returns a presigned, resumable upload session (an
  upload id, upload URL, and structured transfer/network/processing metadata)
  bound to your organization's storage. A client that can make HTTP requests
  sends the slide bytes directly to that URL. GCS starts ingest preprocessing
  automatically when GCS commits the final PUT. Use `submit_run` with
  `dry_run: true` for the retryable readiness check. Automated
  de-identification is off by default and runs during ingest only when enabled
  for your organization. Clients with a restricted sandbox must allow the
  upload host, `storage.googleapis.com`. For a multi-GB slide, or to avoid the
  egress step entirely, upload in your browser at
  [app.strandai.com/samples/upload](https://app.strandai.com/samples/upload)
  instead. Browser upload runs independently from MCP upload sessions. Discover
  its resulting owned sample with `list_samples` or `get_sample`. For scripted
  or bulk uploads,
  use the [Python SDK](/sdks/python) or [REST API](/api/overview), which stream
  slides for you.
* **Download**: `download_results` takes the format you want. `ome-zarr`
  returns links to the stored result without conversion, so it is ready as soon
  as the job completes. `ome-zarr-zip` and `ome-tiff` are generated on demand:
  the first call starts the export and reports `pending` or `running`, and
  repeating the call polls it until a short-lived signed link appears. A large
  slide can take several minutes to render. You retrieve the bytes from storage
  yourself. They are not sent through Claude or the MCP server.

## Available tools

Read-only tools can run without a per-call prompt. Tools that write or spend ask
you to confirm in Claude.

| Tool               | Purpose                                                                                     | Confirmation |
| ------------------ | ------------------------------------------------------------------------------------------- | ------------ |
| `list_markers`     | List the markers your account can request (credit-free)                                     | read-only    |
| `list_samples`     | List owned samples, public samples, or both                                                 | read-only    |
| `get_sample`       | Read owned or public detail; owned detail includes job history                              | read-only    |
| `wait_for_job`     | Wait up to 240 seconds for a terminal or latest job status                                  | read-only    |
| `upload_slide`     | Create a presigned resumable upload session; ingest starts automatically after PUT          | prompts      |
| `patch_sample`     | Replace a sample's name, tags, or slide calibration                                         | prompts      |
| `segment_sample`   | Start/retry credit-free cell segmentation on an owned sample                                | prompts      |
| `submit_run`       | Estimate with `dry_run: true`, or reserve credits and create a job                          | prompts      |
| `cancel_job`       | Cancel an in-flight job and release its credit reservation                                  | prompts      |
| `download_results` | Select native OME-Zarr, OME-Zarr ZIP, or OME-TIFF plus optional H\&E/segmentation artifacts | prompts      |

`list_samples` defaults to active, non-trashed samples owned by the selected
organization. It can instead list the curated public cohort or combine both,
with owned items first and deduplicated. Every item has a canonical `id` and an
`ownership` discriminator. `get_sample` accepts either kind of ID; owned detail
includes current and historical jobs, while public detail contains only curated
public fields. Reads do not spend credits.

Sample results include a canonical absolute `app_url`. Use this value instead
of constructing a URL from the sample ID.

`patch_sample` replaces the complete requested name, tag set, or isotropic MPP
calibration. `segment_sample` starts or retries cell segmentation on an owned,
ready sample. It reserves no credits, reuses completed or in-flight work, and
leaves public samples untouched. `submit_run` with `dry_run: true` creates no
job and reserves no credits. Without that flag it reserves credits and starts
inference.
`wait_for_job` waits for at most 240 seconds. Completed, partially failed,
failed, and cancelled jobs return ordinary status results; a timeout leaves a
longer job running and returns its refreshed latest status so Claude can wait
again.

## Example prompts

* Upload my de-identified H\&E slide to Strand AI, dry-run a CD3e, CD8, and Ki67
  prediction, show me the credit estimate, and ask before submitting it.
* Read sample `SAMPLE_ID` and summarize its job history. If job `JOB_ID` is still
  running, wait for its latest status, then give me the OME-Zarr ZIP download link.
* Update sample `SAMPLE_ID` to 0.5 microns per pixel and tags `cohort-a` and
  `site-2`, then dry-run CD4 and FOXP3 before asking me to submit.

## Troubleshooting

* **Upload fails with `host_not_allowed`**: on claude.ai, add
  `storage.googleapis.com` under your organization's Settings, Capabilities,
  Allow network egress, then start a new chat and retry. An already-open
  conversation keeps the sandbox it started with, so the change does not reach
  it. The upload session stays valid.
* **Authorization fails**: reconnect Strand AI and select an organization where
  your account is still a member.
* **Your existing connector shows the wrong scopes or permissions**: delete the
  connector and add it again. Reconnecting reuses the registration Claude
  already holds, so only removing the connector forces a fresh one.
* **Upload remains `not_ready`**: keep the returned `upload_id` and retry
  `submit_run` with `dry_run: true` after its suggested interval. If the upload reports
  `upload_failed`, create a new `upload_slide` session and re-send the complete
  file. The [Python SDK](/sdks/python) handles this readiness wait for you.
* **Insufficient credits on submit**: choose a funded organization, or ask its
  Strand AI administrator to add credits.
* **Result link expired**: ask Claude to run `download_results` again with the
  same format. Signed links are short-lived. The server reuses a cached export
  instead of rendering it again.
* **An export stays `pending` or `running`**: `ome-zarr-zip` and `ome-tiff` are
  rendered on demand and a large slide takes minutes. Ask Claude to check again.
  For the fastest path, request `ome-zarr`, which does not require conversion.

For unresolved connector issues, email
[support@strandai.com](mailto:support@strandai.com) with the job or sample ID.
Do not include slide data or credentials.

## Data handling

<Warning>
  Research use only (RUO). Not for use in clinical or diagnostic procedures.
</Warning>

**Slides must be de-identified before upload.** Do not upload protected health
information or other regulated health data, and upload only data you are
authorized to process. Organization retention settings and your Strand AI
agreement govern uploaded data and results. See the [Strand AI Privacy
Policy](https://strandai.com/privacy) and [Security and data
handling](/security-data-handling). Report suspected security issues to
[security@strandai.com](mailto:security@strandai.com).
