Metadata-Version: 2.4
Name: crc-lnm-medical-agent
Version: 1.0.10
Summary: Containerized CRC-LNM research-assistance MCP for Nexent
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: mcp[cli]<2,>=1.27
Requires-Dist: numpy<3,>=2.1
Requires-Dist: pandas<3,>=2.2
Requires-Dist: pydantic<3,>=2.11
Requires-Dist: pyyaml<7,>=6
Requires-Dist: scikit-learn<2,>=1.6
Requires-Dist: imbalanced-learn<1,>=0.13
Requires-Dist: jinja2<4,>=3.1
Requires-Dist: torch<3,>=2.9
Requires-Dist: starlette<1,>=0.40
Requires-Dist: uvicorn[standard]<1,>=0.30
Provides-Extra: mcp
Requires-Dist: mcp[cli]<2,>=1.27; extra == "mcp"
Requires-Dist: numpy<3,>=2.1; extra == "mcp"
Requires-Dist: pandas<3,>=2.2; extra == "mcp"
Requires-Dist: pydantic<3,>=2.11; extra == "mcp"
Requires-Dist: pyyaml<7,>=6; extra == "mcp"
Requires-Dist: scikit-learn<2,>=1.6; extra == "mcp"
Requires-Dist: imbalanced-learn<1,>=0.13; extra == "mcp"
Requires-Dist: jinja2<4,>=3.1; extra == "mcp"
Requires-Dist: torch<3,>=2.9; extra == "mcp"
Provides-Extra: validation
Requires-Dist: httpx<1,>=0.28; extra == "validation"
Requires-Dist: mypy<2,>=1.17; extra == "validation"
Requires-Dist: psutil<8,>=7; extra == "validation"
Requires-Dist: pytest<9,>=8.3; extra == "validation"
Requires-Dist: pytest-cov<7,>=6; extra == "validation"
Requires-Dist: ruff<1,>=0.12; extra == "validation"
Requires-Dist: types-PyYAML<7,>=6.0.12; extra == "validation"

# CRC-LNM Multimodal Research Assistant MCP

This MCP server provides a six-tool, research-assistance workflow for allowlisted,
deidentified CRC-LNM cases. It accepts only precomputed 1409-dimensional CT features,
768-dimensional pathology features, and four clinical values. It does not accept raw
imaging files, file paths, or external feature vectors.

---

## ModelScope STDIO Deployment (Quick Start)

### Step 1: Select Service Type

**Select "STDIO"** (NOT "Streamable HTTP")

### Step 2: Fill These Fields Separately

| Field Name | Value to Enter |
|------------|----------------|
| **Command / 命令** | `uvx` |
| **Argument 1 / 参数1** | `crc-lnm-medical-agent@1.0.10` |
| **Argument 2 / 参数2** | `--transport` |
| **Argument 3 / 参数3** | `stdio` |

### Step 3: Set Environment Variable

Find the environment variable field and add:

```
UV_TORCH_BACKEND=cpu
```

### Step 4: Deploy

Click deploy and wait for `list_tools` to complete with 6 tools.

---

## Verification Order

1. Build and inspect the wheel, then run the console entry point from an unrelated
   working directory.
2. Publish the verified wheel to PyPI and start it with the exact `uvx` command above.
3. Let ModelScope complete `list_tools`, then manually test each required tools.
4. Obtain the ModelScope URL, add it as a Nexent custom MCP service, enable the six
   tools, debug the agent, and verify a post-publication question.

## Technical Reference

### MCP Server Configuration

```json
{
  "mcpServers": {
    "crc-lnm-research-assistant": {
      "command": "uvx",
      "args": [
        "crc-lnm-medical-agent@1.0.10",
        "--transport",
        "stdio"
      ],
      "env": {
        "UV_TORCH_BACKEND": "cpu"
      }
    }
  }
}
```

### Why `UV_TORCH_BACKEND=cpu`?

Required so the hosted Linux installation resolves CPU PyTorch packages instead of
CUDA runtime packages.

### Why STDIO?

The published wheel contains the immutable model bundle and trusted release JSONL.
On first launch it creates a verified case-package cache and transient artifacts in a
writable system cache directory. No local path argument is required.

`docs/PLATFORM_DEPLOYMENT.md` covers the separate authenticated Streamable HTTP
container path. `使用说明.md` documents the local release workflow and constraints.
