icb-agent-server
README.md
# ICB-Agent
**An MCP server and benchmark that let LLM agents such as Claude query harmonized single-cell data from patients treated with immune checkpoint blockade (ICB), and that measure how well those agents answer response-prediction questions.**
ICB-Agent is built on the atlas released with
[Gondal et al., *Scientific Data* (2025)](https://doi.org/10.1038/s41597-025-04381-6) and hosted on
[CELLxGENE](https://cellxgene.cziscience.com/collections/61e422dd-c9cd-460e-9b91-72d9517348ef). The atlas covers:
- 8 studies and 9 cancer types
- 167 patients with cells in the CELLxGENE release
- about 356,000 cells
- harmonized cell types, pre- and post-treatment samples, and outcomes labelled Favourable or Unfavourable
It has two parts:
1. **`icb-agent-server`**: an MCP server with 9 tools covering cohorts, cell types, donors, gene search, gene-versus-response tests, signature scoring, composition tests, gene ranking and donor profiles. It works with Claude Desktop, Claude Code and any other MCP client.
2. **ICB-Bench**: 24 tasks in five categories (lookup, aggregate, biology, robustness, predict). It includes an agent runner that uses the Anthropic API, and a scorer.
## Quickstart
```bash
git clone https://github.com/MahnoorNGondal/icb-agent && cd icb-agent
pip install -e ".[eval,dev]"
icb-agent-build # downloads the ~3 GB H5AD from CELLxGENE and builds a small donor-level cache in data/cache
pytest -q # tests run on a synthetic atlas and need no download
```
The data is not stored in this repository. `icb-agent-build` downloads it from CELLxGENE, where it is published under CC BY 4.0.
## Use it from Claude Desktop
Add the following to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"icb-agent": {
"command": "icb-agent-server",
"env": {"ICB_DATA_DIR": "/absolute/path/to/icb-agent/data"}
}
}
}
```
Then ask questions such as:
- *"Is MHC class I expression in pre-treatment tumour cells associated with response, and does it replicate across studies?"*
- *"Which cell types are enriched in responders before treatment?"*
For Claude Code, run:
```bash
claude mcp add icb-agent -- icb-agent-server
```
## How the data is modelled
The tools never touch the cell-level matrix while answering a question. `icb-agent-build` reads the H5AD once in backed mode and aggregates it into **pseudobulk**, the mean expression for each combination of donor, timepoint and cell type. The result takes a few MB, so every tool call returns in under a second.
Each statistic is computed **per study at the donor level**. This means that:
- donors are the unit of analysis, not cells, which avoids pseudoreplication;
- batch and cohort effects are never pooled together.
For each study, a tool reports:
- the Favourable-versus-Unfavourable **AUC**;
- a two-sided Mann–Whitney p-value, not corrected for multiple testing;
- the mean AUC across studies, as a simple measure of whether a result replicates.
## ICB-Bench
| Category | Tasks | What it tests | Scoring |
|---|---|---|---|
| lookup | 10 | Finding facts in the atlas (counts, studies, treatments) | exact match |
| aggregate | 3 | Combining information across donors and studies | exact match |
| biology | 7 | Testing hypotheses about antigen presentation, IFN-γ signalling, B cells and PD-L1 against outcome | exact match or Jaccard |
| robustness | 2 | Checking whether a finding replicates across studies | exact match |
| predict | 2 | Predicting the response of held-out patients using leave-one-study-out | AUC |
**The gold answers are computed from the data, not written by hand.** `icb-bench build` writes `bench/tasks.json` and `bench/gold.json`, and every gold answer is produced by a small, readable function in `icb_agent/bench.py`, so it can be audited. A task is skipped if it cannot be computed on the version of the data you downloaded.
**Prediction tasks hide the labels.** For each prediction task, every outcome in the held-out study is masked inside every tool. The agent has to learn which features matter from the other studies and then score the hidden patients. Scoring uses the true labels through the AUC.
**The tasks were designed by the author**, a computational biologist who built the atlas. They are meant to be reviewed and extended: add a `Task(...)` to `TASKS` and rebuild.
Run an evaluation (this needs `ANTHROPIC_API_KEY` in your environment):
```bash
icb-bench build
icb-bench eval --model claude-sonnet-5-5 # agent with the atlas tools
icb-bench eval --model claude-sonnet-5-5 --no-tools # baseline without tools
```
Results are written to `bench/results/`: a CSV with one row per task, plus the full transcripts.
### Results
*Not yet run. This section will hold a table comparing the tools and no-tools conditions across models.*
## Citation
If you use the atlas, please cite:
> Gondal, M. N., Cieslik, M. & Chinnaiyan, A. M. Integrated cancer cell-specific single-cell RNA-seq datasets of immune checkpoint blockade-treated patients. *Scientific Data* 12 (2025). https://doi.org/10.1038/s41597-025-04381-6
## License
The code is released under the MIT licence. The data is released under CC BY 4.0 by its original authors and is downloaded from CELLxGENE, not redistributed here.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues