Skip to main content

strand-mcp

MCP server for the Strand Platform. Exposes upload / estimate / predict / job-lifecycle as MCP tools so any agent (Claude Code, Cursor, etc.) can run H&E → spatial-proteomics inference end-to-end.

Install

pip install strand-mcp

Or from this repo:

cd sdks/mcp-server
pip install -e .

Auth

Generate an API key at https://app.strandai.com/settings/api-keys and export it:

export STRAND_API_KEY=sk-strand-...

The server also reads STRAND_BASE_URL (defaults to https://app.strandai.com) if you need to point at staging.

The hosted service uses Strand OAuth instead of STRAND_API_KEY. Its Streamable HTTP endpoint validates an opaque, audience-bound access token via the platform's workload-authenticated introspection endpoint, then forwards that user token through the SDK. The platform alone can invoke Hydra's private admin service; the public MCP workload cannot. The remote catalog mirrors all nine stdio capabilities. upload_slide returns a secure browser handoff instead of accepting a Cloud Run filesystem path; both download tools return short-lived signed artifact links. The stdio catalog below is unchanged.

Operator entry point: strand-mcp-http. Required settings are STRAND_MCP_RESOURCE_URL, STRAND_OAUTH_ISSUER_URL, STRAND_OAUTH_INTROSPECTION_URL (the platform's narrow internal endpoint), and in Cloud Run STRAND_OAUTH_INTROSPECTION_AUDIENCE. Host/origin allowlists use STRAND_MCP_ALLOWED_HOSTS and STRAND_MCP_ALLOWED_ORIGINS.

Wire into Claude Code

Add to ~/.claude/mcp.json (or your project's .mcp.json):

{
  "mcpServers": {
    "strand": {
      "command": "strand-mcp",
      "env": {
        "STRAND_API_KEY": "sk-strand-..."
      }
    }
  }
}

Then in Claude Code you can ask things like:

Upload ~/slides/biopsy.svs to Strand, run prediction for CD3, CD8, and Ki67, wait for the job, and download results into ~/results/.

Claude calls the tools in sequence — no glue code needed.

Tools

Tool Purpose
upload_slide Upload a local WSI; returns upload_id + dimensions
estimate_run Patch count + credit cost for a (upload_id, markers) pair
set_sample_mpp Set user-reported slide microns per pixel before inference
submit_run Kick off a Lattice inference job; returns job_id
get_job Point-in-time status snapshot
cancel_job Cancel an in-flight job and refund its reserved credits
wait_for_job Block until terminal state (uses SSE under the hood)
download_results Pull OME-Zarr results into a local directory
download_ome_tiff Render and download a completed job as a single OME-TIFF file

Smoke test

STRAND_API_KEY=sk-strand-... strand-mcp

The server listens on stdio and waits for an MCP client to attach.

Dev

cd sdks/mcp-server
pip install -e ".[dev]" || pip install -e .
python -m strand_mcp

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strand_mcp-0.2.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strand_mcp-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file strand_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: strand_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strand_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 51b1cb847d1e25a169f649559a1e1edcdd6f27c742bbe977a60bc6fca23e2a45
MD5 08303811b5e8eaf096bce9b01158f30b
BLAKE2b-256 2da4e11778d99634ed3d905f33054ddb43e69d1f83dd55dcb56aac6322282888

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_mcp-0.2.0.tar.gz:

Publisher: sdks-publish.yml on Strand-AI/strand-official

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file strand_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: strand_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strand_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9394425d8f1ddba2eb260479ebdb1a5ee4340697698ae0617a8c38e39b0c77f4
MD5 88dbfca74a228ed88275d320da3d4ad8
BLAKE2b-256 56b6ebf27693120f53f94061e4e60be29d9fda955d158631784e2128bf173602

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_mcp-0.2.0-py3-none-any.whl:

Publisher: sdks-publish.yml on Strand-AI/strand-official

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page