Metadata-Version: 2.4
Name: mcp-server-pp
Version: 1.1.4
Summary: MCP server for PharmaPendium data extraction — converts extraction results to XLSX, expands drug/concomitant rows, and uploads to Azure Blob Storage
Author: ELS-RJED Team
License-Expression: MIT
License-File: LICENSE
Keywords: excel,extraction,mcp,pharmacokinetic,pharmapendium,xlsx
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: azure-storage-blob>=12.19.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: pandas>=2.0.0
Description-Content-Type: text/markdown

# mcp-server-pp

MCP server for PharmaPendium data extraction — converts extraction results to XLSX, expands drug/concomitant rows, and uploads to Azure Blob Storage.

## Tools

### `save_extraction`

Converts a JSON array of extraction results into an XLSX file, uploads it to Azure Blob Storage, and returns a download URL (valid 7 days).

If the user provided corrections or new rules during the extraction session, pass them in `notes` — they are saved as a separate **Notes** sheet inside the XLSX for traceability.

**Parameters:**
- `json_data` (required): JSON array string — extraction results, one object per row
- `file_name` (optional): Output filename (with or without `.xlsx`). Defaults to `extraction_results.xlsx`
- `notes` (optional): User corrections, comments, or new rules applied in this session

### `expand_concomitants`

Takes an XLSX file with `Drug Name` and `Concomitants` columns, expands each row so every drug in the combined list gets its own row (rotating through the `Drug Name` slot while the rest fill `Concomitants`), uploads the result to Azure Blob Storage, and returns a download URL (valid 7 days).

**Parameters:**
- `xlsx_base64` (required): Base64-encoded XLSX file content
- `file_name` (optional): Output filename (with or without `.xlsx`). Defaults to `expanded_results.xlsx`

**Example — one source row becomes three:**

| Drug Name | Concomitants  |
|-----------|---------------|
| DrugA     | DrugB, DrugC  |

→

| Drug Name | Concomitants  |
|-----------|---------------|
| DrugA     | DrugB, DrugC  |
| DrugB     | DrugA, DrugC  |
| DrugC     | DrugA, DrugB  |

**Required environment variable:** `AZURE_STORAGE_CONNECTION_STRING`

## Usage

### With uvx (no installation needed)

```bash
uvx mcp-server-pp@1.1.3
```

### MCP client config (e.g. Codemie, Claude Desktop)

```json
{
  "mcpServers": {
    "pp-tools": {
      "command": "uvx",
      "args": ["mcp-server-pp@1.1.1"],
      "env": {
        "AZURE_STORAGE_CONNECTION_STRING": "${AZURE_STORAGE_CONNECTION_STRING}"
      }
    }
  }
}
```
