Skip to content

Commit de1af4b

Browse files
authored
Dev/tools logging (#120)
* add table analysis tools * fix crossval and train config * make log debug to avoid flooding * run stamp in same process * update heatmaps config validations * improve list files and heatmaps tools * make max_items a global variable * update README.md * reformat * add external path lists * add stamp logs after execution * add realtime STAMP logs * add logging to remaining tools * improve path solver
1 parent 9402ed5 commit de1af4b

File tree

4 files changed

+457
-106
lines changed

4 files changed

+457
-106
lines changed

mcp/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
# STAMP MCP Server
22

3-
A FastMCP-based Model Context Protocol server wrapping [STAMP](https://github.com/KatherLab/STAMP)’s CLI, enabling seamless integration of STAMP preprocessing, training, encoding, evaluation, and inference into LLM-based pipelines.
3+
A FastMCP-based Model Context Protocol server wrapping [STAMP](https://github.com/KatherLab/STAMP)'s tools, enabling seamless integration of STAMP preprocessing, training, encoding, evaluation, and inference into LLM-based pipelines.
44

55
## Overview
66

77
This server lets LLM agents invoke STAMP tools via structured calls. It exposes the following tools:
88

9-
- `preprocess_stamp(...)`: tile & extract WSI features
10-
- `train_stamp(...)`: train weakly supervised models
11-
- `crossval_stamp(...)`: k-fold cross‑validation
12-
- `deploy_stamp(...)`: inference on held‑out data
13-
- `encode_slides_stamp(...)`: slide-level feature encoding
14-
- `encode_patients_stamp(...)`: patient-level feature encoding
15-
- `heatmaps_stamp(...)`: model-based heatmap visualization
16-
- `statistics_stamp(...)`: compute classification metrics
17-
- `read_file(...)` & `list_files(...)`: safe disk access
18-
- `check_available_devices()`: query Torch/Platform device availability
19-
20-
Each tool serializes config into YAML, launches `stamp <mode>`, streams logs back, and returns stdout/stderr.
9+
- `preprocess_stamp()`: tile & extract WSI features
10+
- `train_stamp()`: train weakly supervised models
11+
- `crossval_stamp()`: k-fold cross‑validation
12+
- `deploy_stamp()`: inference on held‑out data
13+
- `encode_slides_stamp()`: slide-level feature encoding
14+
- `encode_patients_stamp()`: patient-level feature encoding
15+
- `heatmaps_stamp()`: model-based heatmap visualization
16+
- `statistics_stamp()`: compute classification metrics
17+
- `read_file()` & `list_files()`: safe disk access
18+
- `check_available_devices()`: query Torch/Platform device availability
19+
- `analyze_csv()` & `list_column_values`: useful for clinical and slide tables
20+
21+
Each tool serializes config into YAML and directly calls STAMP's internal `_run_cli()` function, streaming logs back in real-time and returning execution results.
2122

2223
## Installation
2324
To run the MCP server is as simple as intalling STAMP as it is explained in the main README.md file, but adding `--extra mcp` to the command. For a GPU repository installation it would be like this:

0 commit comments

Comments
 (0)