Harmony Remote Tool (MCP Server)#
TOU validation and deployment status (2026-08-16)#
Harmony 2.0, loopback discovery/call, and invalid-input checks passed; the deterministic two-batch call returned an aligned finite 240 x 10 embedding. Public publication, cross-user isolation, representative correction accuracy, broad concurrency, and recovery remain incomplete. Authenticated private Platform import and owner testing passed on 2026-08-16; public publication and independent-caller authorization/isolation remain untested.
Operation:
run_harmony_integrateStart:
python -m tooluniverse.remote.harmony.harmony_toolEndpoint:
http://127.0.0.1:8026/mcpProvider configuration: set
TOOLUNIVERSE_REMOTE_DATA_ROOTto the provider-owned H5AD root;batch_keymust exist inobs.TOU check:
tu doctor --forward http://127.0.0.1:8026/mcp --jsonPrivate relay:
tu serve --share --forward http://127.0.0.1:8026/mcp --name validation-harmony --workers 1
Non-loopback binding requires TOOLUNIVERSE_API_TOKEN; otherwise keep the server on loopback. The relay requires TOOLUNIVERSE_SERVICE_KEY. Public publication and independent-caller testing were not run.
New-user check: python scripts/remote_validation/setup_skill_preflight.py --implementation harmony. Add --check-provider-env before launch, --live after launch, and --check-connect-prereqs before sharing. Live preflight checks exact MCP discovery only; it does not run or validate a model. The pinned relay SDK is not on PyPI and currently requires authorized GitHub repository access plus a configured SSH key, so a working local MCP server does not by itself prove that a new operator can share it.
The authenticated 2026-08-16 Platform matrix found all 30 private owner relays online and all 41 operations discoverable. This implementation was imported as unpublished owner draft(s), configured with a 120-second timeout, and invoked through /expert-sessions/{id}/test. Across the set, 38 unique operations passed return-schema and semantic validation; the three USPTO operations returned exact provider HTTP 403 and remain credential-blocked. Public publication, independent-caller authorization/isolation, broad saturation, and persistent supervision were not tested.
See the complete setup and verification guide.
Serves Harmony (Korsunsky et al., Nature Methods 2019) — the default single-cell batch-integration baseline — as a ToolUniverse remote tool: run_harmony_integrate (batch-corrected PCA embedding).
Harmony corrects batch/sample effects on a low-dimensional PCA embedding via iterative batch-aware soft clustering and linear correction. The corrected embedding (X_pca_harmony) is the standard input to neighbor graphs / clustering / UMAP. It is fast and CPU-friendly even on large datasets.
Served remotely (not bundled) because it pulls in harmonypy + scanpy/anndata.
Deploy#
pip install -r requirements.txt # harmonypy + scanpy
python harmony_tool.py # starts the MCP server on 127.0.0.1:8026
Inputs are referenced by adata_path (a server-accessible .h5ad AnnData),
since single-cell matrices are large. If obsm['X_pca'] is already present it
is reused; otherwise PCA is computed (log-normalizing first when the matrix
looks like raw counts). Expose remotely only behind TOOLUNIVERSE_API_TOKEN
(SMCP bind guard).
Register in ToolUniverse#
Tool definition: src/tooluniverse/data/remote_tools/harmony_tools.json
(type: RemoteTool). Connect via the standard MCPAutoLoaderTool/server_url
mechanism.