diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_server.py new file mode 100644 index 0000000000000000000000000000000000000000..9ae9e348024db3cb06b98df213b4e1e8efdb2444 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_server.py @@ -0,0 +1,197 @@ +from __future__ import annotations + +import subprocess +import tempfile +from pathlib import Path +from typing import List, Literal, Optional + +# MCP decorator is not imported as per instructions. +# It is assumed to be available in the execution environment. + +# @mcp.tool() +def celltypist_predict( + indata: Path, + model: Optional[str] = None, + transpose_input: bool = False, + gene_file: Optional[Path] = None, + cell_file: Optional[Path] = None, + mode: Literal["best_match", "prob_match"] = "best_match", + p_thres: float = 0.5, + majority_voting: bool = False, + over_clustering: str = "auto", + use_gpu: bool = False, + min_prop: float = 0.0, + outdir: Optional[Path] = None, + prefix: Optional[str] = None, + xlsx: bool = False, + plot_results: bool = False, + quiet: bool = False, +) -> dict: + """ + Run Celltypist for semi-automatic cell type annotation on a given count matrix. + + Args: + indata: Path to the input count matrix (.csv/txt/tsv/tab/mtx) or AnnData (.h5ad). + model: Model used for predictions. Defaults to 'Immune_All_Low.pkl'. + transpose_input: Transpose the input matrix if it is in gene-by-cell format. + gene_file: Path to a file with one gene per line for mtx input. + cell_file: Path to a file with one cell per line for mtx input. + mode: Prediction mode, 'best_match' or 'prob_match'. + p_thres: Probability threshold for 'prob_match' mode. + majority_voting: Refine predicted labels by majority voting after over-clustering. + over_clustering: Input for over-clustering. Can be a file path or a string key. + use_gpu: Use GPU for over-clustering. Requires rapids-singlecell. + min_prop: Minimum proportion of cells for naming a subcluster in majority voting. + outdir: Directory to store output files. A temporary directory is used if not provided. + prefix: Prefix for output files. + xlsx: Merge output tables into a single Excel (.xlsx) file. + plot_results: Generate plots for the prediction results. + quiet: Hide banner and configuration information during the run. + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of output files. + """ + # 1. Input validation + if not indata.is_file(): + raise FileNotFoundError(f"Input data file not found: {indata}") + if gene_file and not gene_file.is_file(): + raise FileNotFoundError(f"Gene file not found: {gene_file}") + if cell_file and not cell_file.is_file(): + raise FileNotFoundError(f"Cell file not found: {cell_file}") + if not (0.0 <= p_thres <= 1.0): + raise ValueError(f"p_thres must be between 0.0 and 1.0, but got {p_thres}") + if not (0.0 <= min_prop <= 1.0): + raise ValueError(f"min_prop must be between 0.0 and 1.0, but got {min_prop}") + + # 2. Command construction and output directory handling + with tempfile.TemporaryDirectory() as temp_dir: + if outdir is None: + run_outdir = Path(temp_dir) + else: + run_outdir = outdir + run_outdir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "celltypist", + "--indata", str(indata), + "--outdir", str(run_outdir), + ] + + if model: + cmd.extend(["--model", model]) + if transpose_input: + cmd.append("--transpose-input") + if gene_file: + cmd.extend(["--gene-file", str(gene_file)]) + if cell_file: + cmd.extend(["--cell-file", str(cell_file)]) + + cmd.extend(["--mode", mode]) + if mode == "prob_match": + cmd.extend(["--p-thres", str(p_thres)]) + + if majority_voting: + cmd.append("--majority-voting") + cmd.extend(["--over-clustering", over_clustering]) + if use_gpu: + cmd.append("--use-GPU") + cmd.extend(["--min-prop", str(min_prop)]) + + if prefix: + cmd.extend(["--prefix", prefix]) + if xlsx: + cmd.append("--xlsx") + if plot_results: + cmd.append("--plot-results") + if quiet: + cmd.append("--quiet") + + # 3. Subprocess execution and error handling + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + encoding='utf-8' + ) + stdout = process.stdout + stderr = process.stderr + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(map(str, cmd)), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + # 4. Collect and return structured output + output_files = [str(f) for f in run_outdir.glob("**/*") if f.is_file()] + + return { + "command_executed": " ".join(map(str, cmd)), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files + } + +# @mcp.tool() +def celltypist_show_models() -> dict: + """ + Show all available Celltypist models and their descriptions. + + Returns: + A dictionary containing the executed command, stdout, and stderr. + """ + cmd = ["celltypist", "--show-models"] + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + encoding='utf-8' + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + +# @mcp.tool() +def celltypist_update_models() -> dict: + """ + Download the latest Celltypist models from the remote server. + + Returns: + A dictionary containing the executed command, stdout, and stderr. + """ + cmd = ["celltypist", "--update-models"] + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + encoding='utf-8' + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..4afc15a94667a9acf8cc2a351856dca78e9ea73c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/app/celltypist_server.py') +SERVER_NAME = 'biosci_celltypist' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f53b5ace39885ced50106457777cf126f3ad6e2a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-celltypist: + build: . + image: mcp-celltypist:latest + container_name: mcp-celltypist + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=celltypist + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76e5dc75e1be1d91d909773c3edf8379d5a6bebb --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - celltypist + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_celltypist/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..45c89e56842a0ba01a9945a2c6d554a3e8e2998e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install circos via conda (e.g., from bioconda) +RUN conda install -c bioconda circos -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/circos_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/circos_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/circos_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_server.py new file mode 100644 index 0000000000000000000000000000000000000000..831f111c9abfaf119dee6b61d193a7e5d216bbb2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_server.py @@ -0,0 +1,252 @@ +import subprocess +import tempfile +import re +from pathlib import Path +from typing import Optional, List, Dict, Any + +# This is a mock decorator. In a real MCP environment, this would be provided by the mcp package. +class mcp: + @staticmethod + def tool(func): + return func + +@mcp.tool +def circos_run( + conf: Path, + outputfile: Optional[str] = None, + outputdir: Optional[Path] = None, + debug: bool = False, + debug_group: Optional[str] = None, + cdump: bool = False, + mdump: bool = False, + userconf: Optional[Path] = None, + params: Optional[List[str]] = None, + nosvg: bool = False, + nopng: bool = False, +) -> Dict[str, Any]: + """ + Generates a Circos plot from a configuration file. + + This is the main tool for creating visualizations. It takes a configuration + file and various command-line overrides to produce PNG and/or SVG images. + It can also be used to dump configuration for debugging purposes. + + Args: + conf: The main Circos configuration file. + outputfile: The name of the output image file. + outputdir: The directory where the output files will be saved. + debug: Enable debugging output for all groups. + debug_group: Debug a specific group (e.g., 'summary', 'ideogram'). + cdump: Dump the parsed configuration and exit. + mdump: Dump the module configuration and exit. + userconf: Provide an additional user configuration file. + params: A list of 'key=value' strings to override configuration parameters. + nosvg: Disable SVG output. + nopng: Disable PNG output. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # Input validation + if not conf.is_file(): + raise FileNotFoundError(f"Configuration file not found: {conf}") + if userconf and not userconf.is_file(): + raise FileNotFoundError(f"User configuration file not found: {userconf}") + if params: + for p in params: + if not re.match(r"^\S+=\S+$", p): + raise ValueError(f"Invalid parameter format: '{p}'. Expected 'key=value'.") + + cmd = ["circos"] + cmd.extend(["-conf", str(conf)]) + + if outputfile: + cmd.extend(["-outputfile", outputfile]) + if outputdir: + outputdir.mkdir(parents=True, exist_ok=True) + cmd.extend(["-outputdir", str(outputdir)]) + if debug: + cmd.append("-debug") + if debug_group: + cmd.extend(["-debug_group", debug_group]) + if cdump: + cmd.append("-cdump") + if mdump: + cmd.append("-mdump") + if userconf: + cmd.extend(["-userconf", str(userconf)]) + if params: + for p in params: + cmd.extend(["-param", p]) + if nosvg: + cmd.append("-nosvg") + if nopng: + cmd.append("-nopng") + + command_executed = " ".join(cmd) + + try: + if outputdir: + work_dir = outputdir + result = subprocess.run( + cmd, capture_output=True, text=True, check=True, cwd=work_dir + ) + # Scan the specified output directory for generated files + output_files = [str(p) for p in work_dir.glob("*.*")] + else: + with tempfile.TemporaryDirectory() as temp_dir: + work_dir = Path(temp_dir) + result = subprocess.run( + cmd, capture_output=True, text=True, check=True, cwd=work_dir + ) + # Scan the temporary directory for generated files + output_files = [str(p) for p in work_dir.glob("*.*")] + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": sorted(list(set(output_files))) + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + "output_files": [] + } + +@mcp.tool +def circos_list_colors() -> Dict[str, Any]: + """Lists all available colors in Circos.""" + cmd = ["circos", "-colorlist"] + command_executed = " ".join(cmd) + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + } + +@mcp.tool +def circos_list_fonts() -> Dict[str, Any]: + """Lists all available fonts in Circos.""" + cmd = ["circos", "-fontlist"] + command_executed = " ".join(cmd) + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + } + +@mcp.tool +def circos_list_items(item_type: str) -> Dict[str, Any]: + """ + Lists available items of a given type (e.g., 'ideogram', 'highlight'). + + Args: + item_type: The type of item to list (e.g., ideogram, highlight, plot, link, rule). + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + if not item_type: + raise ValueError("item_type cannot be empty.") + + cmd = ["circos", "-list", item_type] + command_executed = " ".join(cmd) + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + } + +@mcp.tool +def circos_show_rules(conf: Path) -> Dict[str, Any]: + """ + Shows the evaluation of rules for a given configuration. + + Args: + conf: The Circos configuration file to evaluate rules against. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + if not conf.is_file(): + raise FileNotFoundError(f"Configuration file not found: {conf}") + + cmd = ["circos", "-rules", "-conf", str(conf)] + command_executed = " ".join(cmd) + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + } + +@mcp.tool +def circos_version() -> Dict[str, Any]: + """Shows the Circos version number.""" + cmd = ["circos", "-version"] + command_executed = " ".join(cmd) + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise RuntimeError("circos command not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Circos failed with exit code {e.returncode}", + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..fd8646e0de45a72fbb7f3a5193f462191f56a6f6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/circos_server.py') +SERVER_NAME = 'biosci_circos' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..e0915b2a07ecf606bcc406087ff447720f8b025a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-circos: + build: . + image: mcp-circos:latest + container_name: mcp-circos + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=circos + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e8a3b56643b3d7d712ea5502944fe3da58e4763a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - circos + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_circos/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..eb716cc02b3ed82157b190e6ce990aac387b416d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install clustalo via conda (e.g., from bioconda) +RUN conda install -c bioconda clustalo -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/clustalo_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/clustalo_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/clustalo_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d5d795b1d238f3423c77135f6187db740833b499 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_server.py @@ -0,0 +1,248 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Literal + +# @mcp.tool() decorator would be here in a real MCP environment +def clustalo( + infile: Path, + outfile: Optional[Path] = None, + hmm_in: Optional[List[Path]] = None, + hmm_batch: Optional[Path] = None, + dealign: bool = False, + profile1: Optional[Path] = None, + profile2: Optional[Path] = None, + is_profile: bool = False, + seqtype: Optional[Literal["Protein", "RNA", "DNA"]] = None, + infmt: Optional[Literal["a2m", "fasta", "fa", "sta", "clustal", "clu", "msf", "phylip", "phy", "selex", "stockholm", "st", "vienna", "vie"]] = None, + distmat_in: Optional[Path] = None, + distmat_out: Optional[Path] = None, + guidetree_in: Optional[Path] = None, + guidetree_out: Optional[Path] = None, + pileup: bool = False, + full: bool = False, + full_iter: bool = False, + cluster_size: Optional[int] = None, + clustering_out: Optional[Path] = None, + trans: int = 0, + posterior_out: Optional[Path] = None, + use_kimura: bool = False, + percent_id: bool = False, + outfmt: Literal["a2m", "fasta", "fa", "sta", "clustal", "clu", "msf", "phylip", "phy", "selex", "stockholm", "st", "vienna", "vie"] = "fasta", + residuenumber: bool = False, + wrap: Optional[int] = None, + output_order: Optional[Literal["input-order", "tree-order"]] = None, + iterations: Optional[int] = None, + max_guidetree_iterations: Optional[int] = None, + max_hmm_iterations: Optional[int] = None, + maxnumseq: Optional[int] = None, + maxseqlen: Optional[int] = None, + auto: bool = False, + threads: Optional[int] = None, + pseudo: Optional[Path] = None, + log: Optional[Path] = None, + verbose: int = 0, + force: bool = False, + mac_ram: Optional[int] = None, +): + """ + Run Clustal Omega for multiple sequence alignment. + + Clustal Omega is a fast, scalable tool for generating high-quality protein + and nucleic acid multiple sequence alignments. + + Args: + infile: Multiple sequence input file. + outfile: Multiple sequence alignment output file (default: stdout). + hmm_in: HMM input files. + hmm_batch: Specify HMMs for individual sequences. + dealign: Dealign input sequences. + profile1: Pre-aligned multiple sequence file (aligned columns will be kept fixed). + profile2: Pre-aligned multiple sequence file (aligned columns will be kept fixed). + is_profile: Disable check if profile, force profile (default: False). + seqtype: Force a sequence type (default: auto). + infmt: Forced sequence input file format (default: auto). + distmat_in: Pairwise distance matrix input file (skips distance computation). + distmat_out: Pairwise distance matrix output file. + guidetree_in: Guide tree input file (skips guide-tree clustering step). + guidetree_out: Guide tree output file. + pileup: Sequentially align sequences. + full: Use full distance matrix for guide-tree calculation (default: mBed). + full_iter: Use full distance matrix for guide-tree calculation during iteration (default: mBed). + cluster_size: Soft maximum of sequences in sub-clusters. + clustering_out: Clustering output file. + trans: Use transitivity (default: 0). + posterior_out: Posterior probability output file. + use_kimura: Use Kimura distance correction for aligned sequences (default: False). + percent_id: Convert distances into percent identities (default: False). + outfmt: MSA output file format (default: fasta). + residuenumber: In Clustal format, print residue numbers (default: False). + wrap: Number of residues before line-wrap in output. + output_order: MSA output order like in input/guide-tree. + iterations: Number of (combined guide-tree/HMM) iterations. + max_guidetree_iterations: Maximum number of guidetree iterations. + max_hmm_iterations: Maximum number of HMM iterations. + maxnumseq: Maximum allowed number of sequences. + maxseqlen: Maximum allowed sequence length. + auto: Set options automatically (might overwrite some of your options). + threads: Number of processors to use. + pseudo: Input file for pseudo-count parameters. + log: Log all non-essential output to this file. + verbose: Verbose output level (e.g., 1 for -v, 2 for -vv). + force: Force file overwriting. + mac_ram: Set a memory limit (undocumented, platform-specific). + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # --- Input Validation --- + if not infile.is_file(): + raise FileNotFoundError(f"Input file not found: {infile}") + + input_files_to_check = { + "hmm_batch": hmm_batch, + "profile1": profile1, + "profile2": profile2, + "distmat_in": distmat_in, + "guidetree_in": guidetree_in, + "pseudo": pseudo, + } + for name, path in input_files_to_check.items(): + if path and not path.is_file(): + raise FileNotFoundError(f"Input file for --{name.replace('_', '-')} not found: {path}") + + if hmm_in: + for hmm_file in hmm_in: + if not hmm_file.is_file(): + raise FileNotFoundError(f"HMM input file not found: {hmm_file}") + + if threads is not None and threads <= 0: + raise ValueError("threads must be a positive integer.") + + if verbose < 0: + raise ValueError("verbose level cannot be negative.") + + # --- Command Construction --- + cmd = ["clustalo"] + output_files = [] + + # Sequence Input + cmd.extend(["--infile", str(infile)]) + if hmm_in: + for hmm_file in hmm_in: + cmd.extend(["--hmm-in", str(hmm_file)]) + if hmm_batch: + cmd.extend(["--hmm-batch", str(hmm_batch)]) + if dealign: + cmd.append("--dealign") + if profile1: + cmd.extend(["--profile1", str(profile1)]) + if profile2: + cmd.extend(["--profile2", str(profile2)]) + if is_profile: + cmd.append("--is-profile") + if seqtype: + cmd.extend(["--seqtype", seqtype]) + if infmt: + cmd.extend(["--infmt", infmt]) + + # Clustering + if distmat_in: + cmd.extend(["--distmat-in", str(distmat_in)]) + if distmat_out: + cmd.extend(["--distmat-out", str(distmat_out)]) + output_files.append(str(distmat_out)) + if guidetree_in: + cmd.extend(["--guidetree-in", str(guidetree_in)]) + if guidetree_out: + cmd.extend(["--guidetree-out", str(guidetree_out)]) + output_files.append(str(guidetree_out)) + if pileup: + cmd.append("--pileup") + if full: + cmd.append("--full") + if full_iter: + cmd.append("--full-iter") + if cluster_size is not None: + cmd.extend(["--cluster-size", str(cluster_size)]) + if clustering_out: + cmd.extend(["--clustering-out", str(clustering_out)]) + output_files.append(str(clustering_out)) + if trans != 0: + cmd.extend(["--trans", str(trans)]) + if posterior_out: + cmd.extend(["--posterior-out", str(posterior_out)]) + output_files.append(str(posterior_out)) + if use_kimura: + cmd.append("--use-kimura") + if percent_id: + cmd.append("--percent-id") + + # Alignment Output + if outfile: + cmd.extend(["--outfile", str(outfile)]) + output_files.append(str(outfile)) + cmd.extend(["--outfmt", outfmt]) + if residuenumber: + cmd.append("--residuenumber") + if wrap is not None: + cmd.extend(["--wrap", str(wrap)]) + if output_order: + cmd.extend(["--output-order", output_order]) + + # Iteration + if iterations is not None: + cmd.extend(["--iterations", str(iterations)]) + if max_guidetree_iterations is not None: + cmd.extend(["--max-guidetree-iterations", str(max_guidetree_iterations)]) + if max_hmm_iterations is not None: + cmd.extend(["--max-hmm-iterations", str(max_hmm_iterations)]) + + # Limits + if maxnumseq is not None: + cmd.extend(["--maxnumseq", str(maxnumseq)]) + if maxseqlen is not None: + cmd.extend(["--maxseqlen", str(maxseqlen)]) + + # Miscellaneous + if auto: + cmd.append("--auto") + if threads is not None: + cmd.extend(["--threads", str(threads)]) + if pseudo: + cmd.extend(["--pseudo", str(pseudo)]) + if log: + cmd.extend(["--log", str(log)]) + output_files.append(str(log)) + if verbose > 0: + cmd.append("-" + "v" * verbose) + if force: + cmd.append("--force") + if mac_ram is not None: + cmd.extend(["--MAC-RAM", str(mac_ram)]) + + # --- Subprocess Execution --- + try: + command_str = " ".join(cmd) + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } + except FileNotFoundError: + raise RuntimeError("clustalo command not found. Please ensure it is installed and in your system's PATH.") + except subprocess.CalledProcessError as e: + # Return structured error information + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"ClustalO failed with exit code {e.returncode}", + "output_files": [] + } diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..4b8930f05aea48c16524633ffce3c0df08adf589 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/clustalo_server.py') +SERVER_NAME = 'biosci_clustalo' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..50ecbc94d4624b00f0fe687ff464198dc02e71e7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-clustalo: + build: . + image: mcp-clustalo:latest + container_name: mcp-clustalo + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=clustalo + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca423df37f9d284dce831fcf7f072fd41a6a4d5d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - clustalo + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalo/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a2b334eff8e02a900f173d644bbf6cdd3cb1cd01 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install clustalw via conda (e.g., from bioconda) +RUN conda install -c bioconda clustalw -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/clustalw_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/clustalw_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/clustalw_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0750fe3bfffc7e6f3fc4c53bd6496b6ce381f95e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_server.py @@ -0,0 +1,181 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List, Dict, Any, Literal + +# Set up logging +logging.basicConfig(level=logging.INFO) +log = logging.getLogger(__name__) + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be imported. +def tool(func): + """A dummy decorator to stand in for @mcp.tool().""" + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + return wrapper + +mcp = type('mcp', (), {'tool': tool}) + + +@mcp.tool +def clustalw( + infile: Optional[Path] = None, + profile1: Optional[Path] = None, + profile2: Optional[Path] = None, + outfile: Optional[Path] = None, + output_format: Optional[Literal["GDE", "GCG", "PHYLIP", "PIR", "NEXUS", "FASTA"]] = None, + sequence_type: Optional[Literal["PROTEIN", "DNA"]] = None, + convert: bool = False, + quicktree: bool = False, + newtree: Optional[Path] = None, + usetree: Optional[Path] = None, + output_order: Optional[Literal["INPUT", "ALIGNED"]] = "ALIGNED", + clustering: Optional[Literal["NJ", "UPGMA"]] = "NJ", + iteration: Optional[Literal["NONE", "TREE", "ALIGNMENT"]] = None, + numiter: Optional[int] = None, + gapdist: Optional[int] = None, + stats: Optional[Path] = None, + quiet: bool = False, + matrix: Optional[str] = None, + dnamatrix: Optional[str] = None, + gapopen: Optional[float] = None, + gapext: Optional[float] = None, + endgaps: bool = False, + nopgap: bool = False, + nohgap: bool = False, + hgapresidues: Optional[str] = None, + maxdiv: Optional[int] = None, + pwmatrix: Optional[str] = None, + pwdnamatrix: Optional[str] = None, + pwgapopen: Optional[float] = None, + pwgapext: Optional[float] = None, + negative: bool = False, +) -> Dict[str, Any]: + """ + Performs multiple sequence alignment using ClustalW 2.1. + + This tool can perform de novo multiple sequence alignments, profile alignments, + or convert existing alignment formats. + """ + # --- Input Validation --- + if infile and (profile1 or profile2): + raise ValueError("Cannot use `infile` with `profile1` or `profile2`. Use one mode at a time.") + if (profile1 and not profile2) or (not profile1 and profile2): + raise ValueError("`profile1` and `profile2` must be used together for profile alignment.") + if not infile and not (profile1 and profile2): + raise ValueError("Either `infile` or both `profile1` and `profile2` must be provided.") + + if infile: + if not infile.is_file(): + raise FileNotFoundError(f"Input file not found: {infile}") + if profile1: + if not profile1.is_file(): + raise FileNotFoundError(f"Profile 1 file not found: {profile1}") + if profile2: + if not profile2.is_file(): + raise FileNotFoundError(f"Profile 2 file not found: {profile2}") + if usetree: + if not usetree.is_file(): + raise FileNotFoundError(f"User-provided guide tree not found: {usetree}") + + if maxdiv is not None and not (0 < maxdiv <= 100): + raise ValueError("`maxdiv` must be an integer between 1 and 100.") + + # --- Command and Output File Construction --- + cmd = ["clustalw"] + output_files: List[str] = [] + + base_input_path = infile or profile1 + + # Determine output file paths if not specified + if not outfile and base_input_path: + # ClustalW's default output is based on the input file stem + outfile = base_input_path.with_name(f"{base_input_path.stem}.aln") + if outfile: + cmd.append(f"-OUTFILE={outfile}") + output_files.append(str(outfile)) + + # ClustalW creates a .dnd guide tree file by default if not using a provided tree + predicted_treefile = None + if not newtree and not usetree and base_input_path: + predicted_treefile = base_input_path.with_name(f"{base_input_path.stem}.dnd") + output_files.append(str(predicted_treefile)) + + # --- Append arguments to command --- + # Input/Output + if infile: cmd.append(f"-INFILE={infile}") + if profile1: cmd.append(f"-PROFILE1={profile1}") + if profile2: cmd.append(f"-PROFILE2={profile2}") + if output_format: cmd.append(f"-OUTPUT={output_format.upper()}") + if sequence_type: cmd.append(f"-TYPE={sequence_type.upper()}") + if convert: cmd.append("-CONVERT") + if quiet: cmd.append("-QUIET") + if stats: + cmd.append(f"-STATS={stats}") + output_files.append(str(stats)) + + # Alignment Structure + if quicktree: cmd.append("-QUICKTREE") + if newtree: + cmd.append(f"-NEWTREE={newtree}") + output_files.append(str(newtree)) + if str(predicted_treefile) in output_files: + output_files.remove(str(predicted_treefile)) # Remove predicted if explicit is given + if usetree: cmd.append(f"-USETREE={usetree}") + if output_order: cmd.append(f"-OUTORDER={output_order.upper()}") + if clustering: cmd.append(f"-CLUSTERING={clustering.upper()}") + + # Iteration + if iteration: cmd.append(f"-ITERATION={iteration.upper()}") + if numiter is not None: cmd.append(f"-NUMITER={numiter}") + if gapdist is not None: cmd.append(f"-GAPDIST={gapdist}") + + # Pairwise Alignment Parameters + if matrix: cmd.append(f"-MATRIX={matrix.upper()}") + if dnamatrix: cmd.append(f"-DNAMATRIX={dnamatrix.upper()}") + if gapopen is not None: cmd.append(f"-GAPOPEN={gapopen}") + if gapext is not None: cmd.append(f"-GAPEXT={gapext}") + if endgaps: cmd.append("-ENDGAPS") + if nopgap: cmd.append("-NOPGAP") + if nohgap: cmd.append("-NOHGAP") + if hgapresidues: cmd.append(f"-HGAPRESIDUES={hgapresidues}") + if maxdiv is not None: cmd.append(f"-MAXDIV={maxdiv}") + + # Multiple Alignment Parameters + if pwmatrix: cmd.append(f"-PWMATRIX={pwmatrix.upper()}") + if pwdnamatrix: cmd.append(f"-PWDNAMATRIX={pwdnamatrix.upper()}") + if pwgapopen is not None: cmd.append(f"-PWGAPOPEN={pwgapopen}") + if pwgapext is not None: cmd.append(f"-PWGAPEXT={pwgapext}") + if negative: cmd.append("-NEGATIVE") + + # --- Subprocess Execution --- + command_str = " ".join(map(str, cmd)) + log.info(f"Executing command: {command_str}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Verify that expected output files were created + verified_files = [f for f in output_files if Path(f).exists()] + + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": verified_files, + } + except FileNotFoundError: + raise RuntimeError("clustalw executable not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + log.error(f"ClustalW failed with exit code {e.returncode}") + log.error(f"STDOUT: {e.stdout}") + log.error(f"STDERR: {e.stderr}") + raise RuntimeError( + f"ClustalW execution failed. Command: '{command_str}'. " + f"Error: {e.stderr}" + ) from e diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..ae862eb9a5acf701baf08af89fdb0f105613bb90 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/clustalw_server.py') +SERVER_NAME = 'biosci_clustalw' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..93c72638ef3ab8886d698f286f42276140b388c5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-clustalw: + build: . + image: mcp-clustalw:latest + container_name: mcp-clustalw + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=clustalw + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b8d6fcf6febb709192caf569c2104cb7e4172267 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - clustalw + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_clustalw/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7dcdcdc1f551d13aa67f84f292057bb9dabe9211 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install cnmf via conda (e.g., from bioconda) +RUN conda install -c bioconda cnmf -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY cnmf_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/cnmf_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/cnmf_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_server.py new file mode 100644 index 0000000000000000000000000000000000000000..376c5cefc7a0bee58619fabc27dca60ded259ffe --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_server.py @@ -0,0 +1,348 @@ +import subprocess +import shlex +from pathlib import Path +from typing import List, Optional + +# MCP decorator is commented out as per instructions +# @mcp.tool() +def cnmf_prepare( + counts: Path, + components: List[int], + n_iter: int, + name: str, + output_dir: Path, + total_workers: Optional[int] = None, + seed: Optional[int] = None, + genes_file: Optional[Path] = None, + numgenes: Optional[int] = None, + tpm: Optional[Path] = None, + max_nmf_iter: int = 1000, + beta_loss: str = "frobenius", + init: str = "random", + densify: bool = False, +) -> dict: + """ + Prepares the data and directory structure for a cNMF analysis. + + This step filters the count matrix, selects high-variance genes, + and sets up the output directory for subsequent factorization runs. + """ + # --- Input Validation --- + if not counts.is_file(): + raise FileNotFoundError(f"Input counts file not found: {counts}") + if genes_file and not genes_file.is_file(): + raise FileNotFoundError(f"Genes file not found: {genes_file}") + if tpm and not tpm.is_file(): + raise FileNotFoundError(f"TPM file not found: {tpm}") + + if not components: + raise ValueError("At least one component value (-k/--components) must be provided.") + if n_iter <= 0: + raise ValueError("--n-iter must be a positive integer.") + if max_nmf_iter <= 0: + raise ValueError("--max-nmf-iter must be a positive integer.") + if numgenes is not None and numgenes <= 0: + raise ValueError("--numgenes must be a positive integer.") + + beta_loss_choices = ["frobenius", "kullback-leibler", "itakura-saito"] + if beta_loss not in beta_loss_choices: + raise ValueError(f"--beta-loss must be one of {beta_loss_choices}, not '{beta_loss}'") + + init_choices = ["random", "nndsvd"] + if init not in init_choices: + raise ValueError(f"--init must be one of {init_choices}, not '{init}'") + + # --- Command Construction --- + cmd = ["cnmf", "prepare"] + cmd.extend(["--output-dir", str(output_dir)]) + cmd.extend(["--name", name]) + cmd.extend(["--counts", str(counts)]) + cmd.extend(["--components", *[str(k) for k in components]]) + cmd.extend(["--n-iter", str(n_iter)]) + + if total_workers is not None: + cmd.extend(["--total-workers", str(total_workers)]) + if seed is not None: + cmd.extend(["--seed", str(seed)]) + if genes_file: + cmd.extend(["--genes-file", str(genes_file)]) + if numgenes is not None: + cmd.extend(["--numgenes", str(numgenes)]) + if tpm: + cmd.extend(["--tpm", str(tpm)]) + if max_nmf_iter != 1000: + cmd.extend(["--max-nmf-iter", str(max_nmf_iter)]) + if beta_loss != "frobenius": + cmd.extend(["--beta-loss", beta_loss]) + if init != "random": + cmd.extend(["--init", init]) + if densify: + cmd.append("--densify") + + # --- Subprocess Execution --- + try: + # Ensure output directory exists + output_dir.mkdir(parents=True, exist_ok=True) + + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + return { + "command_executed": shlex.join(cmd), + "stdout": "", + "stderr": "Error: 'cnmf' command not found. Please ensure it is in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": shlex.join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + # The prepare step creates the main output directory for the analysis. + output_path = output_dir / name + return { + "command_executed": shlex.join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output_path)] + } + + +# @mcp.tool() +def cnmf_factorize( + name: str, + output_dir: Path, + worker_index: Optional[int] = None, + total_workers: Optional[int] = None, + skip_completed_runs: bool = False, +) -> dict: + """ + Runs the NMF factorizations for a cNMF analysis. + + This step can be parallelized across multiple workers. + """ + # --- Input Validation --- + if worker_index is not None and worker_index < 0: + raise ValueError("--worker-index must be a non-negative integer.") + if total_workers is not None and total_workers <= 0: + raise ValueError("--total-workers must be a positive integer.") + + # --- Command Construction --- + cmd = ["cnmf", "factorize"] + cmd.extend(["--output-dir", str(output_dir)]) + cmd.extend(["--name", name]) + + if worker_index is not None: + cmd.extend(["--worker-index", str(worker_index)]) + if total_workers is not None: + cmd.extend(["--total-workers", str(total_workers)]) + if skip_completed_runs: + cmd.append("--skip-completed-runs") + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + return { + "command_executed": shlex.join(cmd), + "stdout": "", + "stderr": "Error: 'cnmf' command not found. Please ensure it is in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": shlex.join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + # Factorize populates the directory created by 'prepare'. + output_path = output_dir / name + return { + "command_executed": shlex.join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output_path)] + } + + +# @mcp.tool() +def cnmf_combine( + name: str, + output_dir: Path, +) -> dict: + """ + Combines the factorization results from multiple workers into a single file. + """ + # --- Command Construction --- + cmd = ["cnmf", "combine"] + cmd.extend(["--output-dir", str(output_dir)]) + cmd.extend(["--name", name]) + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + return { + "command_executed": shlex.join(cmd), + "stdout": "", + "stderr": "Error: 'cnmf' command not found. Please ensure it is in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": shlex.join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + # Combine creates merged files within the main output directory. + output_path = output_dir / name + return { + "command_executed": shlex.join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output_path)] + } + + +# @mcp.tool() +def cnmf_consensus( + name: str, + output_dir: Path, + local_density_threshold: Optional[float] = None, + local_neighborhood_size: Optional[float] = None, + show_clustering: bool = False, + build_reference: bool = False, +) -> dict: + """ + Performs consensus clustering and filtering on the factorization results. + """ + # --- Input Validation --- + if local_density_threshold is not None: + if not (0 < local_density_threshold <= 2): + raise ValueError("--local-density-threshold must be a float > 0 and <= 2.") + if local_neighborhood_size is not None and not (0 < local_neighborhood_size <= 1): + raise ValueError("--local-neighborhood-size must be a float > 0 and <= 1.") + + # --- Command Construction --- + cmd = ["cnmf", "consensus"] + cmd.extend(["--output-dir", str(output_dir)]) + cmd.extend(["--name", name]) + + if local_density_threshold is not None: + cmd.extend(["--local-density-threshold", str(local_density_threshold)]) + if local_neighborhood_size is not None: + cmd.extend(["--local-neighborhood-size", str(local_neighborhood_size)]) + if show_clustering: + cmd.append("--show-clustering") + if build_reference: + cmd.append("--build-reference") + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + return { + "command_executed": shlex.join(cmd), + "stdout": "", + "stderr": "Error: 'cnmf' command not found. Please ensure it is in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": shlex.join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + output_path = output_dir / name + outputs = [str(output_path)] + # Assuming standard output file names for optional plots + if show_clustering: + outputs.append(str(output_path / f"{name}.clustering.pdf")) + + return { + "command_executed": shlex.join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": outputs + } + + +# @mcp.tool() +def cnmf_k_selection_plot( + name: str, + output_dir: Path, +) -> dict: + """ + Generates plots to help select the number of components (K). + """ + # --- Command Construction --- + cmd = ["cnmf", "k_selection_plot"] + cmd.extend(["--output-dir", str(output_dir)]) + cmd.extend(["--name", name]) + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + return { + "command_executed": shlex.join(cmd), + "stdout": "", + "stderr": "Error: 'cnmf' command not found. Please ensure it is in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": shlex.join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + output_path = output_dir / name + # Assuming a standard output file name for the plot + plot_file = output_path / f"{name}.k_selection.pdf" + + return { + "command_executed": shlex.join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(plot_file)] + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..033b4303c923ca3de76726b0ba98c65f7b30f0e5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/app/cnmf_server.py') +SERVER_NAME = 'biosci_cnmf' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..635e5916557072f02007e3ba1681195e4dc5f7ba --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-cnmf: + build: . + image: mcp-cnmf:latest + container_name: mcp-cnmf + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=cnmf + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..013ba86cf1efcb8a1a6aa0a45222e3626eec9499 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - cnmf + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cnmf/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..09f26a5e21ea531e80b3d5e1e56d4317f878fa4e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install csvtk via conda (e.g., from bioconda) +RUN conda install -c bioconda csvtk -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/csvtk_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/csvtk_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/csvtk_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f4807d80f87dfc9cc62667e561c2a3693ab5af70 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_server.py @@ -0,0 +1,548 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Dict, Any + +def _execute_csvtk( + subcommand: str, + args: List[str], + in_file: Optional[str] = None, + tabs: bool = False, + no_header_row: bool = False, + comment_char: str = "#", + ignore_illegal_row: bool = False, + ignore_empty_row: bool = False, + lazy_quotes: bool = False, + out_tabs: bool = False, + out_file: str = "-", + num_cpus: int = 4, +) -> Dict[str, Any]: + """Helper function to execute csvtk commands with global flags.""" + cmd = ["csvtk", subcommand] + + # Global flags + if tabs: + cmd.append("-t") + if no_header_row: + cmd.append("-H") + if comment_char != "#": + cmd.extend(["-C", comment_char]) + if ignore_illegal_row: + cmd.append("-I") + if ignore_empty_row: + cmd.append("-E") + if lazy_quotes: + cmd.append("-l") + if out_tabs: + cmd.append("-T") + if out_file != "-": + cmd.extend(["-o", out_file]) + + cmd.extend(["-j", str(num_cpus)]) + + # Subcommand specific args + cmd.extend(args) + + # Input file + if in_file and in_file != "-": + input_path = Path(in_file) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {in_file}") + cmd.append(in_file) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [out_file] if out_file != "-" else [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e) + } + +@mcp.tool() +def csvtk_headers( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Print headers of a CSV/TSV file.""" + return _execute_csvtk("headers", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_dim( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Dimensions of CSV file (rows and columns).""" + return _execute_csvtk("dim", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_ncol( + in_file: str, + tabs: bool = False, +) -> Dict[str, Any]: + """Print number of columns.""" + return _execute_csvtk("ncol", [], in_file=in_file, tabs=tabs) + +@mcp.tool() +def csvtk_nrow( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Print number of records (rows).""" + return _execute_csvtk("nrow", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_corr( + in_file: str, + fields: str, + tabs: bool = False, + ignore_illegal_row: bool = False, +) -> Dict[str, Any]: + """Calculate Pearson correlation between two columns.""" + return _execute_csvtk("corr", ["-f", fields], in_file=in_file, tabs=tabs, ignore_illegal_row=ignore_illegal_row) + +@mcp.tool() +def csvtk_summary( + in_file: str, + fields: str, + groups: str = "", + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Summary statistics of selected numeric or text fields (groupby group fields). + Fields format: col:stats (e.g., price:sum,price:mean). + """ + args = ["-f", fields] + if groups: + args.extend(["-g", groups]) + return _execute_csvtk("summary", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_cut( + in_file: str, + fields: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Select and arrange fields/columns.""" + return _execute_csvtk("cut", ["-f", fields], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_grep( + in_file: str, + fields: str, + pattern: str, + ignore_case: bool = False, + invert_match: bool = False, + use_regexp: bool = False, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Grep data by selected fields with patterns/regular expressions.""" + args = ["-f", fields, "-p", pattern] + if ignore_case: + args.append("-i") + if invert_match: + args.append("-v") + if use_regexp: + args.append("-r") + return _execute_csvtk("grep", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_filter( + in_file: str, + filter_expr: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Filter rows by values of selected fields with arithmetic expression (e.g., "col1 > 10").""" + return _execute_csvtk("filter", ["-f", filter_expr], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_filter2( + in_file: str, + expression: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Filter rows by awk-like arithmetic/string expressions (e.g., '$1 > 10 && $2 == "A"').""" + return _execute_csvtk("filter2", ["-f", expression], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_sort( + in_file: str, + keys: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Sort by selected fields. Keys format: 1:n (numeric), 2:r (reverse).""" + return _execute_csvtk("sort", ["-k", keys], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_join( + file1: str, + file2: str, + fields: str, + left_join: bool = False, + outer_join: bool = False, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Join files by selected fields.""" + args = ["-f", fields] + if left_join: + args.append("--left-join") + if outer_join: + args.append("--outer-join") + args.append(file2) + return _execute_csvtk("join", args, in_file=file1, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_concat( + files: List[str], + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Concatenate CSV/TSV files by rows.""" + return _execute_csvtk("concat", files, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_uniq( + in_file: str, + fields: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Unique data without sorting.""" + return _execute_csvtk("uniq", ["-f", fields], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_freq( + in_file: str, + fields: str, + sort_by_freq: bool = False, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Frequencies of selected fields.""" + args = ["-f", fields] + if sort_by_freq: + args.extend(["-n", "-r"]) + return _execute_csvtk("freq", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_mutate( + in_file: str, + fields: str, + name: str, + pattern: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Create new column from selected fields by regular expression.""" + args = ["-f", fields, "-n", name, "-p", pattern] + return _execute_csvtk("mutate", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_mutate2( + in_file: str, + name: str, + expression: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Create a new column from selected fields by awk-like arithmetic/string expressions.""" + args = ["-n", name, "-e", expression] + return _execute_csvtk("mutate2", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_rename( + in_file: str, + fields: str, + names: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Rename column names with new names.""" + args = ["-f", fields, "-n", names] + return _execute_csvtk("rename", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_replace( + in_file: str, + fields: str, + pattern: str, + replacement: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Replace data of selected fields by regular expression.""" + args = ["-f", fields, "-p", pattern, "-r", replacement] + return _execute_csvtk("replace", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_round( + in_file: str, + fields: str, + decimal_places: int = 2, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Round float to n decimal places.""" + args = ["-f", fields, "-n", str(decimal_places)] + return _execute_csvtk("round", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_transpose( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Transpose CSV data.""" + return _execute_csvtk("transpose", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_sep( + in_file: str, + fields: str, + sep_char: str, + names: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Separate column into multiple columns.""" + args = ["-f", fields, "-s", sep_char, "-n", names] + return _execute_csvtk("sep", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_gather( + in_file: str, + key_col: str, + value_col: str, + fields: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Gather columns into key-value pairs (pivot_longer).""" + args = ["-k", key_col, "-v", value_col, "-f", fields] + return _execute_csvtk("gather", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_spread( + in_file: str, + key_col: str, + value_col: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Spread a key-value pair across multiple columns (pivot_wider).""" + args = ["-k", key_col, "-v", value_col] + return _execute_csvtk("spread", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_pretty( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Convert CSV to a readable aligned table.""" + return _execute_csvtk("pretty", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_csv2md( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Convert CSV to markdown format.""" + return _execute_csvtk("csv2md", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_csv2json( + in_file: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Convert CSV to JSON format.""" + return _execute_csvtk("csv2json", [], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_xlsx2csv( + in_file: str, + sheet_index: int = 1, + sheet_name: str = "", + out_file: str = "-", +) -> Dict[str, Any]: + """Convert XLSX to CSV format.""" + args = [] + if sheet_name: + args.extend(["-n", sheet_name]) + else: + args.extend(["-i", str(sheet_index)]) + return _execute_csvtk("xlsx2csv", args, in_file=in_file, out_file=out_file) + +@mcp.tool() +def csvtk_fix( + in_file: str, + tabs: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Fix CSV/TSV with different numbers of columns in rows.""" + return _execute_csvtk("fix", [], in_file=in_file, tabs=tabs, out_file=out_file) + +@mcp.tool() +def csvtk_fix_quotes( + in_file: str, + tabs: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Fix malformed CSV/TSV caused by double-quotes.""" + return _execute_csvtk("fix-quotes", [], in_file=in_file, tabs=tabs, out_file=out_file) + +@mcp.tool() +def csvtk_del_quotes( + in_file: str, + tabs: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Remove extra double quotes added by 'fix-quotes'.""" + return _execute_csvtk("del-quotes", [], in_file=in_file, tabs=tabs, out_file=out_file) + +@mcp.tool() +def csvtk_head( + in_file: str, + number: int = 10, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Print first N records.""" + return _execute_csvtk("head", ["-n", str(number)], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_sample( + in_file: str, + proportion: float = 0.1, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Sampling by proportion.""" + return _execute_csvtk("sample", ["-p", str(proportion)], in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_split( + in_file: str, + fields: str, + out_dir: str = ".", + tabs: bool = False, + no_header_row: bool = False, +) -> Dict[str, Any]: + """Split CSV/TSV into multiple files according to column values.""" + args = ["-f", fields, "-out-dir", out_dir] + return _execute_csvtk("split", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row) + +@mcp.tool() +def csvtk_comb( + in_file: str, + fields: str, + number: int = 2, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Compute combinations of items at every row.""" + args = ["-f", fields, "-n", str(number)] + return _execute_csvtk("comb", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_fmtdate( + in_file: str, + fields: str, + format_str: str, + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Format date of selected fields.""" + args = ["-f", fields, "--format", format_str] + return _execute_csvtk("fmtdate", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_fold( + in_file: str, + fields: str, + groups: str = "", + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Fold multiple values of a field into cells of groups.""" + args = ["-f", fields] + if groups: + args.extend(["-g", groups]) + return _execute_csvtk("fold", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_unfold( + in_file: str, + fields: str, + sep_char: str = ",", + tabs: bool = False, + no_header_row: bool = False, + out_file: str = "-", +) -> Dict[str, Any]: + """Unfold multiple values in cells of a field.""" + args = ["-f", fields, "-s", sep_char] + return _execute_csvtk("unfold", args, in_file=in_file, tabs=tabs, no_header_row=no_header_row, out_file=out_file) + +@mcp.tool() +def csvtk_plot( + in_file: str, + plot_type: str, + x_field: str, + y_field: str = "", + title: str = "", + tabs: bool = False, + out_file: str = "plot.png", +) -> Dict[str, Any]: + """Plot common figures (line, hist, box, etc.).""" + args = [plot_type, "-x", x_field] + if y_field: + args.extend(["-y", y_field]) + if title: + args.extend(["--title", title]) + return _execute_csvtk("plot", args, in_file=in_file, tabs=tabs, out_file=out_file) + +@mcp.tool() +def csvtk_version() -> Dict[str, Any]: + """Print version information.""" + return _execute_csvtk("version", []) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..50fd016dbcaf7f6df79f146b1b59975940cc40c0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/csvtk_server.py') +SERVER_NAME = 'biosci_csvtk' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..50f6f27ba178abb5a9c6c47b6c7e53883ed4080f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-csvtk: + build: . + image: mcp-csvtk:latest + container_name: mcp-csvtk + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=csvtk + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ea652d494f553248778fff00e02b81df38417f7a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - csvtk + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_csvtk/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3e77be585db7f5d85f326e451e44a04aaf60162b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install cytotrace2-python via conda (e.g., from bioconda) +RUN conda install -c bioconda cytotrace2-python -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY cytotrace2-python_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/cytotrace2-python_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/cytotrace2-python_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_server.py new file mode 100644 index 0000000000000000000000000000000000000000..16f150fe24b5a8d7e15214e15d931d3b9e5658ee --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_server.py @@ -0,0 +1,150 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Dict, Any + +# Assume mcp is imported elsewhere, as per instructions "NO NEED to import mcp" + +@mcp.tool() +def run_rscript( + script_file: Optional[Path] = None, + expressions: Optional[List[str]] = None, + verbose: bool = False, + default_packages: Optional[str] = None, + save: bool = False, + no_environ: bool = False, + no_site_file: bool = False, + no_init_file: bool = False, + restore: bool = False, + vanilla: bool = False, + script_args: Optional[List[str]] = None, +) -> Dict[str, Any]: + """ + Executes an R script or R expressions using the Rscript command-line utility. + + This tool provides an interface to the Rscript command, allowing users to run + R scripts or evaluate R expressions directly from the command line with + various R environment configuration options. + + Args: + script_file: Path to the R script file (.R) to execute. + This parameter is mutually exclusive with 'expressions'. + If provided, the file must exist. + expressions: A list of R expressions (strings) to evaluate. Each string + in the list will be passed with a separate '-e' flag. + This parameter is mutually exclusive with 'script_file'. + verbose: If True, print information on R's progress during execution. + default_packages: A comma-separated list of package names (e.g., "stats,utils") + to load by default, or 'NULL' to load no default packages. + save: If True, save the R workspace at the end of the session. + no_environ: If True, do not read the site and user environment files. + no_site_file: If True, do not read the site-wide Rprofile. + no_init_file: If True, do not read the user R profile. + restore: If True, restore previously saved objects at startup. + vanilla: If True, combine --no-save, --no-restore, --no-site-file, + --no-init-file, and --no-environ. This option overrides + individual settings for these flags. + script_args: A list of additional arguments (strings) to pass directly + to the R script being executed. These arguments are accessible + within the R script via `commandArgs(trailingOnly=TRUE)`. + + Returns: + A dictionary containing the command executed, standard output, standard error, + and a list of any output files generated (though Rscript itself doesn't + produce named output files unless specified within the R script). + + Raises: + ValueError: If neither 'script_file' nor 'expressions' is provided, + or if both are provided. + FileNotFoundError: If 'script_file' is provided but the file does not exist. + """ + # Input validation for mutually exclusive parameters + if script_file is None and expressions is None: + raise ValueError("Either 'script_file' or 'expressions' must be provided.") + if script_file is not None and expressions is not None: + raise ValueError("Cannot provide both 'script_file' and 'expressions'. Choose one.") + + # Validate script_file existence if provided + if script_file: + if not script_file.is_file(): + raise FileNotFoundError(f"R script file not found: {script_file}") + # Optional: Check for .R extension, though Rscript can run any file + if script_file.suffix.lower() != ".r": + print(f"Warning: Script file '{script_file}' does not have a '.R' extension. " + "Rscript will attempt to execute it regardless.") + + command: List[str] = ["Rscript"] + + # Add Rscript options + if verbose: + command.append("--verbose") + if default_packages is not None: + command.append(f"--default-packages={default_packages}") + if save: + command.append("--save") + if no_environ: + command.append("--no-environ") + if no_site_file: + command.append("--no-site-file") + if no_init_file: + command.append("--no-init-file") + if restore: + command.append("--restore") + if vanilla: + command.append("--vanilla") + + # Add expressions or script file + if expressions: + for expr in expressions: + command.extend(["-e", expr]) + elif script_file: + command.append(str(script_file)) + + # Add arguments to be passed to the R script + if script_args: + command.extend(script_args) + + command_str = " ".join(command) + output_files: List[Path] = [] # Rscript itself doesn't produce standard output files. + + try: + process = subprocess.run( + command, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + stdout = process.stdout + stderr = process.stderr + except subprocess.CalledProcessError as e: + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Rscript execution failed with exit code {e.returncode}. " + f"Command: {command_str}", + "output_files": output_files, + } + except FileNotFoundError: + return { + "command_executed": command_str, + "stdout": "", + "stderr": "Rscript command not found. Please ensure R is installed and Rscript is in your system's PATH.", + "error": "Rscript executable not found.", + "output_files": output_files, + } + except Exception as e: + return { + "command_executed": command_str, + "stdout": "", + "stderr": str(e), + "error": f"An unexpected error occurred during Rscript execution: {e}", + "output_files": output_files, + } + + return { + "command_executed": command_str, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..13e48f11f89ae7cb509a6a8df007b4d1f92e908f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/app/cytotrace2-python_server.py') +SERVER_NAME = 'biosci_cytotrace2_python' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..a7e3973745d9f8bfa060c68bcf98ff3277e3f7f2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-cytotrace2-python: + build: . + image: mcp-cytotrace2-python:latest + container_name: mcp-cytotrace2-python + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=cytotrace2-python + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6679f76bf3e643cb984709f1c79af3ba836b4a5d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - cytotrace2-python + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_cytotrace2-python/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..9377ee41676018cd45120e518daf4324c4695657 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install decoupler via conda (e.g., from bioconda) +RUN conda install -c bioconda decoupler -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY decoupler_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/decoupler_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/decoupler_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_server.py new file mode 100644 index 0000000000000000000000000000000000000000..73d38c3641d110b4dee7f96316fb2c0e49a3f683 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_server.py @@ -0,0 +1,692 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Literal, Optional + +# Mock mcp decorator for standalone execution +class mcp: + @staticmethod + def tool(func): + return func + +@mcp.tool +def decoupler_mlm( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + verbose: bool = False, +): + """ + Runs transcription factor/pathway activities using the Multivariate Linear Model (mlm) method from decoupler. + + This method is equivalent to the `run_mlm` function in the decoupler library. + It models the relationship between a set of regulators and their target features using a linear model. + + Args: + mat: Path to the input matrix file (e.g., gene expression). Should be a long-format CSV/TSV. + net: Path to the input network file (e.g., TF-target interactions). Should be a long-format CSV/TSV. + output: Path to the output file where the inferred activities will be saved. + mat_source_col: Column name in the matrix file for the features (e.g., 'genes'). + mat_target_col: Column name in the matrix file for the samples (e.g., 'cells'). + mat_value_col: Column name in the matrix file for the values (e.g., 'expression'). + net_source_col: Column name in the network file for the regulators (e.g., 'tf'). + net_target_col: Column name in the network file for the targets (e.g., 'target'). + net_weight_col: Column name in the network file for the interaction weights (e.g., 'weight'). + min_n: Minimum number of targets per regulator in the network to be considered. + batch_size: Number of samples to process in each batch to manage memory usage. + verbose: If True, increases verbosity of the tool's output. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "mlm", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + ] + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_ulm( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + verbose: bool = False, +): + """ + Runs transcription factor/pathway activities using the Univariate Linear Model (ulm) method from decoupler. + + This method is equivalent to the `run_ulm` function in the decoupler library. + It models the relationship between each regulator and its target features independently. + + Args: + mat: Path to the input matrix file (e.g., gene expression). Should be a long-format CSV/TSV. + net: Path to the input network file (e.g., TF-target interactions). Should be a long-format CSV/TSV. + output: Path to the output file where the inferred activities will be saved. + mat_source_col: Column name in the matrix file for the features (e.g., 'genes'). + mat_target_col: Column name in the matrix file for the samples (e.g., 'cells'). + mat_value_col: Column name in the matrix file for the values (e.g., 'expression'). + net_source_col: Column name in the network file for the regulators (e.g., 'tf'). + net_target_col: Column name in the network file for the targets (e.g., 'target'). + net_weight_col: Column name in the network file for the interaction weights (e.g., 'weight'). + min_n: Minimum number of targets per regulator in the network to be considered. + batch_size: Number of samples to process in each batch to manage memory usage. + verbose: If True, increases verbosity of the tool's output. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "ulm", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + ] + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_wsum( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + nes: bool = False, + times: int = 100, + seed: int = 42, + verbose: bool = False, +): + """ + Runs transcription factor/pathway activities using the Weighted Sum (wsum) method from decoupler. + + This method calculates scores by multiplying the feature matrix by the network matrix. + It can optionally compute a normalized enrichment score (NES) through permutations. + + Args: + mat: Path to the input matrix file. + net: Path to the input network file. + output: Path to the output file. + mat_source_col: Column name for features in the matrix file. + mat_target_col: Column name for samples in the matrix file. + mat_value_col: Column name for values in the matrix file. + net_source_col: Column name for regulators in the network file. + net_target_col: Column name for targets in the network file. + net_weight_col: Column name for interaction weights in the network file. + min_n: Minimum number of targets per regulator. + batch_size: Number of samples to process per batch. + nes: If True, compute Normalized Enrichment Scores (NES) by permutation. + times: Number of permutations to perform if `nes` is True. + seed: Random seed for permutations. + verbose: If True, increases verbosity. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + if times < 1: + raise ValueError("times must be a positive integer.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "wsum", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + "--times", str(times), + "--seed", str(seed), + ] + if nes: + cmd.append("--nes") + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_ora( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + top: int = 100, + verbose: bool = False, +): + """ + Runs Over-Representation Analysis (ORA) using decoupler. + + This method performs a statistical test (Fisher's exact test) to determine if a set of features + (e.g., differentially expressed genes) is enriched in a given pathway/regulon. + + Args: + mat: Path to the input matrix file. + net: Path to the input network file. + output: Path to the output file. + mat_source_col: Column name for features in the matrix file. + mat_target_col: Column name for samples in the matrix file. + mat_value_col: Column name for values in the matrix file. + net_source_col: Column name for regulators in the network file. + net_target_col: Column name for targets in the network file. + net_weight_col: Column name for interaction weights in the network file. + min_n: Minimum number of targets per regulator. + batch_size: Number of samples to process per batch. + top: Number of top features from the matrix to use for the enrichment analysis. + verbose: If True, increases verbosity. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + if top < 1: + raise ValueError("top must be a positive integer.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "ora", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + "--top", str(top), + ] + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_gsva( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + mx_diff: bool = True, + abs_ranking: bool = False, + min_sz: int = 5, + max_sz: int = 500, + kcdf: Literal['Gaussian', 'Poisson'] = 'Gaussian', + seed: int = 42, + verbose: bool = False, +): + """ + Runs Gene Set Variation Analysis (GSVA) using decoupler. + + GSVA estimates variation of pathway activity over a sample population in an unsupervised manner. + + Args: + mat: Path to the input matrix file. + net: Path to the input network file. + output: Path to the output file. + mat_source_col: Column name for features in the matrix file. + mat_target_col: Column name for samples in the matrix file. + mat_value_col: Column name for values in the matrix file. + net_source_col: Column name for regulators in the network file. + net_target_col: Column name for targets in the network file. + net_weight_col: Column name for interaction weights in the network file. + min_n: Minimum number of targets per regulator. + batch_size: Number of samples to process per batch. + mx_diff: The maximum absolute difference between the minimum and maximum. + abs_ranking: If True, gene expression values are ranked by their absolute values. + min_sz: Minimum size of a gene set to be considered. + max_sz: Maximum size of a gene set to be considered. + kcdf: Kernel cumulative distribution function to use. + seed: Random seed. + verbose: If True, increases verbosity. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + if min_sz < 1: + raise ValueError("min_sz must be a positive integer.") + if max_sz < min_sz: + raise ValueError("max_sz must be greater than or equal to min_sz.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "gsva", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + "--min-sz", str(min_sz), + "--max-sz", str(max_sz), + "--kcdf", kcdf, + "--seed", str(seed), + ] + if mx_diff: + cmd.append("--mx-diff") + if abs_ranking: + cmd.append("--abs-ranking") + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_viper( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + nes: bool = True, + pleiotropy: bool = True, + eset_filter: bool = False, + seed: int = 42, + verbose: bool = False, +): + """ + Runs Virtual Inference of Protein-activity by Enriched Regulon analysis (VIPER). + + VIPER is a method to infer protein activity from gene expression data based on the enrichment + of its transcriptional targets (regulon). + + Args: + mat: Path to the input matrix file. + net: Path to the input network file. + output: Path to the output file. + mat_source_col: Column name for features in the matrix file. + mat_target_col: Column name for samples in the matrix file. + mat_value_col: Column name for values in the matrix file. + net_source_col: Column name for regulators in the network file. + net_target_col: Column name for targets in the network file. + net_weight_col: Column name for interaction weights in the network file. + min_n: Minimum number of targets per regulator. + batch_size: Number of samples to process per batch. + nes: If True, compute Normalized Enrichment Scores (NES). + pleiotropy: If True, correct for pleiotropy (regulators sharing targets). + eset_filter: If True, filter by eset size. + seed: Random seed. + verbose: If True, increases verbosity. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "viper", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + "--seed", str(seed), + ] + if nes: + cmd.append("--nes") + if pleiotropy: + cmd.append("--pleiotropy") + if eset_filter: + cmd.append("--eset-filter") + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } + +@mcp.tool +def decoupler_gsea( + mat: Path, + net: Path, + output: Path, + mat_source_col: str = 'genes', + mat_target_col: str = 'cells', + mat_value_col: str = 'expression', + net_source_col: str = 'tf', + net_target_col: str = 'target', + net_weight_col: str = 'weight', + min_n: int = 5, + batch_size: int = 10000, + times: int = 100, + min_sz: int = 5, + max_sz: int = 500, + seed: int = 42, + verbose: bool = False, +): + """ + Runs Gene Set Enrichment Analysis (GSEA) using decoupler. + + GSEA determines whether a defined set of genes shows statistically significant, concordant + differences between two biological states. + + Args: + mat: Path to the input matrix file. + net: Path to the input network file. + output: Path to the output file. + mat_source_col: Column name for features in the matrix file. + mat_target_col: Column name for samples in the matrix file. + mat_value_col: Column name for values in the matrix file. + net_source_col: Column name for regulators in the network file. + net_target_col: Column name for targets in the network file. + net_weight_col: Column name for interaction weights in the network file. + min_n: Minimum number of targets per regulator. + batch_size: Number of samples to process per batch. + times: Number of permutations to perform. + min_sz: Minimum size of a gene set to be considered. + max_sz: Maximum size of a gene set to be considered. + seed: Random seed for permutations. + verbose: If True, increases verbosity. + """ + # Input validation + if not mat.is_file(): + raise FileNotFoundError(f"Input matrix file not found: {mat}") + if not net.is_file(): + raise FileNotFoundError(f"Input network file not found: {net}") + if min_n < 1: + raise ValueError("min_n must be a positive integer.") + if batch_size < 1: + raise ValueError("batch_size must be a positive integer.") + if times < 1: + raise ValueError("times must be a positive integer.") + if min_sz < 1: + raise ValueError("min_sz must be a positive integer.") + if max_sz < min_sz: + raise ValueError("max_sz must be greater than or equal to min_sz.") + + output.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "python", "-m", "decoupler", "gsea", + "--mat", str(mat), + "--net", str(net), + "--output", str(output), + "--mat-source-col", mat_source_col, + "--mat-target-col", mat_target_col, + "--mat-value-col", mat_value_col, + "--net-source-col", net_source_col, + "--net-target-col", net_target_col, + "--net-weight-col", net_weight_col, + "--min-n", str(min_n), + "--batch-size", str(batch_size), + "--times", str(times), + "--min-sz", str(min_sz), + "--max-sz", str(max_sz), + "--seed", str(seed), + ] + if verbose: + cmd.append("--verbose") + + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(e.cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [] + } + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(output)] + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..aea17c8ba6fdb5e501100ca59977ddac4ee16262 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/app/decoupler_server.py') +SERVER_NAME = 'biosci_decoupler' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..22f3efd81dab73f998d976fd326fd2e380848eeb --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-decoupler: + build: . + image: mcp-decoupler:latest + container_name: mcp-decoupler + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=decoupler + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6a5b7a5c89f50dc67d9a15ca2e32f2b1b7d5d2dc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - decoupler + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_decoupler/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b366d486cfa17d61cf0e4df2c8805f0e78f166a6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install delly via conda (e.g., from bioconda) +RUN conda install -c bioconda delly -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/delly_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/delly_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/delly_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_server.py new file mode 100644 index 0000000000000000000000000000000000000000..be63e483de737f04e088cce83fe62273394546fe --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_server.py @@ -0,0 +1,401 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional, Literal, Union + +# Assume mcp is imported and available in the environment where this code runs. +# For the purpose of this exercise, we don't need to import it explicitly here. +# from mcp import tool + +@mcp.tool() +def delly_call( + reference_genome: Path, + output_bcf: Path, + input_bams: List[Path], + sv_type: Literal["DEL", "DUP", "INV", "TRA", "INS", "ALL"] = "ALL", + exclude_regions: Optional[Path] = None, + min_map_qual: int = 1, + min_variant_qual: int = 5, + min_sv_size: int = 50, + max_sv_size: int = 1000000, + min_reciprocal_overlap: float = 0.5, + call_cnvs: bool = False, + regions_to_analyze: Optional[Path] = None, + genotype_zygosity: bool = True, + batch_mode: bool = False, + debug_output: bool = False, +) -> dict: + """ + Discover and genotype structural variants using Delly. + + Args: + reference_genome: Reference genome in FASTA format. + output_bcf: Output BCF/VCF file path. + input_bams: List of input BAM/CRAM files. + sv_type: Structural variant type to discover. Can be DEL, DUP, INV, TRA, INS, or ALL. + exclude_regions: BED file of regions to exclude from analysis. + min_map_qual: Minimum mapping quality. + min_variant_qual: Minimum variant quality. + min_sv_size: Minimum SV size. + max_sv_size: Maximum SV size. + min_reciprocal_overlap: Minimum reciprocal overlap for merging. + call_cnvs: Call CNVs (DEL/DUP). + regions_to_analyze: BED file of regions to analyze. + genotype_zygosity: Genotype zygosity. + batch_mode: Process multiple samples together in batch mode. + debug_output: Enable debug output. + + Returns: + A dictionary containing command execution details, stdout, stderr, and output files. + """ + # Input validation + if not reference_genome.exists(): + raise FileNotFoundError(f"Reference genome file not found: {reference_genome}") + if not reference_genome.is_file(): + raise ValueError(f"Reference genome path is not a file: {reference_genome}") + + for bam_file in input_bams: + if not bam_file.exists(): + raise FileNotFoundError(f"Input BAM/CRAM file not found: {bam_file}") + if not bam_file.is_file(): + raise ValueError(f"Input BAM/CRAM path is not a file: {bam_file}") + + if exclude_regions and not exclude_regions.exists(): + raise FileNotFoundError(f"Exclude regions file not found: {exclude_regions}") + if exclude_regions and not exclude_regions.is_file(): + raise ValueError(f"Exclude regions path is not a file: {exclude_regions}") + + if regions_to_analyze and not regions_to_analyze.exists(): + raise FileNotFoundError(f"Regions to analyze file not found: {regions_to_analyze}") + if regions_to_analyze and not regions_to_analyze.is_file(): + raise ValueError(f"Regions to analyze path is not a file: {regions_to_analyze}") + + if min_map_qual < 0: + raise ValueError("Minimum mapping quality must be non-negative.") + if min_variant_qual < 0: + raise ValueError("Minimum variant quality must be non-negative.") + if min_sv_size < 0: + raise ValueError("Minimum SV size must be non-negative.") + if max_sv_size < min_sv_size: + raise ValueError("Maximum SV size cannot be less than minimum SV size.") + if not (0.0 <= min_reciprocal_overlap <= 1.0): + raise ValueError("Minimum reciprocal overlap must be between 0.0 and 1.0.") + + command = [ + "delly", + "call", + "-g", str(reference_genome), + "-v", str(output_bcf), + ] + + if sv_type != "ALL": + command.extend(["-t", sv_type]) + if exclude_regions: + command.extend(["-x", str(exclude_regions)]) + if min_map_qual != 1: + command.extend(["-m", str(min_map_qual)]) + if min_variant_qual != 5: + command.extend(["-q", str(min_variant_qual)]) + if min_sv_size != 50: + command.extend(["-s", str(min_sv_size)]) + if max_sv_size != 1000000: + command.extend(["-u", str(max_sv_size)]) + if min_reciprocal_overlap != 0.5: + command.extend(["-o", str(min_reciprocal_overlap)]) + if call_cnvs: + command.append("-c") + if regions_to_analyze: + command.extend(["-r", str(regions_to_analyze)]) + if not genotype_zygosity: # Assuming -z enables it, so no -z means disable + # Delly's default is usually to genotype. If there's a flag to disable, it would be like --no-zygosity. + # For now, assuming -z is a flag to enable, and if not present, it might be default or not done. + # If the tool has a specific flag to *disable* zygosity, this logic needs adjustment. + # Based on common CLI patterns, if -z enables, then not including it means it's off or default. + # Let's assume -z is a flag to *enable* zygosity, and if not provided, it's off or default. + # If the default is true, and we want to disable, there should be a flag like --no-zygosity. + # Given the assumed help, let's assume -z is a flag to *enable* it, and if not present, it's off. + # Re-evaluating: "Genotype zygosity (default: true)". This implies if we want to disable, we need a flag. + # Since no explicit flag to disable is given, we'll assume `genotype_zygosity=True` means we don't need to add a flag, + # and `genotype_zygosity=False` means we need a flag like `--no-zygosity` which is not in the assumed help. + # For now, I will omit adding a flag if `genotype_zygosity` is True, and if False, I will raise an error + # because there's no clear way to disable it based on the assumed help. + # A better approach: if default is true, and no flag to disable, then the parameter should probably be removed + # or assumed to always be true. Let's assume it's always true if the default is true and no disable flag. + pass # No flag to explicitly disable based on assumed help. + if batch_mode: + command.append("-b") + if debug_output: + command.append("-d") + + command.extend([str(bam) for bam in input_bams]) + + command_executed = " ".join(command) + stdout = "" + stderr = "" + output_files = [] + + try: + process = subprocess.run( + command, + check=True, + capture_output=True, + text=True, + encoding="utf-8" + ) + stdout = process.stdout + stderr = process.stderr + output_files.append(str(output_bcf.resolve())) + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "returncode": e.returncode, + "output_files": [], + } + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: delly executable not found. Is it in your PATH?", + "error": "delly executable not found", + "returncode": 127, + "output_files": [], + } + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + + +@mcp.tool() +def delly_merge( + output_bcf: Path, + input_bcfs: List[Path], + min_overlap: float = 0.5, + sv_type: Literal["DEL", "DUP", "INV", "TRA", "INS", "ALL"] = "ALL", + max_distance: int = 1000, + filter_overlap: float = 0.0, + cluster_variants: bool = False, +) -> dict: + """ + Merge structural variants across VCF/BCF files and within a single VCF/BCF file. + + Args: + output_bcf: Output BCF/VCF file path. + input_bcfs: List of input BCF/VCF files to merge. + min_overlap: Minimum reciprocal overlap for merging. + sv_type: Structural variant type to merge. Can be DEL, DUP, INV, TRA, INS, or ALL. + max_distance: Maximum distance between breakpoints for merging. + filter_overlap: Filter variants with overlap (e.g., 0.0 to disable). + cluster_variants: Cluster variants within a single file. + + Returns: + A dictionary containing command execution details, stdout, stderr, and output files. + """ + # Input validation + for bcf_file in input_bcfs: + if not bcf_file.exists(): + raise FileNotFoundError(f"Input BCF/VCF file not found: {bcf_file}") + if not bcf_file.is_file(): + raise ValueError(f"Input BCF/VCF path is not a file: {bcf_file}") + + if not (0.0 <= min_overlap <= 1.0): + raise ValueError("Minimum overlap must be between 0.0 and 1.0.") + if max_distance < 0: + raise ValueError("Maximum distance must be non-negative.") + if not (0.0 <= filter_overlap <= 1.0): + raise ValueError("Filter overlap must be between 0.0 and 1.0.") + + command = [ + "delly", + "merge", + "-o", str(output_bcf), + ] + + if min_overlap != 0.5: + command.extend(["-m", str(min_overlap)]) + if sv_type != "ALL": + command.extend(["-s", sv_type]) + if max_distance != 1000: + command.extend(["-d", str(max_distance)]) + if filter_overlap != 0.0: + command.extend(["-f", str(filter_overlap)]) + if cluster_variants: + command.append("-c") + + command.extend([str(bcf) for bcf in input_bcfs]) + + command_executed = " ".join(command) + stdout = "" + stderr = "" + output_files = [] + + try: + process = subprocess.run( + command, + check=True, + capture_output=True, + text=True, + encoding="utf-8" + ) + stdout = process.stdout + stderr = process.stderr + output_files.append(str(output_bcf.resolve())) + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "returncode": e.returncode, + "output_files": [], + } + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: delly executable not found. Is it in your PATH?", + "error": "delly executable not found", + "returncode": 127, + "output_files": [], + } + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + + +@mcp.tool() +def delly_filter( + input_bcf: Path, + output_bcf: Path, + filter_file: Optional[Path] = None, + filter_type: Literal["somatic", "germline"] = "somatic", + regions_to_filter: Optional[Path] = None, + min_variant_qual: int = 5, + min_read_depth: int = 10, + min_vaf: float = 0.1, + min_allele_frequency: float = 0.0, + exclude_regions: Optional[Path] = None, +) -> dict: + """ + Filter somatic or germline structural variants. + + Args: + input_bcf: Input BCF/VCF file to filter. + output_bcf: Output BCF/VCF file path. + filter_file: BCF/VCF file with variants to filter against (required for some modes). + filter_type: Filter type (somatic or germline). + regions_to_filter: BED file of regions to filter. + min_variant_qual: Minimum variant quality. + min_read_depth: Minimum read depth. + min_vaf: Minimum variant allele frequency. + min_allele_frequency: Minimum allele frequency in population. + exclude_regions: BED file of regions to exclude from filtering. + + Returns: + A dictionary containing command execution details, stdout, stderr, and output files. + """ + # Input validation + if not input_bcf.exists(): + raise FileNotFoundError(f"Input BCF/VCF file not found: {input_bcf}") + if not input_bcf.is_file(): + raise ValueError(f"Input BCF/VCF path is not a file: {input_bcf}") + + if filter_file and not filter_file.exists(): + raise FileNotFoundError(f"Filter file not found: {filter_file}") + if filter_file and not filter_file.is_file(): + raise ValueError(f"Filter file path is not a file: {filter_file}") + + if regions_to_filter and not regions_to_filter.exists(): + raise FileNotFoundError(f"Regions to filter file not found: {regions_to_filter}") + if regions_to_filter and not regions_to_filter.is_file(): + raise ValueError(f"Regions to filter path is not a file: {regions_to_filter}") + + if exclude_regions and not exclude_regions.exists(): + raise FileNotFoundError(f"Exclude regions file not found: {exclude_regions}") + if exclude_regions and not exclude_regions.is_file(): + raise ValueError(f"Exclude regions path is not a file: {exclude_regions}") + + if min_variant_qual < 0: + raise ValueError("Minimum variant quality must be non-negative.") + if min_read_depth < 0: + raise ValueError("Minimum read depth must be non-negative.") + if not (0.0 <= min_vaf <= 1.0): + raise ValueError("Minimum VAF must be between 0.0 and 1.0.") + if not (0.0 <= min_allele_frequency <= 1.0): + raise ValueError("Minimum allele frequency must be between 0.0 and 1.0.") + + command = [ + "delly", + "filter", + "-o", str(output_bcf), + str(input_bcf), + ] + + if filter_file: + command.extend(["-f", str(filter_file)]) + if filter_type != "somatic": + command.extend(["-t", filter_type]) + if regions_to_filter: + command.extend(["-r", str(regions_to_filter)]) + if min_variant_qual != 5: + command.extend(["-q", str(min_variant_qual)]) + if min_read_depth != 10: + command.extend(["-d", str(min_read_depth)]) + if min_vaf != 0.1: + command.extend(["-v", str(min_vaf)]) + if min_allele_frequency != 0.0: + command.extend(["-a", str(min_allele_frequency)]) + if exclude_regions: + command.extend(["-x", str(exclude_regions)]) + + command_executed = " ".join(command) + stdout = "" + stderr = "" + output_files = [] + + try: + process = subprocess.run( + command, + check=True, + capture_output=True, + text=True, + encoding="utf-8" + ) + stdout = process.stdout + stderr = process.stderr + output_files.append(str(output_bcf.resolve())) + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "returncode": e.returncode, + "output_files": [], + } + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: delly executable not found. Is it in your PATH?", + "error": "delly executable not found", + "returncode": 127, + "output_files": [], + } + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f3f746a74deec40591041b0c1a613f45af9679fd --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/delly_server.py') +SERVER_NAME = 'biosci_delly' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..3d263a79b1b4afc953f99195066dd01c5e1e94e3 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-delly: + build: . + image: mcp-delly:latest + container_name: mcp-delly + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=delly + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0807f33b5ba4db9b38fd918a18310c4fffecfed7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - delly + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_delly/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..45453ff079d2ea01a8a9fd05a5533a9fd28126a0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install dendropy via conda (e.g., from bioconda) +RUN conda install -c bioconda dendropy -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/dendropy_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/dendropy_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/dendropy_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6efe777fe46c740d6c14621d206026182628c124 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_server.py @@ -0,0 +1,297 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional, Dict, Any + +# @mcp.tool decorator is assumed to be provided by the MCP framework. +# This is a placeholder for the purpose of this example. +def tool(*args, **kwargs): + def decorator(f): + return f + return decorator + +mcp = type("mcp", (), {"tool": tool}) + + +@mcp.tool() +def sumtrees( + tree_files: List[Path], + output_path: Optional[Path] = None, + input_schema: str = "nexus", + target_tree: Optional[Path] = None, + output_schema: Optional[str] = None, + support_as_labels: bool = False, + no_support_as_labels: bool = False, + burnin: int = 0, + edges: Optional[int] = None, + min_freq: float = 0.0, + no_summary: bool = False, +) -> Dict[str, Any]: + """ + Summarizes sets of trees by calculating support values on a target tree or generating a consensus tree. + + This tool corresponds to the 'dendropy sumtrees' command. + """ + # --- Input Validation --- + if not tree_files: + raise ValueError("At least one tree file must be provided in 'tree_files'.") + for f in tree_files: + if not f.exists(): + raise FileNotFoundError(f"Input tree file not found: {f}") + + VALID_SCHEMAS = ["nexus", "newick", "nexml"] + if input_schema.lower() not in VALID_SCHEMAS: + raise ValueError(f"Invalid input_schema '{input_schema}'. Must be one of {VALID_SCHEMAS}") + + if target_tree and not target_tree.exists(): + raise FileNotFoundError(f"Target tree file not found: {target_tree}") + + VALID_OUTPUT_SCHEMAS = ["newick", "nexus", "phylip"] + if output_schema and output_schema.lower() not in VALID_OUTPUT_SCHEMAS: + raise ValueError(f"Invalid output_schema '{output_schema}'. Must be one of {VALID_OUTPUT_SCHEMAS}") + + if support_as_labels and no_support_as_labels: + raise ValueError("'support_as_labels' and 'no_support_as_labels' are mutually exclusive.") + + if burnin < 0: + raise ValueError("'burnin' must be a non-negative integer.") + + if edges is not None and edges < 0: + raise ValueError("'edges' must be a non-negative integer.") + + if not (0.0 <= min_freq <= 1.0): + raise ValueError("'min_freq' must be between 0.0 and 1.0.") + + # --- Command Construction --- + cmd = ["python", "-m", "dendropy", "sumtrees"] + output_files = {} + + if output_path: + cmd.extend(["-o", str(output_path)]) + output_files["summary_tree"] = str(output_path) + + cmd.extend(["-f", input_schema.lower()]) + + if target_tree: + cmd.extend(["-t", str(target_tree)]) + + if output_schema: + cmd.append(f"--to-{output_schema.lower()}") + + if support_as_labels: + cmd.append("--support-as-labels") + if no_support_as_labels: + cmd.append("--no-support-as-labels") + + if burnin > 0: + cmd.extend(["-b", str(burnin)]) + if edges is not None: + cmd.extend(["-e", str(edges)]) + if min_freq > 0.0: + cmd.extend(["-l", str(min_freq)]) + if no_summary: + cmd.append("--no-summary") + + cmd.extend([str(f) for f in tree_files]) + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"DendroPy sumtrees failed with exit code {e.returncode}\n" + f"Stderr: {e.stderr}\n" + f"Stdout: {e.stdout}" + ) from e + + +@mcp.tool() +def sumlabels( + tree_files: List[Path], + output_path: Optional[Path] = None, + input_schema: str = "nexus", + summary_type: str = "frequency", +) -> Dict[str, Any]: + """ + Summarizes taxon labels found in a set of tree files. + + This tool corresponds to the 'dendropy sumlabels' command. + """ + # --- Input Validation --- + if not tree_files: + raise ValueError("At least one tree file must be provided in 'tree_files'.") + for f in tree_files: + if not f.exists(): + raise FileNotFoundError(f"Input tree file not found: {f}") + + VALID_SCHEMAS = ["nexus", "newick", "nexml"] + if input_schema.lower() not in VALID_SCHEMAS: + raise ValueError(f"Invalid input_schema '{input_schema}'. Must be one of {VALID_SCHEMAS}") + + VALID_SUMMARY_TYPES = ["frequency", "count", "presence"] + if summary_type.lower() not in VALID_SUMMARY_TYPES: + raise ValueError(f"Invalid summary_type '{summary_type}'. Must be one of {VALID_SUMMARY_TYPES}") + + # --- Command Construction --- + cmd = ["python", "-m", "dendropy", "sumlabels"] + output_files = {} + + if output_path: + cmd.extend(["-o", str(output_path)]) + output_files["label_summary"] = str(output_path) + + cmd.extend(["-f", input_schema.lower()]) + cmd.extend(["-s", summary_type.lower()]) + cmd.extend([str(f) for f in tree_files]) + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"DendroPy sumlabels failed with exit code {e.returncode}\n" + f"Stderr: {e.stderr}\n" + f"Stdout: {e.stdout}" + ) from e + + +@mcp.tool() +def treeconv( + input_path: Path, + output_path: Path, + input_schema: str, + output_schema: str, + preserve_underscores: bool = False, + suppress_internal_node_labels: bool = False, +) -> Dict[str, Any]: + """ + Converts tree files from one format to another. + + This tool corresponds to the 'dendropy treeconv' command. + """ + # --- Input Validation --- + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_path}") + + SUPPORTED_FORMATS = ["nexus", "newick", "nexml"] + if input_schema.lower() not in SUPPORTED_FORMATS: + raise ValueError(f"Invalid input_schema '{input_schema}'. Must be one of {SUPPORTED_FORMATS}") + if output_schema.lower() not in SUPPORTED_FORMATS: + raise ValueError(f"Invalid output_schema '{output_schema}'. Must be one of {SUPPORTED_FORMATS}") + + # --- Command Construction --- + cmd = ["python", "-m", "dendropy", "treeconv"] + cmd.extend(["-i", str(input_path)]) + cmd.extend(["-o", str(output_path)]) + cmd.extend(["--input-format", input_schema.lower()]) + cmd.extend(["--output-format", output_schema.lower()]) + + if preserve_underscores: + cmd.append("--preserve-underscores") + if suppress_internal_node_labels: + cmd.append("--suppress-internal-node-labels") + + output_files = {"converted_tree": str(output_path)} + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"DendroPy treeconv failed with exit code {e.returncode}\n" + f"Stderr: {e.stderr}\n" + f"Stdout: {e.stdout}" + ) from e + + +@mcp.tool() +def seqconv( + input_path: Path, + output_path: Path, + input_schema: str, + output_schema: str, + interleave: bool = False, + preserve_underscores: bool = False, +) -> Dict[str, Any]: + """ + Converts sequence alignment files from one format to another. + + This tool corresponds to the 'dendropy seqconv' command. + """ + # --- Input Validation --- + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_path}") + + SUPPORTED_FORMATS = ["nexus", "fasta", "phylip"] + if input_schema.lower() not in SUPPORTED_FORMATS: + raise ValueError(f"Invalid input_schema '{input_schema}'. Must be one of {SUPPORTED_FORMATS}") + if output_schema.lower() not in SUPPORTED_FORMATS: + raise ValueError(f"Invalid output_schema '{output_schema}'. Must be one of {SUPPORTED_FORMATS}") + + # --- Command Construction --- + cmd = ["python", "-m", "dendropy", "seqconv"] + cmd.extend(["-i", str(input_path)]) + cmd.extend(["-o", str(output_path)]) + cmd.extend(["--input-format", input_schema.lower()]) + cmd.extend(["--output-format", output_schema.lower()]) + + if interleave: + cmd.append("--interleave") + if preserve_underscores: + cmd.append("--preserve-underscores") + + output_files = {"converted_sequences": str(output_path)} + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"DendroPy seqconv failed with exit code {e.returncode}\n" + f"Stderr: {e.stderr}\n" + f"Stdout: {e.stdout}" + ) from e \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..fca3ac2fcf1da22da24d7868974abcb9655e3331 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/dendropy_server.py') +SERVER_NAME = 'biosci_dendropy' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..2de997aab333e2dc929a851372cdabf5ade4fc93 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-dendropy: + build: . + image: mcp-dendropy:latest + container_name: mcp-dendropy + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=dendropy + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4ab49e61a4ca54072f87f5c362e6acca9a8b32f9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - dendropy + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dendropy/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4b183796887d2e6a7f602cf564f15b546e57573d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install diamond via conda (e.g., from bioconda) +RUN conda install -c bioconda diamond -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/diamond_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/diamond_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/diamond_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_server.py new file mode 100644 index 0000000000000000000000000000000000000000..25ba2c28e0bb4a2de1c9591f06047accd95b7700 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_server.py @@ -0,0 +1,953 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional + +# Assuming @mcp.tool is available in the environment. + +@mcp.tool() +def makedb( + in_file: Path, + db_file: Path, + threads: int = 16, + verbose: bool = False, + log: bool = False, + quiet: bool = False, + taxonmap: Optional[Path] = None, + taxonnodes: Optional[Path] = None, + taxonnames: Optional[Path] = None, + taxon_exclude: Optional[str] = None, + block_size: float = 2.0, + bucket: int = 4, + no_parse_seqids: bool = False, + long_reads: bool = False, + orf_filter: int = 20, + in_format: str = "fasta", + file_buffer_size: int = 67108864, + ignore_warnings: bool = False, +): + """ + Build a DIAMOND database from a FASTA file. + + Args: + in_file: Input reference file in FASTA format. + db_file: Output DIAMOND database file. + threads: Number of CPU threads. + verbose: Verbose console output. + log: Enable debug log. + quiet: Disable console output. + taxonmap: Protein accession to NCBI taxon ID mapping file. + taxonnodes: NCBI nodes.dmp file. + taxonnames: NCBI names.dmp file. + taxon_exclude: Comma-separated list of NCBI taxon IDs to exclude. + block_size: Sequence block size in billions of letters. + bucket: Number of buckets for hash table. + no_parse_seqids: Disable parsing of sequence IDs. + long_reads: Enable long read mode for more accurate ORF calling. + orf_filter: Filter ORFs by length (aa). + in_format: Input format (fasta/fastq/prb). + file_buffer_size: File buffer size in bytes. + ignore_warnings: Ignore warnings. + """ + if not in_file.exists(): + raise FileNotFoundError(f"Input file not found: {in_file}") + if in_format not in ["fasta", "fastq", "prb"]: + raise ValueError("in_format must be one of 'fasta', 'fastq', 'prb'.") + + cmd = [ + "diamond", "makedb", + "--in", str(in_file), + "--db", str(db_file), + "--threads", str(threads), + "--block-size", str(block_size), + "--bucket", str(bucket), + "--orf-filter", str(orf_filter), + "--in-format", in_format, + "--file-buffer-size", str(file_buffer_size), + ] + + if verbose: cmd.append("--verbose") + if log: cmd.append("--log") + if quiet: cmd.append("--quiet") + if taxonmap: cmd.extend(["--taxonmap", str(taxonmap)]) + if taxonnodes: cmd.extend(["--taxonnodes", str(taxonnodes)]) + if taxonnames: cmd.extend(["--taxonnames", str(taxonnames)]) + if taxon_exclude: cmd.extend(["--taxon-exclude", taxon_exclude]) + if no_parse_seqids: cmd.append("--no-parse-seqids") + if long_reads: cmd.append("--long-reads") + if ignore_warnings: cmd.append("--ignore-warnings") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(db_file)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "DIAMOND makedb failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +@mcp.tool() +def prepdb( + in_blast_db: Path, + out_diamond_db: Path, + threads: int = 16, + verbose: bool = False, + log: bool = False, + quiet: bool = False, + taxonmap: Optional[Path] = None, + taxonnodes: Optional[Path] = None, + taxonnames: Optional[Path] = None, + taxon_exclude: Optional[str] = None, + block_size: float = 2.0, + bucket: int = 4, + no_parse_seqids: bool = False, + file_buffer_size: int = 67108864, + ignore_warnings: bool = False, +): + """ + Prepare a BLAST database for use with Diamond. + + Args: + in_blast_db: Input BLAST database prefix. + out_diamond_db: Output DIAMOND database file. + threads: Number of CPU threads. + verbose: Verbose console output. + log: Enable debug log. + quiet: Disable console output. + taxonmap: Protein accession to NCBI taxon ID mapping file. + taxonnodes: NCBI nodes.dmp file. + taxonnames: NCBI names.dmp file. + taxon_exclude: Comma-separated list of NCBI taxon IDs to exclude. + block_size: Sequence block size in billions of letters. + bucket: Number of buckets for hash table. + no_parse_seqids: Disable parsing of sequence IDs. + file_buffer_size: File buffer size in bytes. + ignore_warnings: Ignore warnings. + """ + # BLAST DBs are often specified by prefix, so we check for common extensions. + if not any(in_blast_db.with_suffix(s).exists() for s in ['.pin', '.psq', '.phr']): + print(f"Warning: BLAST DB input '{in_blast_db}' not found with common extensions (.pin, .psq, .phr).") + + cmd = [ + "diamond", "prepdb", + "--in", str(in_blast_db), + "--db", str(out_diamond_db), + "--threads", str(threads), + "--block-size", str(block_size), + "--bucket", str(bucket), + "--file-buffer-size", str(file_buffer_size), + ] + + if verbose: cmd.append("--verbose") + if log: cmd.append("--log") + if quiet: cmd.append("--quiet") + if taxonmap: cmd.extend(["--taxonmap", str(taxonmap)]) + if taxonnodes: cmd.extend(["--taxonnodes", str(taxonnodes)]) + if taxonnames: cmd.extend(["--taxonnames", str(taxonnames)]) + if taxon_exclude: cmd.extend(["--taxon-exclude", taxon_exclude]) + if no_parse_seqids: cmd.append("--no-parse-seqids") + if ignore_warnings: cmd.append("--ignore-warnings") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_diamond_db)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "DIAMOND prepdb failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +def _run_blast( + command: str, + db: Path, + query: Path, + out: Optional[Path] = None, + daa: Optional[Path] = None, + threads: int = 16, + verbose: bool = False, + log: bool = False, + quiet: bool = False, + outfmt: str = "6", + matrix: str = "BLOSUM62", + gapopen: int = 11, + gapextend: int = 1, + frameshift: Optional[int] = None, + long_reads: bool = False, + unal: int = 0, + max_target_seqs: int = 25, + top: float = 100.0, + compress: int = 0, + evalue: float = 0.001, + min_score: int = 0, + identity: float = 0.0, + query_cover: int = 0, + subject_cover: int = 0, + sensitive: bool = False, + more_sensitive: bool = False, + block_size: float = 2.0, + index_chunks: int = 4, + tmpdir: Optional[Path] = None, + dbsize: Optional[int] = None, + no_self_hits: bool = False, + salltitles: bool = False, + taxonlist: Optional[str] = None, + query_gencode: Optional[int] = None, + sorthits: int = 0, + max_hsps: int = 1, + comp_based_stats: int = 1, + masking: str = "seg", + strand: Optional[str] = None, + min_orf: Optional[int] = None, + header: bool = False, + no_header: bool = False, +): + """Internal helper function for blastp and blastx.""" + if not db.with_suffix(".dmnd").exists(): + raise FileNotFoundError(f"Database file not found: {db.with_suffix('.dmnd')}") + if not query.exists(): + raise FileNotFoundError(f"Query file not found: {query}") + if not out and not daa: + raise ValueError("Either 'out' or 'daa' must be specified for the output file.") + if out and daa: + raise ValueError("Specify either 'out' or 'daa', but not both.") + if sensitive and more_sensitive: + raise ValueError("Specify either 'sensitive' or 'more_sensitive', but not both.") + if header and no_header: + raise ValueError("Specify either 'header' or 'no_header', but not both.") + + cmd = [ + "diamond", command, + "--db", str(db), + "--query", str(query), + "--threads", str(threads), + "--outfmt", outfmt, + "--matrix", matrix, + "--gapopen", str(gapopen), + "--gapextend", str(gapextend), + "--unal", str(unal), + "--max-target-seqs", str(max_target_seqs), + "--top", str(top), + "--compress", str(compress), + "--evalue", str(evalue), + "--min-score", str(min_score), + "--id", str(identity), + "--query-cover", str(query_cover), + "--subject-cover", str(subject_cover), + "--block-size", str(block_size), + "--index-chunks", str(index_chunks), + "--sorthits", str(sorthits), + "--max-hsps", str(max_hsps), + "--comp-based-stats", str(comp_based_stats), + "--masking", masking, + ] + + output_file = out if out else daa + if out: cmd.extend(["--out", str(out)]) + if daa: cmd.extend(["--daa", str(daa)]) + if verbose: cmd.append("--verbose") + if log: cmd.append("--log") + if quiet: cmd.append("--quiet") + if frameshift is not None: cmd.extend(["--frameshift", str(frameshift)]) + if long_reads: cmd.append("--long-reads") + if sensitive: cmd.append("--sensitive") + if more_sensitive: cmd.append("--more-sensitive") + if tmpdir: cmd.extend(["--tmpdir", str(tmpdir)]) + if dbsize is not None: cmd.extend(["--dbsize", str(dbsize)]) + if no_self_hits: cmd.append("--no-self-hits") + if salltitles: cmd.append("--salltitles") + if taxonlist: cmd.extend(["--taxonlist", taxonlist]) + if query_gencode is not None: cmd.extend(["--query-gencode", str(query_gencode)]) + if strand: cmd.extend(["--strand", strand]) + if min_orf is not None: cmd.extend(["--min-orf", str(min_orf)]) + if header: cmd.append("--header") + if no_header: cmd.append("--no-header") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(output_file)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": f"DIAMOND {command} failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +@mcp.tool() +def blastp( + db: Path, + query: Path, + out: Optional[Path] = None, + daa: Optional[Path] = None, + threads: int = 16, + verbose: bool = False, + log: bool = False, + quiet: bool = False, + outfmt: str = "6", + matrix: str = "BLOSUM62", + gapopen: int = 11, + gapextend: int = 1, + unal: int = 0, + max_target_seqs: int = 25, + top: float = 100.0, + compress: int = 0, + evalue: float = 0.001, + min_score: int = 0, + identity: float = 0.0, + query_cover: int = 0, + subject_cover: int = 0, + sensitive: bool = False, + more_sensitive: bool = False, + block_size: float = 2.0, + index_chunks: int = 4, + tmpdir: Optional[Path] = None, + dbsize: Optional[int] = None, + no_self_hits: bool = False, + salltitles: bool = False, + taxonlist: Optional[str] = None, + sorthits: int = 0, + max_hsps: int = 1, + comp_based_stats: int = 1, + masking: str = "seg", + header: bool = False, + no_header: bool = False, +): + """ + Align amino acid query sequences against a protein reference database. + + Args: + db: DIAMOND database file (.dmnd). + query: Input query file (FASTA). + out: Output alignment file. Mutually exclusive with 'daa'. + daa: Output DIAMOND Alignment Archive (DAA) file. Mutually exclusive with 'out'. + threads: Number of CPU threads. + outfmt: Output format (e.g., '6 qseqid sseqid' for tabular). + matrix: Score matrix. + gapopen: Gap open penalty. + gapextend: Gap extend penalty. + unal: Report unaligned queries (0=no, 1=yes). + max_target_seqs: Maximum number of target sequences to report. + top: Report alignments within this percentage of top score. + compress: Compression for output files (0=none, 1=gzip). + evalue: Maximum e-value to report. + min_score: Minimum bit score to report. + identity: Minimum identity percentage to report. + query_cover: Minimum query cover percentage to report. + subject_cover: Minimum subject cover percentage to report. + sensitive: Use sensitive alignment mode. + more_sensitive: Use more sensitive alignment mode. + block_size: Sequence block size in billions of letters. + index_chunks: Number of chunks for index processing. + tmpdir: Directory for temporary files. + dbsize: Effective database size (in letters). + no_self_hits: Suppress reporting of query-subject self hits. + salltitles: Print all subject titles in the database. + taxonlist: Comma-separated list of NCBI taxon IDs to search in. + sorthits: Sort hits by (0=query, 1=bitscore, 2=evalue). + max_hsps: Maximum number of HSPs to save per subject sequence. + comp_based_stats: Compositional based statistics mode (0=off, 1=on). + masking: Sequence masking (none/seg/tantan). + header: Print header line in tabular format. + no_header: Do not print header line in tabular format. + """ + return _run_blast( + command="blastp", db=db, query=query, out=out, daa=daa, threads=threads, + verbose=verbose, log=log, quiet=quiet, outfmt=outfmt, matrix=matrix, + gapopen=gapopen, gapextend=gapextend, unal=unal, max_target_seqs=max_target_seqs, + top=top, compress=compress, evalue=evalue, min_score=min_score, identity=identity, + query_cover=query_cover, subject_cover=subject_cover, sensitive=sensitive, + more_sensitive=more_sensitive, block_size=block_size, index_chunks=index_chunks, + tmpdir=tmpdir, dbsize=dbsize, no_self_hits=no_self_hits, salltitles=salltitles, + taxonlist=taxonlist, sorthits=sorthits, max_hsps=max_hsps, + comp_based_stats=comp_based_stats, masking=masking, header=header, no_header=no_header + ) + +@mcp.tool() +def blastx( + db: Path, + query: Path, + out: Optional[Path] = None, + daa: Optional[Path] = None, + threads: int = 16, + verbose: bool = False, + log: bool = False, + quiet: bool = False, + outfmt: str = "6", + matrix: str = "BLOSUM62", + gapopen: int = 11, + gapextend: int = 1, + frameshift: int = 0, + long_reads: bool = False, + unal: int = 0, + max_target_seqs: int = 25, + top: float = 100.0, + compress: int = 0, + evalue: float = 0.001, + min_score: int = 0, + identity: float = 0.0, + query_cover: int = 0, + subject_cover: int = 0, + sensitive: bool = False, + more_sensitive: bool = False, + block_size: float = 2.0, + index_chunks: int = 4, + tmpdir: Optional[Path] = None, + dbsize: Optional[int] = None, + no_self_hits: bool = False, + salltitles: bool = False, + taxonlist: Optional[str] = None, + query_gencode: int = 1, + sorthits: int = 0, + max_hsps: int = 1, + comp_based_stats: int = 1, + masking: str = "seg", + strand: str = "both", + min_orf: int = 1, + header: bool = False, + no_header: bool = False, +): + """ + Align DNA query sequences against a protein reference database. + + Args: + db: DIAMOND database file (.dmnd). + query: Input query file (FASTA). + out: Output alignment file. Mutually exclusive with 'daa'. + daa: Output DIAMOND Alignment Archive (DAA) file. Mutually exclusive with 'out'. + threads: Number of CPU threads. + frameshift: Frame shift penalty. + long_reads: Enable long read mode for more accurate ORF calling. + query_gencode: Genetic code to use for query translation. + strand: Query strand to search (both/plus/minus). + min_orf: Ignore translated sequences shorter than this value. + (See blastp for other common arguments). + """ + if strand not in ["both", "plus", "minus"]: + raise ValueError("strand must be one of 'both', 'plus', 'minus'.") + + return _run_blast( + command="blastx", db=db, query=query, out=out, daa=daa, threads=threads, + verbose=verbose, log=log, quiet=quiet, outfmt=outfmt, matrix=matrix, + gapopen=gapopen, gapextend=gapextend, frameshift=frameshift, long_reads=long_reads, + unal=unal, max_target_seqs=max_target_seqs, top=top, compress=compress, + evalue=evalue, min_score=min_score, identity=identity, query_cover=query_cover, + subject_cover=subject_cover, sensitive=sensitive, more_sensitive=more_sensitive, + block_size=block_size, index_chunks=index_chunks, tmpdir=tmpdir, dbsize=dbsize, + no_self_hits=no_self_hits, salltitles=salltitles, taxonlist=taxonlist, + query_gencode=query_gencode, sorthits=sorthits, max_hsps=max_hsps, + comp_based_stats=comp_based_stats, masking=masking, strand=strand, min_orf=min_orf, + header=header, no_header=no_header + ) + +@mcp.tool() +def cluster( + in_file: Path, + db_file: Path, + out_file: Path, + daa_file: Optional[Path] = None, + threads: int = 16, + verbose: bool = False, + sensitive: bool = False, + more_sensitive: bool = False, + identity: float = 0.0, + query_cover: int = 0, + cluster_mode: int = 0, + approx_id: float = 0.0, + cluster_cover: int = 80, + cluster_algo: int = 0, + member_cover: int = 50, + centroid_cover: int = 50, + evalue: float = 0.001, + tmpdir: Optional[Path] = None, +): + """ + Cluster protein sequences. + + Args: + in_file: Input FASTA file. + db_file: Database file (can be the same as in_file). + out_file: Output cluster file. + daa_file: DIAMOND alignment archive (DAA) file. + threads: Number of CPU threads. + verbose: Verbose console output. + sensitive: Sensitive alignment mode. + more_sensitive: More sensitive alignment mode. + identity: Minimum identity percentage to report an alignment. + query_cover: Minimum query cover percentage to report an alignment. + cluster_mode: Clustering mode (0=greedy, 1=greedy connected components). + approx_id: Approximate minimum identity percentage. + cluster_cover: Minimum cover percentage for clustering. + cluster_algo: Clustering algorithm (0=greedy vertex cover, 1=connected components). + member_cover: Minimum member cover percentage. + centroid_cover: Minimum centroid cover percentage. + evalue: Maximum e-value to report alignments. + tmpdir: Directory for temporary files. + """ + if not in_file.exists(): + raise FileNotFoundError(f"Input file not found: {in_file}") + if not db_file.with_suffix(".dmnd").exists(): + raise FileNotFoundError(f"Database file not found: {db_file.with_suffix('.dmnd')}") + + cmd = [ + "diamond", "cluster", + "--in", str(in_file), + "--db", str(db_file), + "--out", str(out_file), + "--threads", str(threads), + "--id", str(identity), + "--query-cover", str(query_cover), + "--cluster-mode", str(cluster_mode), + "--approx-id", str(approx_id), + "--cluster-cover", str(cluster_cover), + "--cluster-algo", str(cluster_algo), + "--member-cover", str(member_cover), + "--centroid-cover", str(centroid_cover), + "--evalue", str(evalue), + ] + + if daa_file: cmd.extend(["--daa", str(daa_file)]) + if verbose: cmd.append("--verbose") + if sensitive: cmd.append("--sensitive") + if more_sensitive: cmd.append("--more-sensitive") + if tmpdir: cmd.extend(["--tmpdir", str(tmpdir)]) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(out_file)] + if daa_file: + output_files.append(str(daa_file)) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "DIAMOND cluster failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +@mcp.tool() +def linclust( + in_file: Path, + out_file: Path, + threads: int = 16, + min_seq_id: float = 0.9, + kmer_size: int = 6, + min_kmer_score: int = 1400, + coverage: int = 80, + rescore: str = "alignment", + tmpdir: Optional[Path] = None, + max_memory: int = 4, + verbose: bool = False, +): + """ + Cluster protein sequences in linear time. + + Args: + in_file: Input FASTA file. + out_file: Output cluster file. + threads: Number of CPU threads. + min_seq_id: Minimum sequence identity for clustering. + kmer_size: K-mer size. + min_kmer_score: Minimum k-mer score. + coverage: Minimum coverage. + rescore: Rescoring mode (none/alignment). + tmpdir: Directory for temporary files. + max_memory: Maximum memory in GB. + verbose: Verbose console output. + """ + if not in_file.exists(): + raise FileNotFoundError(f"Input file not found: {in_file}") + + cmd = [ + "diamond", "linclust", + "--in", str(in_file), + "--out", str(out_file), + "--threads", str(threads), + "--min-seq-id", str(min_seq_id), + "-k", str(kmer_size), + "--min-kmer-score", str(min_kmer_score), + "--coverage", str(coverage), + "--rescore", rescore, + "--mem", str(max_memory), + ] + + if tmpdir: cmd.extend(["--tmpdir", str(tmpdir)]) + if verbose: cmd.append("--verbose") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_file)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "DIAMOND linclust failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +@mcp.tool() +def realign( + in_file: Path, + out_file: Path, + clusters_file: Path, + threads: int = 16, + verbose: bool = False, +): + """ + Realign clustered sequences against their centroids. + + Args: + in_file: Input FASTA file containing sequences. + out_file: Output alignment file. + clusters_file: Cluster file from `diamond cluster`. + threads: Number of CPU threads. + verbose: Verbose console output. + """ + if not in_file.exists(): raise FileNotFoundError(f"Input file not found: {in_file}") + if not clusters_file.exists(): raise FileNotFoundError(f"Clusters file not found: {clusters_file}") + + cmd = ["diamond", "realign", "--in", str(in_file), "--out", str(out_file), "--clusters", str(clusters_file), "--threads", str(threads)] + if verbose: cmd.append("--verbose") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(out_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND realign failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def recluster( + in_file: Path, + out_file: Path, + clusters_file: Path, + threads: int = 16, + verbose: bool = False, +): + """ + Recompute clustering to fix errors. + + Args: + in_file: Input FASTA file containing sequences. + out_file: Output re-clustered file. + clusters_file: Original cluster file. + threads: Number of CPU threads. + verbose: Verbose console output. + """ + if not in_file.exists(): raise FileNotFoundError(f"Input file not found: {in_file}") + if not clusters_file.exists(): raise FileNotFoundError(f"Clusters file not found: {clusters_file}") + + cmd = ["diamond", "recluster", "--in", str(in_file), "--out", str(out_file), "--clusters", str(clusters_file), "--threads", str(threads)] + if verbose: cmd.append("--verbose") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(out_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND recluster failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def reassign( + in_file: Path, + out_file: Path, + clusters_file: Path, + threads: int = 16, + verbose: bool = False, +): + """ + Reassign clustered sequences to the closest centroid. + + Args: + in_file: Input FASTA file containing sequences. + out_file: Output reassigned cluster file. + clusters_file: Original cluster file. + threads: Number of CPU threads. + verbose: Verbose console output. + """ + if not in_file.exists(): raise FileNotFoundError(f"Input file not found: {in_file}") + if not clusters_file.exists(): raise FileNotFoundError(f"Clusters file not found: {clusters_file}") + + cmd = ["diamond", "reassign", "--in", str(in_file), "--out", str(out_file), "--clusters", str(clusters_file), "--threads", str(threads)] + if verbose: cmd.append("--verbose") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(out_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND reassign failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def view( + daa_file: Path, + out_file: Path, + threads: int = 16, + outfmt: str = "6", + forwardonly: bool = False, + header: bool = False, + no_header: bool = False, +): + """ + View a DIAMOND alignment archive (DAA) formatted file. + + Args: + daa_file: Input DIAMOND alignment archive (DAA) file. + out_file: Output file. + threads: Number of CPU threads. + outfmt: Output format (e.g., '6', '0', '5', '101'). + forwardonly: Only show forward alignments. + header: Print header line in tabular format. + no_header: Do not print header line in tabular format. + """ + if not daa_file.exists(): + raise FileNotFoundError(f"DAA file not found: {daa_file}") + if header and no_header: + raise ValueError("Specify either 'header' or 'no_header', but not both.") + + cmd = [ + "diamond", "view", + "--daa", str(daa_file), + "--out", str(out_file), + "--threads", str(threads), + "--outfmt", outfmt, + ] + + if forwardonly: cmd.append("--forwardonly") + if header: cmd.append("--header") + if no_header: cmd.append("--no-header") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_file)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "DIAMOND view failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode + } + +@mcp.tool() +def merge_daa( + daa_files: List[Path], + out_file: Path, +): + """ + Merge multiple DAA files into a single file. + + Args: + daa_files: List of DAA files to merge. + out_file: Output merged DAA file. + """ + if not daa_files: + raise ValueError("At least one DAA file must be provided.") + for f in daa_files: + if not f.exists(): + raise FileNotFoundError(f"DAA file not found: {f}") + + cmd = ["diamond", "merge-daa", "--out", str(out_file)] + for f in daa_files: + cmd.extend(["--daa", str(f)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(out_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND merge-daa failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def version(): + """Display DIAMOND version information.""" + cmd = ["diamond", "version"] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND version failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def getseq( + db_file: Path, + seq: Optional[str] = None, + seq_file: Optional[Path] = None, + out_file: Optional[Path] = None, + threads: int = 16, +): + """ + Retrieve sequences from a DIAMOND database file. + + Args: + db_file: DIAMOND database file. + seq: Comma-separated list of sequence ordinals to retrieve. + seq_file: File of sequence ordinals to retrieve. + out_file: Output file (prints to stdout if not specified). + threads: Number of CPU threads. + """ + if not db_file.with_suffix(".dmnd").exists(): + raise FileNotFoundError(f"Database file not found: {db_file.with_suffix('.dmnd')}") + if not seq and not seq_file: + raise ValueError("Either 'seq' or 'seq_file' must be provided.") + if seq and seq_file: + raise ValueError("Provide either 'seq' or 'seq_file', not both.") + + cmd = ["diamond", "getseq", "--db", str(db_file), "--threads", str(threads)] + if seq: cmd.extend(["--seq", seq]) + if seq_file: cmd.extend(["--seq-file", str(seq_file)]) + if out_file: cmd.extend(["--out", str(out_file)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + output_files = [str(out_file)] if out_file else [] + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": output_files} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND getseq failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def dbinfo( + db_file: Path, +): + """ + Print information about a DIAMOND database file. + + Args: + db_file: DIAMOND database file. + """ + if not db_file.with_suffix(".dmnd").exists(): + raise FileNotFoundError(f"Database file not found: {db_file.with_suffix('.dmnd')}") + + cmd = ["diamond", "dbinfo", "--db", str(db_file)] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND dbinfo failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def test(): + """Run DIAMOND regression tests.""" + cmd = ["diamond", "test"] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND test failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def makeidx( + db_file: Path, + threads: int = 16, + block_size: float = 2.0, + index_chunks: int = 4, +): + """ + Make a database index. + + Args: + db_file: DIAMOND database file. + threads: Number of CPU threads. + block_size: Sequence block size in billions of letters. + index_chunks: Number of chunks for index processing. + """ + if not db_file.with_suffix(".dmnd").exists(): + raise FileNotFoundError(f"Database file not found: {db_file.with_suffix('.dmnd')}") + + cmd = ["diamond", "makeidx", "--db", str(db_file), "--threads", str(threads), "--block-size", str(block_size), "--index-chunks", str(index_chunks)] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + # makeidx modifies the database file in place or creates index files. + # The primary output is the modified/newly indexed DB. + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(db_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND makeidx failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} + +@mcp.tool() +def greedy_vertex_cover( + in_file: Path, + out_file: Path, + threads: int = 16, +): + """ + Compute greedy vertex cover. + + Args: + in_file: Input file (e.g., edge list). + out_file: Output file for the vertex cover. + threads: Number of CPU threads. + """ + if not in_file.exists(): + raise FileNotFoundError(f"Input file not found: {in_file}") + + cmd = ["diamond", "greedy-vertex-cover", "--in", str(in_file), "--out", str(out_file), "--threads", str(threads)] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return {"command_executed": " ".join(cmd), "stdout": result.stdout, "stderr": result.stderr, "output_files": [str(out_file)]} + except subprocess.CalledProcessError as e: + return {"command_executed": " ".join(cmd), "error": "DIAMOND greedy-vertex-cover failed", "stdout": e.stdout, "stderr": e.stderr, "return_code": e.returncode} \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..1625d40c694d33a70da32496a430234aee1f840a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/diamond_server.py') +SERVER_NAME = 'biosci_diamond' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..8c3e111014b75fb0495e670063742de498bc24a7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-diamond: + build: . + image: mcp-diamond:latest + container_name: mcp-diamond + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=diamond + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c215cf0a072ed4c26b9d0f24ada3d8c960e59618 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - diamond + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_diamond/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..93141b624c6f5c32fbff8e88f274f674314beeb9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install dsh-bio via conda (e.g., from bioconda) +RUN conda install -c bioconda dsh-bio -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/dsh-bio_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/dsh-bio_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/dsh-bio_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c44e36734eb5de5f0aa738897547f72c78d435ec --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_server.py @@ -0,0 +1,203 @@ +import subprocess +import os +from pathlib import Path +from typing import Optional, List, Dict, Union + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be imported. +def tool(*args, **kwargs): + def decorator(f): + return f + return decorator + +mcp = type("mcp", (), {"tool": tool}) + + +@mcp.tool() +def dsh_bio_java( + jar_file: Optional[Path] = None, + class_name: Optional[str] = None, + args: Optional[List[str]] = None, + classpath: Optional[List[Path]] = None, + system_properties: Optional[Dict[str, str]] = None, + java_agents: Optional[List[str]] = None, + agent_libs: Optional[List[str]] = None, + agent_paths: Optional[List[str]] = None, + use_64bit: bool = True, + use_32bit: bool = False, + server_vm: bool = True, + verbose: Optional[str] = None, + show_version: bool = False, + print_version: bool = False, + require_version: Optional[str] = None, + jre_restrict_search: Optional[bool] = None, + show_non_standard_options_help: bool = False, + enable_assertions: Optional[List[str]] = None, + disable_assertions: Optional[List[str]] = None, + enable_system_assertions: bool = False, + disable_system_assertions: bool = False, + splash_image: Optional[Path] = None, +) -> Dict[str, Union[str, List[str]]]: + """ + Executes a Java application, either from a JAR file or a class file. + + This tool is a wrapper around the standard `java` command-line executable, + providing a structured interface to its various options for managing the + Java Runtime Environment (JRE) and application execution. + + Args: + jar_file: Path to the JAR file to execute. Mutually exclusive with class_name. + class_name: The fully qualified name of the class to execute. Mutually exclusive with jar_file. + args: A list of arguments to pass to the main method of the class or JAR file. + classpath: A list of directories, JAR archives, and ZIP archives to search for class files. + system_properties: A dictionary of system properties to set using the -D= syntax. + java_agents: A list of Java programming language agents to load, e.g., 'myagent.jar=options'. + agent_libs: A list of native agent libraries to load, e.g., 'hprof', 'jdwp=help'. + agent_paths: A list of native agent libraries to load by full pathname. + use_64bit: Use a 64-bit data model if available (default). + use_32bit: Use a 32-bit data model if available. + server_vm: Select the "server" VM. Default on server-class machines. + verbose: Enable verbose output. Valid options are 'class', 'gc', 'jni'. + show_version: Print product version and continue execution. + print_version: Print product version and exit without executing anything. + require_version: Require a specific JRE version to run (deprecated). + jre_restrict_search: Set to True for -jre-restrict-search or False for -no-jre-restrict-search (deprecated). + show_non_standard_options_help: Print help on non-standard options (-X) and exit. + enable_assertions: Enable assertions. Provide a list of packages/classes for granularity, e.g., ['com.example...']. + disable_assertions: Disable assertions. Provide a list of packages/classes for granularity. + enable_system_assertions: Enable system assertions (-esa). + disable_system_assertions: Disable system assertions (-dsa). + splash_image: Path to an image to be shown on the splash screen. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files (if any). + """ + # --- Input Validation --- + if jar_file and class_name: + raise ValueError("Cannot specify both 'jar_file' and 'class_name'. They are mutually exclusive.") + + action_flags = [print_version, show_non_standard_options_help] + if not jar_file and not class_name and not any(action_flags): + raise ValueError("An executable target (jar_file or class_name) or an action (print_version, show_non_standard_options_help) must be provided.") + + if use_32bit and use_64bit: + raise ValueError("Cannot specify both 'use_32bit' and 'use_64bit'.") + + if verbose and verbose not in ["class", "gc", "jni"]: + raise ValueError("If specified, 'verbose' must be one of 'class', 'gc', or 'jni'.") + + if jar_file: + if not jar_file.is_file(): + raise FileNotFoundError(f"Input JAR file not found: {jar_file}") + + if splash_image: + if not splash_image.is_file(): + raise FileNotFoundError(f"Splash image not found: {splash_image}") + + # --- Command Construction --- + cmd = ["java"] + + if use_32bit: + cmd.append("-d32") + if use_64bit: + cmd.append("-d64") + if server_vm: + cmd.append("-server") + + if classpath: + validated_paths = [] + for p in classpath: + path = Path(p) + if not path.exists(): + raise FileNotFoundError(f"Path in classpath not found: {path}") + validated_paths.append(str(path)) + cmd.extend(["-classpath", os.pathsep.join(validated_paths)]) + + if system_properties: + for key, value in system_properties.items(): + cmd.append(f"-D{key}={value}") + + if verbose: + cmd.append(f"-verbose:{verbose}") + + if print_version: + cmd.append("-version") + if require_version: + cmd.append(f"-version:{require_version}") + if show_version: + cmd.append("-showversion") + + if jre_restrict_search is not None: + cmd.append("-jre-restrict-search" if jre_restrict_search else "-no-jre-restrict-search") + + if show_non_standard_options_help: + cmd.append("-X") + + if enable_assertions is not None: + if enable_assertions: + cmd.append(f"-ea:{':'.join(enable_assertions)}") + else: + cmd.append("-ea") + + if disable_assertions is not None: + if disable_assertions: + cmd.append(f"-da:{':'.join(disable_assertions)}") + else: + cmd.append("-da") + + if enable_system_assertions: + cmd.append("-esa") + if disable_system_assertions: + cmd.append("-dsa") + + if agent_libs: + for lib in agent_libs: + cmd.append(f"-agentlib:{lib}") + if agent_paths: + for path in agent_paths: + cmd.append(f"-agentpath:{path}") + if java_agents: + for agent in java_agents: + cmd.append(f"-javaagent:{agent}") + + if splash_image: + cmd.append(f"-splash:{splash_image}") + + # --- Main Target and Arguments --- + if jar_file: + cmd.extend(["-jar", str(jar_file)]) + elif class_name: + cmd.append(class_name) + + if args: + cmd.extend(args) + + # --- Subprocess Execution --- + command_executed = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [] + } + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'java' command not found. Make sure a Java Runtime Environment is installed and in the system's PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b5f8e7f061e0a682bce85aaf45c6328e87a8cb6b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/dsh-bio_server.py') +SERVER_NAME = 'biosci_dsh_bio' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..24b9550355119c9912351b240b9c133ae01bce41 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-dsh-bio: + build: . + image: mcp-dsh-bio:latest + container_name: mcp-dsh-bio + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=dsh-bio + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d893d12d8e1e60b0ba94cfca1930d61bf8fe8f6e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - dsh-bio + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_dsh-bio/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..27c43fccf2a9dc81337c1024b8d3cf97ffcb6548 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install ena-webin-cli via conda (e.g., from bioconda) +RUN conda install -c bioconda ena-webin-cli -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/ena-webin-cli_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/ena-webin-cli_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/ena-webin-cli_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d1cfc014355143950f856f8abe236e113a111bd9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_server.py @@ -0,0 +1,130 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import Optional, List, Dict, Any + +# @mcp.tool() is a placeholder for the actual decorator +# in a real MCP environment. +def mcp_tool(): + def decorator(f): + return f + return decorator + +@mcp_tool() +def ena_webin_cli( + context: str, + manifest: Path, + user_name: str, + password: str, + action: str, + jar_path: Path, + output_dir: Optional[Path] = None, + input_dir: Optional[Path] = None, + center_name: Optional[str] = None, + test: bool = False, +) -> Dict[str, Any]: + """ + Validates and submits data to the European Nucleotide Archive (ENA) using the Webin-CLI. + + This tool provides a command-line interface for submissions of sequence reads, + genomes, transcriptomes, and other data types. It requires an ENA Webin submission + account. + + Args: + context: The submission context type. + Must be one of 'genome', 'transcriptome', 'sequence', 'reads', 'taxonomy', 'pathogen'. + manifest: Path to the manifest file describing the files to be submitted. + user_name: ENA Webin submission account user name (e.g., 'Webin-12345'). + password: ENA Webin submission account password. + action: The operation to perform. + Must be one of 'validate', 'submit', 'process', 'report'. + jar_path: Path to the 'webin-cli.jar' executable file. + output_dir: Directory for output files (reports). If not provided, defaults to the manifest file's directory. + input_dir: Directory containing the data files to be submitted. Defaults to the manifest file's directory. + center_name: The center name of the submitter. Overrides the value in the manifest. + test: Set to True to use the ENA test submission service. + + Returns: + A dictionary containing the execution details, including the command, + stdout, stderr, and a list of generated output files. + """ + # 1. Input Validation + allowed_contexts = ['genome', 'transcriptome', 'sequence', 'reads', 'taxonomy', 'pathogen'] + if context not in allowed_contexts: + raise ValueError(f"Invalid context '{context}'. Must be one of {allowed_contexts}.") + + allowed_actions = ['validate', 'submit', 'process', 'report'] + if action not in allowed_actions: + raise ValueError(f"Invalid action '{action}'. Must be one of {allowed_actions}.") + + if not manifest.is_file(): + raise FileNotFoundError(f"Manifest file not found: {manifest}") + + if not jar_path.is_file(): + raise FileNotFoundError(f"Webin CLI JAR file not found: {jar_path}") + + if not user_name: + raise ValueError("user_name cannot be empty.") + + if not password: + raise ValueError("password cannot be empty.") + + # 2. Command Construction + cmd = [ + "java", "-jar", str(jar_path), + "-context", context, + "-manifest", str(manifest), + "-userName", user_name, + "-password", password, + f"-{action}" + ] + + # Determine and create output directory + effective_output_dir = output_dir if output_dir else manifest.parent + effective_output_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["-outputDir", str(effective_output_dir)]) + + if input_dir: + if not input_dir.is_dir(): + raise NotADirectoryError(f"Input directory not found: {input_dir}") + cmd.extend(["-inputDir", str(input_dir)]) + + if center_name: + cmd.extend(["-centerName", center_name]) + + if test: + cmd.append("-test") + + # 3. Subprocess Execution + command_executed = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + stdout = result.stdout + stderr = result.stderr + + except FileNotFoundError: + raise RuntimeError("`java` command not found. Please ensure Java is installed and in your PATH.") + except subprocess.CalledProcessError as e: + # Webin-CLI often prints detailed errors to stdout on failure + error_message = f"Webin-CLI failed with exit code {e.returncode}.\n" + error_message += f"STDOUT:\n{e.stdout}\n" + error_message += f"STDERR:\n{e.stderr}\n" + raise RuntimeError(error_message) from e + + # 4. Collect Output Files + # Output files are typically placed in a subdirectory structure like: + # //// + output_files = [str(p) for p in effective_output_dir.glob(f"{context}/**/*.report")] + + # 5. Return Structured Output + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f75edca32ffd746340fe8a93c47db157f837857c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/ena-webin-cli_server.py') +SERVER_NAME = 'biosci_ena_webin_cli' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f0131324c4b94726e90532dc7f6b762fcd5639c8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-ena-webin-cli: + build: . + image: mcp-ena-webin-cli:latest + container_name: mcp-ena-webin-cli + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=ena-webin-cli + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3dd0702e48d49582bd2add0c90f4b46fe1e2a6d1 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - ena-webin-cli + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_ena-webin-cli/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..eaef5740a5c642df6299aa092a081142acb54aee --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install f5c via conda (e.g., from bioconda) +RUN conda install -c bioconda f5c -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/f5c_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/f5c_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/f5c_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_server.py new file mode 100644 index 0000000000000000000000000000000000000000..93794b6d1f2f37bd76384331218c5fda8878668a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_server.py @@ -0,0 +1,549 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional + +# Note: @mcp.tool decorator is not defined here as per the instructions. +# It is assumed to be provided by the MCP framework. + +class MCP: + def tool(self): + def decorator(f): + return f + return decorator + +mcp = MCP() + + +@mcp.tool() +def f5c_index( + reads_fastq: Path, + fast5_dir: Optional[Path] = None, + slow5_dir: Optional[Path] = None, + compress_signal: bool = False, +): + """ + Build an index for accessing the base sequence and raw signal for a given read ID. + + This tool is an optimised version of nanopolish index. It creates an index + that maps read IDs to their raw signal data in FAST5 or SLOW5/BLOW5 files. + """ + # Input validation + if not reads_fastq.is_file(): + raise FileNotFoundError(f"Input reads file not found: {reads_fastq}") + if not fast5_dir and not slow5_dir: + raise ValueError("Either --fast5-dir or --slow5-dir must be provided.") + if fast5_dir and not fast5_dir.is_dir(): + raise NotADirectoryError(f"FAST5 directory not found: {fast5_dir}") + if slow5_dir and not slow5_dir.is_dir(): + raise NotADirectoryError(f"SLOW5 directory not found: {slow5_dir}") + + cmd = ["f5c", "index"] + + if fast5_dir: + cmd.extend(["--fast5-dir", str(fast5_dir)]) + if slow5_dir: + cmd.extend(["--slow5-dir", str(slow5_dir)]) + if compress_signal: + cmd.append("--compress-signal") + + cmd.append(str(reads_fastq)) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + # f5c index creates multiple output files based on the input reads file name + output_files = [ + str(reads_fastq.with_suffix(reads_fastq.suffix + '.fai')), + str(reads_fastq.with_suffix(reads_fastq.suffix + '.gzi')), + str(reads_fastq.with_suffix('.readdb')), + ] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c index failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + +@mcp.tool() +def f5c_call_methylation( + reads_file: Path, + bam_file: Path, + ref_file: Path, + output_file: Optional[Path] = None, + batch_size: int = 512, + max_bases: str = "2M", + threads: int = 8, + secondary: str = "yes", + p_skip: str = "yes", + min_mapq: int = 0, + read_id: Optional[str] = None, + verbose: int = 3, + min_coverage: int = 1, + pore: str = "r9.4_1d_native", + rna: bool = False, + print_read_names: bool = False, + no_header: bool = False, + kmer_model: Optional[Path] = None, + meth_model: Optional[Path] = None, + allow_unsupported_chemistry: bool = False, +): + """ + Classify nucleotides as methylated or not. + + This tool is an optimised version of nanopolish call-methylation. It uses + signal-level data to determine the methylation status of CpG sites. + """ + # Input validation + if not reads_file.is_file(): + raise FileNotFoundError(f"Reads file not found: {reads_file}") + if not bam_file.is_file(): + raise FileNotFoundError(f"BAM file not found: {bam_file}") + if not ref_file.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref_file}") + if kmer_model and not kmer_model.is_file(): + raise FileNotFoundError(f"K-mer model file not found: {kmer_model}") + if meth_model and not meth_model.is_file(): + raise FileNotFoundError(f"Methylation model file not found: {meth_model}") + if secondary not in ["yes", "no"]: + raise ValueError(f"Invalid value for secondary: {secondary}. Must be 'yes' or 'no'.") + if p_skip not in ["yes", "no"]: + raise ValueError(f"Invalid value for p_skip: {p_skip}. Must be 'yes' or 'no'.") + if threads <= 0: + raise ValueError("threads must be a positive integer.") + if batch_size <= 0: + raise ValueError("batch_size must be a positive integer.") + + cmd = [ + "f5c", "call-methylation", + "-r", str(reads_file), + "-b", str(bam_file), + "-g", str(ref_file), + "-K", str(batch_size), + "-B", max_bases, + "-t", str(threads), + "-s", secondary, + "-p", p_skip, + "-q", str(min_mapq), + "-v", str(verbose), + "--min-coverage", str(min_coverage), + "--pore", pore, + ] + + if output_file: + cmd.extend(["-o", str(output_file)]) + if read_id: + cmd.extend(["-I", read_id]) + if rna: + cmd.append("--rna") + if print_read_names: + cmd.append("--print-read-names") + if no_header: + cmd.append("--no-header") + if kmer_model: + cmd.extend(["--kmer-model", str(kmer_model)]) + if meth_model: + cmd.extend(["--meth-model", str(meth_model)]) + if allow_unsupported_chemistry: + cmd.append("--allow-unsupported-chemistry") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + output_files_list = [str(output_file)] if output_file else [] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c call-methylation failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + +@mcp.tool() +def f5c_meth_freq( + reads_file: Path, + bam_file: Path, + ref_file: Path, + output_file: Optional[Path] = None, + min_coverage: int = 5, + threads: int = 8, + batch_size: int = 512, + max_bases: str = "2M", + secondary: str = "yes", + p_skip: str = "yes", + min_mapq: int = 0, + read_id: Optional[str] = None, + verbose: int = 3, + pore: str = "r9.4_1d_native", + rna: bool = False, + kmer_model: Optional[Path] = None, + meth_model: Optional[Path] = None, + allow_unsupported_chemistry: bool = False, +): + """ + Calculate methylation frequency at genomic CpG sites. + + This tool is an optimised version of nanopolish calculate_methylation_frequency.py. + It processes methylation calls to compute the frequency of methylation at each site. + """ + # Input validation + if not reads_file.is_file(): + raise FileNotFoundError(f"Reads file not found: {reads_file}") + if not bam_file.is_file(): + raise FileNotFoundError(f"BAM file not found: {bam_file}") + if not ref_file.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref_file}") + if kmer_model and not kmer_model.is_file(): + raise FileNotFoundError(f"K-mer model file not found: {kmer_model}") + if meth_model and not meth_model.is_file(): + raise FileNotFoundError(f"Methylation model file not found: {meth_model}") + if secondary not in ["yes", "no"]: + raise ValueError(f"Invalid value for secondary: {secondary}. Must be 'yes' or 'no'.") + if p_skip not in ["yes", "no"]: + raise ValueError(f"Invalid value for p_skip: {p_skip}. Must be 'yes' or 'no'.") + if threads <= 0: + raise ValueError("threads must be a positive integer.") + if batch_size <= 0: + raise ValueError("batch_size must be a positive integer.") + if min_coverage <= 0: + raise ValueError("min_coverage must be a positive integer.") + + cmd = [ + "f5c", "meth-freq", + "-r", str(reads_file), + "-b", str(bam_file), + "-g", str(ref_file), + "-c", str(min_coverage), + "-t", str(threads), + "-K", str(batch_size), + "-B", max_bases, + "-s", secondary, + "-p", p_skip, + "-q", str(min_mapq), + "-v", str(verbose), + "--pore", pore, + ] + + if output_file: + cmd.extend(["-o", str(output_file)]) + if read_id: + cmd.extend(["-I", read_id]) + if rna: + cmd.append("--rna") + if kmer_model: + cmd.extend(["--kmer-model", str(kmer_model)]) + if meth_model: + cmd.extend(["--meth-model", str(meth_model)]) + if allow_unsupported_chemistry: + cmd.append("--allow-unsupported-chemistry") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + output_files_list = [str(output_file)] if output_file else [] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c meth-freq failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + +@mcp.tool() +def f5c_eventalign( + reads_file: Path, + bam_file: Path, + ref_file: Path, + output_file: Optional[Path] = None, + rna: bool = False, + threads: int = 8, + batch_size: int = 512, + max_bases: str = "2M", + secondary: str = "yes", + p_skip: str = "yes", + min_mapq: int = 0, + read_id: Optional[str] = None, + verbose: int = 3, + pore: str = "r9.4_1d_native", + kmer_model: Optional[Path] = None, + allow_unsupported_chemistry: bool = False, + print_read_names: bool = False, + scale_events: bool = False, + samples: bool = False, + summary: Optional[Path] = None, + signal_index: bool = False, + slow5: Optional[Path] = None, +): + """ + Align nanopore events to reference k-mers. + + This tool is an optimised version of nanopolish eventalign. It aligns raw + nanopore signal (events) to the reference genome, providing a detailed + mapping between signal and sequence. + """ + # Input validation + if not reads_file.is_file(): + raise FileNotFoundError(f"Reads file not found: {reads_file}") + if not bam_file.is_file(): + raise FileNotFoundError(f"BAM file not found: {bam_file}") + if not ref_file.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref_file}") + if kmer_model and not kmer_model.is_file(): + raise FileNotFoundError(f"K-mer model file not found: {kmer_model}") + if slow5 and not slow5.is_file(): + raise FileNotFoundError(f"SLOW5 file not found: {slow5}") + if secondary not in ["yes", "no"]: + raise ValueError(f"Invalid value for secondary: {secondary}. Must be 'yes' or 'no'.") + if p_skip not in ["yes", "no"]: + raise ValueError(f"Invalid value for p_skip: {p_skip}. Must be 'yes' or 'no'.") + if threads <= 0: + raise ValueError("threads must be a positive integer.") + + cmd = [ + "f5c", "eventalign", + "-r", str(reads_file), + "-b", str(bam_file), + "-g", str(ref_file), + "-t", str(threads), + "-K", str(batch_size), + "-B", max_bases, + "-s", secondary, + "-p", p_skip, + "-q", str(min_mapq), + "-v", str(verbose), + "--pore", pore, + ] + + if output_file: + cmd.extend(["-o", str(output_file)]) + if rna: + cmd.append("--rna") + if read_id: + cmd.extend(["-I", read_id]) + if kmer_model: + cmd.extend(["--kmer-model", str(kmer_model)]) + if allow_unsupported_chemistry: + cmd.append("--allow-unsupported-chemistry") + if print_read_names: + cmd.append("--print-read-names") + if scale_events: + cmd.append("--scale-events") + if samples: + cmd.append("--samples") + if summary: + cmd.extend(["--summary", str(summary)]) + if signal_index: + cmd.append("--signal-index") + if slow5: + cmd.extend(["--slow5", str(slow5)]) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + output_files_list = [] + if output_file: + output_files_list.append(str(output_file)) + if summary: + output_files_list.append(str(summary)) + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c eventalign failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + +@mcp.tool() +def f5c_freq_merge( + input_tsvs: List[Path], + output_file: Optional[Path] = None, +): + """ + Merge calculated methylation frequency tsv files. + + This utility combines multiple methylation frequency files (output from + f5c meth-freq) into a single file. + """ + # Input validation + if not input_tsvs: + raise ValueError("At least one input TSV file must be provided.") + for tsv_file in input_tsvs: + if not tsv_file.is_file(): + raise FileNotFoundError(f"Input TSV file not found: {tsv_file}") + + cmd = ["f5c", "freq-merge"] + + if output_file: + cmd.extend(["-o", str(output_file)]) + + cmd.extend([str(p) for p in input_tsvs]) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + output_files_list = [str(output_file)] if output_file else [] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c freq-merge failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + +@mcp.tool() +def f5c_resquiggle( + reads_file: Path, + ref_file: Path, + output_file: Optional[Path] = None, + rna: bool = False, + threads: int = 8, + batch_size: int = 512, + max_bases: str = "2M", + read_id: Optional[str] = None, + verbose: int = 3, + pore: str = "r9.4_1d_native", + kmer_model: Optional[Path] = None, + allow_unsupported_chemistry: bool = False, + print_read_names: bool = False, + slow5: Optional[Path] = None, +): + """ + Align raw signals to basecalled reads. + + This tool performs a 'resquiggle' alignment, which is the process of + aligning the raw electrical signal from the nanopore sequencer to the + basecalled sequence for that same read. + """ + # Input validation + if not reads_file.is_file(): + raise FileNotFoundError(f"Reads file not found: {reads_file}") + if not ref_file.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref_file}") + if kmer_model and not kmer_model.is_file(): + raise FileNotFoundError(f"K-mer model file not found: {kmer_model}") + if slow5 and not slow5.is_file(): + raise FileNotFoundError(f"SLOW5 file not found: {slow5}") + if threads <= 0: + raise ValueError("threads must be a positive integer.") + + cmd = [ + "f5c", "resquiggle", + "-r", str(reads_file), + "-g", str(ref_file), + "-t", str(threads), + "-K", str(batch_size), + "-B", max_bases, + "-v", str(verbose), + "--pore", pore, + ] + + if output_file: + cmd.extend(["-o", str(output_file)]) + if rna: + cmd.append("--rna") + if read_id: + cmd.extend(["-I", read_id]) + if kmer_model: + cmd.extend(["--kmer-model", str(kmer_model)]) + if allow_unsupported_chemistry: + cmd.append("--allow-unsupported-chemistry") + if print_read_names: + cmd.append("--print-read-names") + if slow5: + cmd.extend(["--slow5", str(slow5)]) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + output_files_list = [str(output_file)] if output_file else [] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": "f5c resquiggle failed", + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5dcec23ee13078667ea74679527dcaac106084e5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/f5c_server.py') +SERVER_NAME = 'biosci_f5c' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..27e8b4b3b5a91d89ffed73d50a016ff54733c436 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-f5c: + build: . + image: mcp-f5c:latest + container_name: mcp-f5c + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=f5c + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1bf1537b730c60252e18ce645322db7804f478b2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - f5c + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_f5c/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a8f7c742b54006a1241d90dbc02cbfbaad1ba53d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install fastdtw via conda (e.g., from bioconda) +RUN conda install -c bioconda fastdtw -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/fastdtw_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/fastdtw_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/fastdtw_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_server.py new file mode 100644 index 0000000000000000000000000000000000000000..48b7a4d06edc5097d5d1a186eebb692fc13813f0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_server.py @@ -0,0 +1,102 @@ +from pathlib import Path +import subprocess +from typing import Optional, Dict, Any, List + +@mcp.tool() +def fastdtw_compute( + series_1_path: str, + series_2_path: str, + radius: int = 1, + distance_metric: str = "euclidean", +) -> Dict[str, Any]: + """ + Compute the Fast Dynamic Time Warping (FastDTW) distance between two time-series files. + FastDTW is an approximate DTW algorithm that provides optimal or near-optimal alignments + with an O(N) time and memory complexity. + + Args: + series_1_path: Path to the first time-series data file (e.g., CSV, TSV, or text). + series_2_path: Path to the second time-series data file (e.g., CSV, TSV, or text). + radius: The search radius for the approximation. A larger radius increases accuracy but increases computation time. Default is 1. + distance_metric: The distance metric to use. Common options include 'euclidean', 'manhattan', 'chebyshev', etc. Default is 'euclidean'. + """ + + # Input validation + path1 = Path(series_1_path) + path2 = Path(series_2_path) + + if not path1.exists(): + return {"error": f"Input file 1 not found: {series_1_path}"} + if not path2.exists(): + return {"error": f"Input file 2 not found: {series_2_path}"} + + if radius < 1: + return {"error": "Radius must be an integer greater than or equal to 1."} + + # Construct the command + # Based on standard python -m fastdtw CLI patterns + cmd = [ + "python", "-m", "fastdtw", + str(path1), + str(path2), + "--radius", str(radius), + "--dist", distance_metric + ] + + try: + # Execute the tool + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"FastDTW execution failed with return code {e.returncode}", + "status": "error" + } + except Exception as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "status": "error" + } + +@mcp.tool() +def fastdtw_help() -> Dict[str, Any]: + """ + Retrieve the help documentation and version information for the fastdtw CLI tool. + """ + cmd = ["python", "-m", "fastdtw", "--help"] + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Failed to retrieve help documentation." + } diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..45f174c0c9787c5714362754a1ef2a06b3ce4dc0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/fastdtw_server.py') +SERVER_NAME = 'biosci_fastdtw' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..bff043cc7a4e3531b5906f10ebed09c08bcf3115 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-fastdtw: + build: . + image: mcp-fastdtw:latest + container_name: mcp-fastdtw + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=fastdtw + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..91d80641f507ab9f7af361b27aae074e7c1f5c07 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - fastdtw + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastdtw/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cba5e72b61d72265377e0d4735c382eaa85788f7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install fastp via conda (e.g., from bioconda) +RUN conda install -c bioconda fastp -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/fastp_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/fastp_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/fastp_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_server.py new file mode 100644 index 0000000000000000000000000000000000000000..ebddf43376a782cafa01d24ed9bc926d0b358678 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_server.py @@ -0,0 +1,444 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +@mcp.tool() +def fastp_tool( + # Input/Output Files + in1: Path, + out1: Optional[Path] = None, + in2: Optional[Path] = None, + out2: Optional[Path] = None, + unpaired1: Optional[Path] = None, + unpaired2: Optional[Path] = None, + overlapped_out: Optional[Path] = None, + failed_out: Optional[Path] = None, + merged_out: Optional[Path] = None, + adapter_fasta: Optional[Path] = None, + filter_by_index1: Optional[Path] = None, + filter_by_index2: Optional[Path] = None, + json_report: Path = Path("fastp.json"), + html_report: Path = Path("fastp.html"), + + # Boolean Flags + dedup: bool = False, + merge: bool = False, + include_unmerged: bool = False, + phred64: bool = False, + stdin: bool = False, + stdout: bool = False, + interleaved_in: bool = False, + dont_overwrite: bool = False, + dont_eval_duplication: bool = False, + fix_mgi_id: bool = False, + verbose: bool = False, + disable_adapter_trimming: bool = False, + detect_adapter_for_pe: bool = False, + trim_poly_g: bool = False, # Force polyG trimming + disable_trim_poly_g: bool = False, # Disable polyG trimming + trim_poly_x: bool = False, + cut_front: bool = False, + cut_tail: bool = False, + cut_right: bool = False, + disable_quality_filtering: bool = False, + disable_length_filtering: bool = False, + low_complexity_filter: bool = False, + correction: bool = False, + umi: bool = False, + overrepresentation_analysis: bool = False, + + # Integer Parameters + compression: int = 4, + reads_to_process: int = 0, + trim_front1: int = 0, + trim_tail1: int = 0, + max_len1: int = 0, + trim_front2: int = 0, + trim_tail2: int = 0, + max_len2: int = 0, + poly_g_min_len: int = 10, + poly_x_min_len: int = 10, + cut_window_size: int = 4, + cut_mean_quality: int = 20, + cut_front_window_size: int = 4, + cut_front_mean_quality: int = 20, + cut_tail_window_size: int = 4, + cut_tail_mean_quality: int = 20, + cut_right_window_size: int = 4, + cut_right_mean_quality: int = 20, + qualified_quality_phred: int = 15, + unqualified_percent_limit: int = 40, + n_base_limit: int = 5, + average_qual: int = 0, + length_required: int = 15, + length_limit: int = 0, + complexity_threshold: int = 30, + filter_by_index_threshold: int = 0, + overlap_len_require: int = 30, + overlap_diff_limit: int = 5, + overlap_diff_percent_limit: int = 20, + umi_len: int = 0, + umi_skip: int = 0, + overrepresentation_sampling: int = 20, + thread: int = 2, + split: int = 0, + split_by_lines: int = 0, + split_prefix_digits: int = 4, + + # String Parameters + adapter_sequence: str = "auto", + adapter_sequence_r2: str = "auto", + umi_loc: Optional[str] = None, + umi_prefix: Optional[str] = None, + report_title: str = "fastp report", +) -> Dict[str, Any]: + """ + fastp is an all-in-one FASTQ preprocessor (QC/filtering/trimming/correction/merging...). + It performs quality control, adapter trimming, filtering, and other preprocessing steps + for FASTQ files, supporting both single-end and paired-end reads. + """ + cmd = ["fastp"] + output_files: List[Path] = [] + + # --- Input Validation and Command Construction --- + + # Required input file + if not stdin: + if not in1: + raise ValueError("Input file 'in1' must be specified unless '--stdin' is used.") + if not in1.exists(): + raise FileNotFoundError(f"Input file not found: {in1}") + cmd.extend(["--in1", str(in1)]) + else: + cmd.append("--stdin") + + # Mutually exclusive stdin/in1 check + if stdin and in1: + raise ValueError("Cannot use both '--stdin' and '--in1' simultaneously.") + + # Paired-end input + if in2: + if not in2.exists(): + raise FileNotFoundError(f"Input file not found: {in2}") + cmd.extend(["--in2", str(in2)]) + + # Output files + if stdout: + if any([out1, out2, unpaired1, unpaired2, overlapped_out, failed_out, merged_out]): + raise ValueError("Cannot use '--stdout' with specific output file paths.") + cmd.append("--stdout") + else: + if out1: + out1.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--out1", str(out1)]) + output_files.append(out1) + if out2: + out2.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--out2", str(out2)]) + output_files.append(out2) + + # Conditional output files + if unpaired1: + unpaired1.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--unpaired1", str(unpaired1)]) + output_files.append(unpaired1) + if unpaired2: + unpaired2.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--unpaired2", str(unpaired2)]) + output_files.append(unpaired2) + if overlapped_out: + overlapped_out.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--overlapped_out", str(overlapped_out)]) + output_files.append(overlapped_out) + if failed_out: + failed_out.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--failed_out", str(failed_out)]) + output_files.append(failed_out) + + # Merge mode + if merge: + cmd.append("--merge") + if not merged_out: + raise ValueError("When '--merge' is enabled, '--merged_out' must be specified.") + merged_out.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--merged_out", str(merged_out)]) + output_files.append(merged_out) + if include_unmerged: + cmd.append("--include_unmerged") + + # Report files + if json_report: + json_report.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--json", str(json_report)]) + output_files.append(json_report) + if html_report: + html_report.parent.mkdir(parents=True, exist_ok=True) + cmd.extend(["--html", str(html_report)]) + output_files.append(html_report) + + # --- General Options --- + if dedup: + cmd.append("--dedup") + if phred64: + cmd.append("--phred64") + if interleaved_in: + cmd.append("--interleaved_in") + if reads_to_process < 0: + raise ValueError("'reads_to_process' must be non-negative.") + if reads_to_process > 0: + cmd.extend(["--reads_to_process", str(reads_to_process)]) + if dont_overwrite: + cmd.append("--dont_overwrite") + if dont_eval_duplication: + cmd.append("--dont_eval_duplication") + if fix_mgi_id: + cmd.append("--fix_mgi_id") + if verbose: + cmd.append("--verbose") + + # Compression level + if not (1 <= compression <= 9): + raise ValueError("'compression' level must be between 1 and 9.") + if compression != 4: # Default is 4, only add if different + cmd.extend(["--compression", str(compression)]) + + # --- Adapter Trimming --- + if disable_adapter_trimming: + cmd.append("--disable_adapter_trimming") + if adapter_sequence != "auto": + cmd.extend(["--adapter_sequence", adapter_sequence]) + if adapter_sequence_r2 != "auto": + cmd.extend(["--adapter_sequence_r2", adapter_sequence_r2]) + if adapter_fasta: + if not adapter_fasta.exists(): + raise FileNotFoundError(f"Adapter FASTA file not found: {adapter_fasta}") + cmd.extend(["--adapter_fasta", str(adapter_fasta)]) + if detect_adapter_for_pe: + cmd.append("--detect_adapter_for_pe") + + # --- Trimming by Length/Position --- + if trim_front1 < 0: raise ValueError("'trim_front1' must be non-negative.") + if trim_front1 > 0: cmd.extend(["--trim_front1", str(trim_front1)]) + if trim_tail1 < 0: raise ValueError("'trim_tail1' must be non-negative.") + if trim_tail1 > 0: cmd.extend(["--trim_tail1", str(trim_tail1)]) + if max_len1 < 0: raise ValueError("'max_len1' must be non-negative.") + if max_len1 > 0: cmd.extend(["--max_len1", str(max_len1)]) + + if trim_front2 < 0: raise ValueError("'trim_front2' must be non-negative.") + if trim_front2 > 0: cmd.extend(["--trim_front2", str(trim_front2)]) + if trim_tail2 < 0: raise ValueError("'trim_tail2' must be non-negative.") + if trim_tail2 > 0: cmd.extend(["--trim_tail2", str(trim_tail2)]) + if max_len2 < 0: raise ValueError("'max_len2' must be non-negative.") + if max_len2 > 0: cmd.extend(["--max_len2", str(max_len2)]) + + # PolyG/PolyX trimming + if trim_poly_g and disable_trim_poly_g: + raise ValueError("Cannot use both '--trim_poly_g' and '--disable_trim_poly_g' simultaneously.") + if trim_poly_g: + cmd.append("--trim_poly_g") + if disable_trim_poly_g: + cmd.append("--disable_trim_poly_g") + if not (poly_g_min_len >= 1): # Minimum length for polyG detection + raise ValueError("'poly_g_min_len' must be at least 1.") + if poly_g_min_len != 10: # Default is 10 + cmd.extend(["--poly_g_min_len", str(poly_g_min_len)]) + + if trim_poly_x: + cmd.append("--trim_poly_x") + if not (poly_x_min_len >= 1): # Minimum length for polyX detection + raise ValueError("'poly_x_min_len' must be at least 1.") + if poly_x_min_len != 10: # Default is 10 + cmd.extend(["--poly_x_min_len", str(poly_x_min_len)]) + + # --- Sliding Window Trimming --- + if cut_front: + cmd.append("--cut_front") + if cut_tail: + cmd.append("--cut_tail") + if cut_right: + cmd.append("--cut_right") + + if not (1 <= cut_window_size <= 1000): + raise ValueError("'cut_window_size' must be between 1 and 1000.") + if cut_window_size != 4: + cmd.extend(["--cut_window_size", str(cut_window_size)]) + + if not (1 <= cut_mean_quality <= 36): + raise ValueError("'cut_mean_quality' must be between 1 and 36.") + if cut_mean_quality != 20: + cmd.extend(["--cut_mean_quality", str(cut_mean_quality)]) + + # Specific sliding window options (only add if different from shared defaults) + if cut_front_window_size != cut_window_size: + if not (1 <= cut_front_window_size <= 1000): raise ValueError("'cut_front_window_size' must be between 1 and 1000.") + cmd.extend(["--cut_front_window_size", str(cut_front_window_size)]) + if cut_front_mean_quality != cut_mean_quality: + if not (1 <= cut_front_mean_quality <= 36): raise ValueError("'cut_front_mean_quality' must be between 1 and 36.") + cmd.extend(["--cut_front_mean_quality", str(cut_front_mean_quality)]) + + if cut_tail_window_size != cut_window_size: + if not (1 <= cut_tail_window_size <= 1000): raise ValueError("'cut_tail_window_size' must be between 1 and 1000.") + cmd.extend(["--cut_tail_window_size", str(cut_tail_window_size)]) + if cut_tail_mean_quality != cut_mean_quality: + if not (1 <= cut_tail_mean_quality <= 36): raise ValueError("'cut_tail_mean_quality' must be between 1 and 36.") + cmd.extend(["--cut_tail_mean_quality", str(cut_tail_mean_quality)]) + + if cut_right_window_size != cut_window_size: + if not (1 <= cut_right_window_size <= 1000): raise ValueError("'cut_right_window_size' must be between 1 and 1000.") + cmd.extend(["--cut_right_window_size", str(cut_right_window_size)]) + if cut_right_mean_quality != cut_mean_quality: + if not (1 <= cut_right_mean_quality <= 36): raise ValueError("'cut_right_mean_quality' must be between 1 and 36.") + cmd.extend(["--cut_right_mean_quality", str(cut_right_mean_quality)]) + + # --- Quality Filtering --- + if disable_quality_filtering: + cmd.append("--disable_quality_filtering") + if qualified_quality_phred < 0: raise ValueError("'qualified_quality_phred' must be non-negative.") + if qualified_quality_phred != 15: + cmd.extend(["--qualified_quality_phred", str(qualified_quality_phred)]) + if not (0 <= unqualified_percent_limit <= 100): + raise ValueError("'unqualified_percent_limit' must be between 0 and 100.") + if unqualified_percent_limit != 40: + cmd.extend(["--unqualified_percent_limit", str(unqualified_percent_limit)]) + if n_base_limit < 0: raise ValueError("'n_base_limit' must be non-negative.") + if n_base_limit != 5: + cmd.extend(["--n_base_limit", str(n_base_limit)]) + if average_qual < 0: raise ValueError("'average_qual' must be non-negative.") + if average_qual > 0: # Default 0 means no requirement + cmd.extend(["--average_qual", str(average_qual)]) + + # --- Length Filtering --- + if disable_length_filtering: + cmd.append("--disable_length_filtering") + if length_required < 0: raise ValueError("'length_required' must be non-negative.") + if length_required != 15: + cmd.extend(["--length_required", str(length_required)]) + if length_limit < 0: raise ValueError("'length_limit' must be non-negative.") + if length_limit > 0: # Default 0 means no limitation + cmd.extend(["--length_limit", str(length_limit)]) + + # --- Low Complexity Filter --- + if low_complexity_filter: + cmd.append("--low_complexity_filter") + if not (0 <= complexity_threshold <= 100): + raise ValueError("'complexity_threshold' must be between 0 and 100.") + if complexity_threshold != 30: + cmd.extend(["--complexity_threshold", str(complexity_threshold)]) + + # --- Index Filtering --- + if filter_by_index1: + if not filter_by_index1.exists(): + raise FileNotFoundError(f"Index1 filter file not found: {filter_by_index1}") + cmd.extend(["--filter_by_index1", str(filter_by_index1)]) + if filter_by_index2: + if not filter_by_index2.exists(): + raise FileNotFoundError(f"Index2 filter file not found: {filter_by_index2}") + cmd.extend(["--filter_by_index2", str(filter_by_index2)]) + if filter_by_index_threshold < 0: raise ValueError("'filter_by_index_threshold' must be non-negative.") + if filter_by_index_threshold > 0: # Default 0 means identical + cmd.extend(["--filter_by_index_threshold", str(filter_by_index_threshold)]) + + # --- Overlap Analysis & Correction --- + if correction: + cmd.append("--correction") + if overlap_len_require < 0: raise ValueError("'overlap_len_require' must be non-negative.") + if overlap_len_require != 30: + cmd.extend(["--overlap_len_require", str(overlap_len_require)]) + if overlap_diff_limit < 0: raise ValueError("'overlap_diff_limit' must be non-negative.") + if overlap_diff_limit != 5: + cmd.extend(["--overlap_diff_limit", str(overlap_diff_limit)]) + if not (0 <= overlap_diff_percent_limit <= 100): + raise ValueError("'overlap_diff_percent_limit' must be between 0 and 100.") + if overlap_diff_percent_limit != 20: + cmd.extend(["--overlap_diff_percent_limit", str(overlap_diff_percent_limit)]) + + # --- UMI Preprocessing --- + if umi: + cmd.append("--umi") + if umi_loc: + valid_umi_locs = ["index1", "index2", "read1", "read2", "per_index", "per_read"] + if umi_loc not in valid_umi_locs: + raise ValueError(f"'umi_loc' must be one of {valid_umi_locs}, but got '{umi_loc}'.") + cmd.extend(["--umi_loc", umi_loc]) + if umi_loc in ["read1", "read2"] and umi_len <= 0: + raise ValueError("'umi_len' must be provided and positive if 'umi_loc' is 'read1' or 'read2'.") + if umi_len < 0: raise ValueError("'umi_len' must be non-negative.") + if umi_len > 0: # Default 0 means not specified + cmd.extend(["--umi_len", str(umi_len)]) + if umi_prefix: + cmd.extend(["--umi_prefix", umi_prefix]) + if umi_skip < 0: raise ValueError("'umi_skip' must be non-negative.") + if umi_skip > 0: # Default 0 means no skip + cmd.extend(["--umi_skip", str(umi_skip)]) + elif any([umi_loc, umi_len > 0, umi_prefix, umi_skip > 0]): + raise ValueError("UMI options ('umi_loc', 'umi_len', 'umi_prefix', 'umi_skip') require '--umi' to be enabled.") + + # --- Overrepresentation Analysis --- + if overrepresentation_analysis: + cmd.append("--overrepresentation_analysis") + if not (1 <= overrepresentation_sampling <= 10000): + raise ValueError("'overrepresentation_sampling' must be between 1 and 10000.") + if overrepresentation_sampling != 20: + cmd.extend(["--overrepresentation_sampling", str(overrepresentation_sampling)]) + + # --- Report Title --- + if report_title != "fastp report": + cmd.extend(["--report_title", report_title]) + + # --- Threading --- + if thread < 1: + raise ValueError("'thread' number must be at least 1.") + if thread != 2: # Default is 2 + cmd.extend(["--thread", str(thread)]) + + # --- Splitting Output --- + if split > 0 and split_by_lines > 0: + raise ValueError("Cannot use both '--split' and '--split_by_lines' simultaneously.") + if split > 0: + if not (2 <= split <= 999): + raise ValueError("'split' must be between 2 and 999 (or 0 to disable).") + cmd.extend(["--split", str(split)]) + if split_by_lines > 0: + if not (split_by_lines >= 1000): + raise ValueError("'split_by_lines' must be at least 1000 (or 0 to disable).") + cmd.extend(["--split_by_lines", str(split_by_lines)]) + if split > 0 or split_by_lines > 0: # Only add prefix digits if splitting is enabled + if not (0 <= split_prefix_digits <= 10): + raise ValueError("'split_prefix_digits' must be between 0 and 10.") + if split_prefix_digits != 4: + cmd.extend(["--split_prefix_digits", str(split_prefix_digits)]) + + # --- Execute fastp --- + command_executed = " ".join(map(str, cmd)) # Ensure all parts are strings for join + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + stdout = process.stdout + stderr = process.stderr + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"fastp command failed with exit code {e.returncode}", + "output_files": [] + } + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: fastp executable not found. Please ensure it is installed and in your PATH.", + "error": "fastp executable not found", + "output_files": [] + } + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": [str(f) for f in output_files if f.exists()] # Only return existing files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f189828142818f249adb3bf1351900044535b7d2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/fastp_server.py') +SERVER_NAME = 'biosci_fastp' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..5b31f6868b9f07adb27a8e73bc4f8ce725d2ac47 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-fastp: + build: . + image: mcp-fastp:latest + container_name: mcp-fastp + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=fastp + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7fa6507b607e39e2369bcfe0b4d21a384328914d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - fastp + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastp/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4a46b609ae07f90c3549799577d88835ea8fa245 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install fastqc via conda (e.g., from bioconda) +RUN conda install -c bioconda fastqc -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/fastqc_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/fastqc_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/fastqc_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f36091d83309d23a007c5bd9df589c96c1fc2874 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_server.py @@ -0,0 +1,193 @@ +import subprocess +import logging +from pathlib import Path +from typing import List, Optional, Literal + +# Setup logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be: +# from mcp import tool as mcp_tool +class mcp: + @staticmethod + def tool(func): + return func + +@mcp.tool +def fastqc( + seqfiles: List[Path], + outdir: Optional[Path] = None, + threads: int = 1, + contaminants: Optional[Path] = None, + adapters: Optional[Path] = None, + kmers: int = 7, + format: Optional[Literal["bam", "sam", "bam_mapped", "sam_mapped", "fastq"]] = None, + quiet: bool = False, + casava: bool = False, + nano: bool = False, + nofilter: bool = False, + extract: bool = False, + nogroup: bool = False, + min_length: Optional[int] = None, + fast5_dir: Optional[Path] = None, + no_summary: bool = False, +) -> dict: + """ + Runs FastQC, a quality control tool for high throughput sequence data. + + FastQC reads a set of sequence files and produces a quality control report + in HTML format, along with a zip archive containing the raw data. + + Args: + seqfiles: A list of sequence files to be processed (e.g., FASTQ, BAM, SAM). + outdir: Directory to store all output files. Must exist beforehand. + If not set, output is saved in the same directory as each input file. + threads: Number of files to process simultaneously. Defaults to 1. + contaminants: Path to a non-default file listing contaminants. + adapters: Path to a non-default file listing adapter sequences. + kmers: The length of k-mer to look for in the K-mer content module. Must be between 2 and 10. Defaults to 7. + format: Bypasses format detection. Forces FastQC to use the specified format. + quiet: Suppress all progress messages on stdout and only report errors. + casava: Indicates that files come from raw Casava output. + nano: Indicates that files are Nanopore fast5 files. + nofilter: Disables read filtering for reads failing QC. + extract: Uncompresses the output zip file after creation. + nogroup: Disables base grouping for reads >50bp. WARNING: Can be memory-intensive. + min_length: Sets an artificial lower limit on the sequence length for reporting. + fast5_dir: For Nanopore data, specifies the directory containing raw fast5 files. + no_summary: Prevents the generation of summary.txt and images.zip files. + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of output files. + """ + # --- Input Validation --- + if not seqfiles: + raise ValueError("At least one sequence file must be provided.") + for seqfile in seqfiles: + if not seqfile.is_file(): + raise FileNotFoundError(f"Input sequence file not found: {seqfile}") + + if outdir: + if not outdir.is_dir(): + raise NotADirectoryError(f"Output directory does not exist: {outdir}") + + if not 1 <= threads: + raise ValueError("Number of threads must be at least 1.") + + if contaminants and not contaminants.is_file(): + raise FileNotFoundError(f"Contaminants file not found: {contaminants}") + + if adapters and not adapters.is_file(): + raise FileNotFoundError(f"Adapters file not found: {adapters}") + + if not 2 <= kmers <= 10: + raise ValueError("K-mer size must be between 2 and 10.") + + if min_length is not None and min_length < 1: + raise ValueError("min_length must be a positive integer.") + + if fast5_dir and not fast5_dir.is_dir(): + raise NotADirectoryError(f"Fast5 directory not found: {fast5_dir}") + + # --- Command Construction --- + cmd = ["fastqc"] + + if outdir: + cmd.extend(["--outdir", str(outdir)]) + + cmd.extend(["--threads", str(threads)]) + + if contaminants: + cmd.extend(["--contaminants", str(contaminants)]) + + if adapters: + cmd.extend(["--adapters", str(adapters)]) + + cmd.extend(["--kmers", str(kmers)]) + + if format: + cmd.extend(["--format", format]) + + if quiet: + cmd.append("--quiet") + if casava: + cmd.append("--casava") + if nano: + cmd.append("--nano") + if nofilter: + cmd.append("--nofilter") + if extract: + cmd.append("--extract") + if nogroup: + cmd.append("--nogroup") + if no_summary: + cmd.append("--no-summary") + + if min_length is not None: + cmd.extend(["--min_length", str(min_length)]) + + if fast5_dir: + cmd.extend(["--fast5-dir", str(fast5_dir)]) + + cmd.extend([str(sf) for sf in seqfiles]) + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + except FileNotFoundError: + raise RuntimeError("fastqc not found. Please ensure it is installed and in your PATH.") + except subprocess.CalledProcessError as e: + logger.error(f"FastQC failed with exit code {e.returncode}") + logger.error(f"Stdout: {e.stdout}") + logger.error(f"Stderr: {e.stderr}") + raise e + + # --- Output File Discovery --- + output_files = [] + for seqfile in seqfiles: + # FastQC uses the file stem for output names. + # e.g., 'my_reads.fastq.gz' -> stem 'my_reads.fastq' -> output 'my_reads.fastq_fastqc.html' + # e.g., 'my_reads.fastq' -> stem 'my_reads' -> output 'my_reads_fastqc.html' + stem = seqfile.stem + + # Output is placed in outdir if specified, otherwise next to the input file. + current_output_dir = outdir if outdir else seqfile.parent + + html_output = current_output_dir / f"{stem}_fastqc.html" + zip_output = current_output_dir / f"{stem}_fastqc.zip" + + if html_output.exists(): + output_files.append(str(html_output)) + if zip_output.exists(): + output_files.append(str(zip_output)) + + if extract: + extracted_dir = current_output_dir / f"{stem}_fastqc" + if extracted_dir.is_dir(): + output_files.append(str(extracted_dir)) + + # Discover summary files, which are generated in the main output directory + if not no_summary: + summary_dir = outdir if outdir else seqfiles[0].parent + summary_txt = summary_dir / "summary.txt" + images_zip = summary_dir / "images.zip" + if summary_txt.exists(): + output_files.append(str(summary_txt)) + if images_zip.exists(): + output_files.append(str(images_zip)) + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": sorted(list(set(output_files))), # Ensure unique paths + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0ca8d91748a3aef39a91a2c87c70726eac39b728 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/fastqc_server.py') +SERVER_NAME = 'biosci_fastqc' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..b485c7107b50c9c6a9edf5ee3c6a0f48ba7f7d0f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-fastqc: + build: . + image: mcp-fastqc:latest + container_name: mcp-fastqc + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=fastqc + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e27c18d74da1786962c7e7a84138540b00eb640a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - fastqc + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fastqc/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ad5b64c271d3c8d2a352ffc42c8040aacd559220 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install fasttree via conda (e.g., from bioconda) +RUN conda install -c bioconda fasttree -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/fasttree_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/fasttree_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/fasttree_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e5f0a72a894387ddf3c58aa6345917bbab8d61f4 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_server.py @@ -0,0 +1,223 @@ +import logging +import subprocess +from pathlib import Path +from typing import Dict, List, Optional, Union +import tempfile + +# Dummy decorator to allow the code to be syntactically correct without the MCP framework. +# In a real MCP environment, this would be provided by the framework. +class mcp: + def tool(func): + return func + +@mcp.tool +def fasttree( + alignment_file: Path, + output_tree_file: Optional[Path] = None, + log_file: Optional[Path] = None, + nucleotide: bool = False, + model: Optional[str] = None, + gamma: bool = False, + search_thoroughness: str = "normal", + no_ml: bool = False, + no_me: bool = False, + initial_tree: Optional[Path] = None, + initial_tree_round1: Optional[Path] = None, + bootstraps: Optional[int] = None, + sh_test: bool = False, + no_support: bool = False, + no_cat: bool = False, + categories: int = 20, + pseudocounts: bool = False, + bionj: bool = False, + nj: bool = False, + matrix_file: Optional[Path] = None, + constraints_file: Optional[Path] = None, + constraint_weight: Optional[float] = None, + seed: Optional[int] = None, + min_evolution_rounds: Optional[int] = None, + quiet: bool = False, + executable_name: str = "FastTree", +) -> Dict[str, Union[str, List[str], Dict[str, str]]]: + """ + Run FastTree to infer an approximately-maximum-likelihood phylogenetic tree. + + FastTree infers approximately-maximum-likelihood phylogenetic trees from alignments of + nucleotide or protein sequences. It is designed for large alignments. + + Args: + alignment_file: Path to the input alignment file in FASTA or Phylip format. + output_tree_file: Path to save the output tree file in Newick format. + If not provided, the tree is written to a temporary file. + log_file: Path to save the log file with progress and model parameters. + nucleotide: Assume nucleotide alignment (-nt). Default is protein. + model: Specify the substitution model. For nucleotides, 'gtr' is the only valid option. + For proteins, choices are 'wag' (default) or 'jtt' ('jones'). + gamma: Re-optimize the gamma20 likelihood model parameters after each round of topology optimization. + search_thoroughness: Control the search thoroughness. + Choices: 'normal', 'fastest', 'slow', 'slowest'. + no_ml: Do not perform maximum-likelihood steps (-noml). + no_me: Do not perform minimum-evolution steps (-nome). + initial_tree: Path to a starting tree file (-intree). + initial_tree_round1: Path to a starting tree for the first round only (-intree1). + bootstraps: Number of bootstrap replicates for branch support (-boot). + sh_test: Compute local support values with the Shimodaira-Hasegawa test (-sh). + no_support: Do not compute any support values (-nosupport). + no_cat: Do not use the CAT approximation of rate heterogeneity (-nocat). + categories: Number of rate categories for the CAT approximation (-cat). + pseudocounts: Use pseudocounts to handle gaps in protein alignments (-pseudo). + bionj: Use BIONJ for the initial tree (-bionj). Mutually exclusive with 'nj'. + nj: Use Neighbor-Joining for the initial tree (-nj). Mutually exclusive with 'bionj'. + matrix_file: Path to a user-provided substitution matrix file (-matrix). + constraints_file: Path to a file with topological constraints (-constraints). + constraint_weight: Weight for the topological constraints (-constraintWeight). + seed: Specify a random seed for bootstrapping (-seed). + min_evolution_rounds: Number of rounds of minimum-evolution-based topology improvement (-n). + quiet: Suppress progress indicators (-quiet or -nopr). + executable_name: The name of the FastTree executable (e.g., 'FastTree', 'FastTreeMP'). + + Returns: + A dictionary containing the executed command, stdout, stderr, and a dict of output file paths. + """ + # 1. Input Validation + if not alignment_file.is_file(): + raise FileNotFoundError(f"Alignment file not found: {alignment_file}") + + for file_path in [initial_tree, initial_tree_round1, matrix_file, constraints_file]: + if file_path and not file_path.is_file(): + raise FileNotFoundError(f"Input file not found: {file_path}") + + if nucleotide: + if model and model.lower() != 'gtr': + raise ValueError("For nucleotide data (-nt), the only valid model is 'gtr'.") + else: + if model and model.lower() not in ['wag', 'jtt', 'jones']: + raise ValueError("For protein data, valid models are 'wag' or 'jtt' ('jones').") + + allowed_search = ["normal", "fastest", "slow", "slowest"] + if search_thoroughness not in allowed_search: + raise ValueError(f"search_thoroughness must be one of {allowed_search}") + + if bionj and nj: + raise ValueError("Cannot specify both -bionj and -nj simultaneously.") + + if bootstraps is not None and bootstraps <= 0: + raise ValueError("Number of bootstraps must be a positive integer.") + + if categories <= 0: + raise ValueError("Number of categories must be a positive integer.") + + # 2. Command Construction + cmd = [executable_name] + + if nucleotide: + cmd.append("-nt") + if model: + if model.lower() == 'gtr': + cmd.append("-gtr") + elif model.lower() == 'wag': + cmd.append("-wag") + elif model.lower() in ['jtt', 'jones']: + cmd.append("-jones") + + if gamma: + cmd.append("-gamma") + + if search_thoroughness != "normal": + cmd.append(f"-{search_thoroughness}") + + if no_ml: + cmd.append("-noml") + if no_me: + cmd.append("-nome") + if no_support: + cmd.append("-nosupport") + if sh_test: + cmd.append("-sh") + if no_cat: + cmd.append("-nocat") + if pseudocounts: + cmd.append("-pseudo") + if bionj: + cmd.append("-bionj") + if nj: + cmd.append("-nj") + if quiet: + cmd.append("-quiet") + + if bootstraps is not None: + cmd.extend(["-boot", str(bootstraps)]) + if categories != 20: + cmd.extend(["-cat", str(categories)]) + if min_evolution_rounds is not None: + cmd.extend(["-n", str(min_evolution_rounds)]) + if seed is not None: + cmd.extend(["-seed", str(seed)]) + if constraint_weight is not None: + cmd.extend(["-constraintWeight", str(constraint_weight)]) + + if initial_tree: + cmd.extend(["-intree", str(initial_tree)]) + if initial_tree_round1: + cmd.extend(["-intree1", str(initial_tree_round1)]) + if matrix_file: + cmd.extend(["-matrix", str(matrix_file)]) + if constraints_file: + cmd.extend(["-constraints", str(constraints_file)]) + if log_file: + cmd.extend(["-log", str(log_file)]) + + output_files = {} + tree_output_path = output_tree_file + if output_tree_file: + cmd.extend(["-out", str(output_tree_file)]) + + # Positional argument for alignment file must be last + cmd.append(str(alignment_file)) + + # 3. Subprocess Execution + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + except FileNotFoundError: + raise RuntimeError(f"Executable '{executable_name}' not found. Please ensure FastTree is installed and in your PATH.") + except subprocess.CalledProcessError as e: + logging.error(f"FastTree failed with exit code {e.returncode}") + logging.error(f"Stdout: {e.stdout}") + logging.error(f"Stderr: {e.stderr}") + # Return structured error information + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": {}, + "error": "FastTree execution failed." + } + + # 4. Structured Result Return + if not tree_output_path: + # If no output file was specified, FastTree writes the tree to stdout. + # We capture it and save it to a temporary file for a consistent output format. + with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix=".tre", prefix="fasttree_") as tmp_out: + tmp_out.write(result.stdout) + tree_output_path = Path(tmp_out.name) + output_files["tree_file"] = str(tree_output_path) + else: + output_files["tree_file"] = str(tree_output_path) + + if log_file: + output_files["log_file"] = str(log_file) + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b2b8464b5c8b3dc18147b72d19a8bcb860750a6d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/fasttree_server.py') +SERVER_NAME = 'biosci_fasttree' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f0f9219f1259b7fafa6a7222308882eba4466f6d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-fasttree: + build: . + image: mcp-fasttree:latest + container_name: mcp-fasttree + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=fasttree + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..21d1a55034d86ae50f9df94ad50b2d935d527fa0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - fasttree + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fasttree/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0fba7c013d69f5087a707d9ce0a234c4f581f523 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install fgbio via conda (e.g., from bioconda) +RUN conda install -c bioconda fgbio -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/fgbio_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/fgbio_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/fgbio_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b4408621b7f5569b9646d53c6d72fbe3a7c4c063 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_server.py @@ -0,0 +1,372 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Union +import os + +def run_fgbio_command(command: List[str]): + """Helper to execute fgbio commands and handle errors.""" + try: + # Ensure fgbio is in the path or use a specific path if needed + result = subprocess.run( + command, + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": " ".join(command), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(command), + "stdout": e.stdout, + "stderr": e.stderr, + "status": "error", + "error_message": str(e) + } + +@mcp.tool() +def fastq_to_bam( + input_fastqs: List[str], + output: str, + sample: str, + library: str, + platform: str = "ILLUMINA", + read_group_id: str = "1", + sort_order: str = "queryname", + predicted_insert_size: Optional[int] = None, + description: Optional[str] = None, + comment: Optional[List[str]] = None, +): + """ + Converts FASTQ files to an unmapped BAM file. + + Args: + input_fastqs: One or two FASTQ files (for single-end or paired-end). + output: The output BAM file. + sample: The sample name. + library: The library name. + platform: The platform (e.g., ILLUMINA). + read_group_id: The read group ID. + sort_order: The sort order for the output BAM. + predicted_insert_size: Predicted average insert size. + description: Read group description. + comment: Comments to add to the BAM header. + """ + for f in input_fastqs: + if not Path(f).exists(): + return {"error": f"Input FASTQ file not found: {f}"} + + cmd = ["fgbio", "FastqToBam", "--input"] + input_fastqs + cmd += ["--output", output, "--sample", sample, "--library", library] + cmd += ["--platform", platform, "--read-group-id", read_group_id, "--sort-order", sort_order] + + if predicted_insert_size is not None: + cmd += ["--predicted-insert-size", str(predicted_insert_size)] + if description: + cmd += ["--description", description] + if comment: + for c in comment: + cmd += ["--comment", c] + + return run_fgbio_command(cmd) + +@mcp.tool() +def extract_umis_from_bam( + input_bam: str, + output: str, + read_structure: List[str], + molecular_index_tags: List[str] = ["RX"], + single_tag: Optional[str] = None, + annotate_unknown_tags: bool = False, +): + """ + Extracts UMIs from reads in a BAM file and stores them in tags. + + Args: + input_bam: The input BAM file. + output: The output BAM file. + read_structure: The read structures (one per read in the template). e.g. ["5M2S+T", "7M1S+T"] + molecular_index_tags: The tag(s) to store the molecular indexes in. + single_tag: If provided, all UMIs are concatenated into this single tag. + annotate_unknown_tags: If true, annotate tags even if they are not molecular indexes. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "ExtractUmisFromBam", "--input", input_bam, "--output", output] + cmd += ["--read-structure"] + read_structure + cmd += ["--molecular-index-tags"] + molecular_index_tags + + if single_tag: + cmd += ["--single-tag", single_tag] + if annotate_unknown_tags: + cmd += ["--annotate-unknown-tags", "true"] + + return run_fgbio_command(cmd) + +@mcp.tool() +def group_reads_by_umi( + input_bam: str, + output: str, + strategy: str = "adjacency", + edits: int = 1, + min_map_q: int = 1, + family_size_histogram: Optional[str] = None, + assign_tag: str = "MI", +): + """ + Groups reads together that appear to have come from the same original molecule. + + Args: + input_bam: The input BAM file (must be sorted by template or coordinate). + output: The output BAM file. + strategy: The UMI grouping strategy (identity, edit, adjacency). + edits: The number of edits allowed between UMIs. + min_map_q: The minimum mapping quality for a read to be used. + family_size_histogram: Optional file to write family size histogram. + assign_tag: The tag to store the molecular identifier (family ID). + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "GroupReadsByUmi", "--input", input_bam, "--output", output] + cmd += ["--strategy", strategy, "--edits", str(edits), "--min-map-q", str(min_map_q)] + cmd += ["--assign-tag", assign_tag] + + if family_size_histogram: + cmd += ["--family-size-histogram", family_size_histogram] + + return run_fgbio_command(cmd) + +@mcp.tool() +def call_molecular_consensus_reads( + input_bam: str, + output: str, + min_reads: int = 1, + min_input_base_quality: int = 10, + max_reads_per_family: int = 100, + tag: str = "MI", + read_group_id: Optional[str] = None, + sort_order: str = "queryname", +): + """ + Calls consensus sequences from reads grouped by UMI. + + Args: + input_bam: The input BAM file grouped by UMI. + output: The output BAM file of consensus reads. + min_reads: The minimum number of reads to generate a consensus. + min_input_base_quality: The minimum base quality to include a base in consensus calling. + max_reads_per_family: The maximum number of reads to use from any one family. + tag: The tag containing the molecular identifier. + read_group_id: The read group ID to use for the consensus reads. + sort_order: The sort order of the output BAM. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "CallMolecularConsensusReads", "--input", input_bam, "--output", output] + cmd += ["--min-reads", str(min_reads), "--min-input-base-quality", str(min_input_base_quality)] + cmd += ["--max-reads-per-family", str(max_reads_per_family), "--tag", tag, "--sort-order", sort_order] + + if read_group_id: + cmd += ["--read-group-id", read_group_id] + + return run_fgbio_command(cmd) + +@mcp.tool() +def filter_consensus_reads( + input_bam: str, + output: str, + ref: str, + min_reads: List[int] = [1], + min_base_quality: int = 20, + max_read_error_rate: float = 0.05, + max_base_error_rate: float = 0.1, + max_no_call_fraction: float = 0.2, +): + """ + Filters consensus reads generated by CallMolecularConsensusReads. + + Args: + input_bam: The input BAM file of consensus reads. + output: The output filtered BAM file. + ref: The reference FASTA file. + min_reads: The minimum number of reads supporting the consensus (can be multiple values). + min_base_quality: The minimum base quality for a consensus base. + max_read_error_rate: The maximum error rate for a read to be kept. + max_base_error_rate: The maximum error rate for a single base. + max_no_call_fraction: The maximum fraction of no-calls (N) in a read. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + if not Path(ref).exists(): + return {"error": f"Reference file not found: {ref}"} + + cmd = ["fgbio", "FilterConsensusReads", "--input", input_bam, "--output", output, "--ref", ref] + cmd += ["--min-reads"] + [str(m) for m in min_reads] + cmd += ["--min-base-quality", str(min_base_quality)] + cmd += ["--max-read-error-rate", str(max_read_error_rate)] + cmd += ["--max-base-error-rate", str(max_base_error_rate)] + cmd += ["--max-no-call-fraction", str(max_no_call_fraction)] + + return run_fgbio_command(cmd) + +@mcp.tool() +def clip_bam( + input_bam: str, + output: str, + ref: str, + soft_clip: bool = False, + clip_overlapping_reads: bool = True, + upgrade_clipping: bool = False, + read_structure: Optional[List[str]] = None, +): + """ + Clips reads in a BAM file to remove adapter sequences or overlapping segments. + + Args: + input_bam: The input BAM file. + output: The output BAM file. + ref: The reference FASTA file. + soft_clip: If true, use soft clipping instead of hard clipping. + clip_overlapping_reads: If true, clip overlapping segments of paired-end reads. + upgrade_clipping: If true, upgrade existing clipping. + read_structure: Optional read structures to identify segments to clip. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + if not Path(ref).exists(): + return {"error": f"Reference file not found: {ref}"} + + cmd = ["fgbio", "ClipBam", "--input", input_bam, "--output", output, "--ref", ref] + cmd += ["--soft-clip", str(soft_clip).lower()] + cmd += ["--clip-overlapping-reads", str(clip_overlapping_reads).lower()] + cmd += ["--upgrade-clipping", str(upgrade_clipping).lower()] + + if read_structure: + cmd += ["--read-structure"] + read_structure + + return run_fgbio_command(cmd) + +@mcp.tool() +def sort_bam( + input_bam: str, + output: str, + sort_order: str = "coordinate", + max_records_in_ram: int = 500000, + tmp_dir: Optional[str] = None, +): + """ + Sorts a BAM file. + + Args: + input_bam: The input BAM file. + output: The output sorted BAM file. + sort_order: The order to sort the BAM (coordinate, queryname, random, etc.). + max_records_in_ram: The maximum number of records to keep in RAM. + tmp_dir: Directory for temporary files. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "SortBam", "--input", input_bam, "--output", output, "--sort-order", sort_order] + cmd += ["--max-records-in-ram", str(max_records_in_ram)] + + if tmp_dir: + cmd += ["--tmp-dir", tmp_dir] + + return run_fgbio_command(cmd) + +@mcp.tool() +def collect_duplication_metrics( + input_bam: str, + output: str, + description: Optional[str] = None, +): + """ + Collects metrics about duplicate reads in a BAM file. + + Args: + input_bam: The input BAM file. + output: The output metrics file. + description: Description of the library/run. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "CollectDuplicationMetrics", "--input", input_bam, "--output", output] + + if description: + cmd += ["--description", description] + + return run_fgbio_command(cmd) + +@mcp.tool() +def sam_to_fastq( + input_bam: str, + fastq1: str, + fastq2: Optional[str] = None, + interleave: bool = False, + include_non_primary_alignments: bool = False, +): + """ + Converts a BAM/SAM file to FASTQ. + + Args: + input_bam: The input BAM/SAM file. + fastq1: The output FASTQ file for read 1. + fastq2: The output FASTQ file for read 2 (optional). + interleave: If true, interleave R1 and R2 in a single FASTQ file. + include_non_primary_alignments: If true, include non-primary alignments. + """ + if not Path(input_bam).exists(): + return {"error": f"Input BAM file not found: {input_bam}"} + + cmd = ["fgbio", "SamToFastq", "--input", input_bam, "--fastq", fastq1] + + if fastq2: + cmd += ["--fastq2", fastq2] + if interleave: + cmd += ["--interleave", "true"] + if include_non_primary_alignments: + cmd += ["--include-non-primary-alignments", "true"] + + return run_fgbio_command(cmd) + +@mcp.tool() +def zipper_bams( + unmapped_bam: str, + mapped_bam: str, + output: str, + ref: str, + tags_to_reverse: List[str] = ["RX", "OX", "BZ"], + tags_to_revcomp: List[str] = ["RX", "OX", "BZ"], +): + """ + Zips together an unmapped BAM and a mapped BAM to produce a mapped BAM with all tags. + + Args: + unmapped_bam: The unmapped BAM file. + mapped_bam: The mapped BAM file. + output: The output mapped BAM file. + ref: The reference FASTA file. + tags_to_reverse: Tags to reverse when the read is mapped to the negative strand. + tags_to_revcomp: Tags to reverse-complement when the read is mapped to the negative strand. + """ + if not Path(unmapped_bam).exists(): + return {"error": f"Unmapped BAM file not found: {unmapped_bam}"} + if not Path(mapped_bam).exists(): + return {"error": f"Mapped BAM file not found: {mapped_bam}"} + if not Path(ref).exists(): + return {"error": f"Reference file not found: {ref}"} + + cmd = ["fgbio", "ZipperBams", "--unmapped", unmapped_bam, "--mapped", mapped_bam, "--output", output, "--ref", ref] + cmd += ["--tags-to-reverse"] + tags_to_reverse + cmd += ["--tags-to-revcomp"] + tags_to_revcomp + + return run_fgbio_command(cmd) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6c4db44511bdf4fc4644298ba0880dee2ee9b5a8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/fgbio_server.py') +SERVER_NAME = 'biosci_fgbio' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..7487134571869fa24811a5d1a88a41383b58b844 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-fgbio: + build: . + image: mcp-fgbio:latest + container_name: mcp-fgbio + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=fgbio + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e88743b4cc21e314b6e4f5bd22a99f0aa605b896 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - fgbio + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_fgbio/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a1e9da8ed252396478d9cfa3426d092388070c5a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install flye via conda (e.g., from bioconda) +RUN conda install -c bioconda flye -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/flye_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/flye_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/flye_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6e57ad9f0f6a53db173f78cf3bf697a7b1d8f6f1 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_server.py @@ -0,0 +1,185 @@ +import subprocess +import logging +import shutil +from pathlib import Path +from typing import List, Optional, Literal + +# In a real MCP environment, the mcp package would be available. +# For this standalone script, we define a placeholder decorator. +class mcp: + @staticmethod + def tool(): + def decorator(func): + return func + return decorator + +@mcp.tool() +def flye_assemble( + reads: List[Path], + out_dir: Path, + read_type: Literal["pacbio-raw", "pacbio-corr", "pacbio-hifi", "nano-raw", "nano-corr", "nano-hq"], + genome_size: Optional[str] = None, + threads: int = 1, + iterations: int = 1, + meta: bool = False, + polish_target: Optional[Path] = None, + min_overlap: Optional[int] = None, + keep_haplotypes: bool = False, + debug: bool = False, + scaffold: bool = False, + resume: bool = False, + resume_from: Optional[str] = None, + stop_after: Optional[str] = None, + read_error: Optional[float] = None, + extra_params: Optional[str] = None, +): + """ + Runs the Flye assembler for long-read sequencing data. + + Flye is a de novo assembler for single-molecule sequencing reads, such as those + produced by PacBio and Oxford Nanopore Technologies. It can handle various + input read types and is suitable for assembling genomes of varying complexity, + including metagenomes. + + Args: + reads: A list of input read files (FASTA/FASTQ, can be gzipped). + out_dir: The path to the output directory where results will be stored. + read_type: The type of input reads. + genome_size: Estimated genome size (e.g., '5m', '2.6g'). + threads: Number of threads to use for the assembly. + iterations: Number of polishing iterations to perform. + meta: Enables metagenome assembly mode. + polish_target: Path to reads for polishing (optional, uses input reads if not set). + min_overlap: Minimum overlap length for contig assembly (default: auto). + keep_haplotypes: Do not collapse alternative haplotypes. + debug: Enable debug output for troubleshooting. + scaffold: Scaffold assembly using the assembly graph. + resume: Resume a previously failed or stopped assembly. + resume_from: Resume from a specific stage of the assembly. + stop_after: Stop the assembly after a specific stage. + read_error: Override the estimated read error rate (e.g., 0.03). + extra_params: Extra configuration parameters to pass to Flye. + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of + paths to the primary output files. + """ + # 1. Input validation + if not shutil.which("flye"): + raise RuntimeError("Flye executable not found in PATH.") + + if not reads: + raise ValueError("At least one input read file must be provided.") + + for read_file in reads: + if not read_file.is_file(): + raise FileNotFoundError(f"Input read file not found: {read_file}") + + if polish_target and not polish_target.is_file(): + raise FileNotFoundError(f"Polish target file not found: {polish_target}") + + if threads <= 0: + raise ValueError("Number of threads must be a positive integer.") + + if iterations < 0: + raise ValueError("Number of iterations cannot be negative.") + + # 2. Command construction + cmd = ["flye"] + + # Add read type and files + cmd.append(f"--{read_type}") + cmd.extend([str(p) for p in reads]) + + # Add required output directory + cmd.extend(["--out-dir", str(out_dir)]) + + # Add optional arguments + if genome_size: + cmd.extend(["--genome-size", genome_size]) + + cmd.extend(["--threads", str(threads)]) + cmd.extend(["--iterations", str(iterations)]) + + if meta: + cmd.append("--meta") + + if polish_target: + cmd.extend(["--polish-target", str(polish_target)]) + + if min_overlap is not None: + if min_overlap <= 0: + raise ValueError("min_overlap must be a positive integer.") + cmd.extend(["--min-overlap", str(min_overlap)]) + + if keep_haplotypes: + cmd.append("--keep-haplotypes") + + if debug: + cmd.append("--debug") + + if scaffold: + cmd.append("--scaffold") + + if resume: + cmd.append("--resume") + + if resume_from: + cmd.extend(["--resume-from", resume_from]) + + if stop_after: + cmd.extend(["--stop-after", stop_after]) + + if read_error is not None: + if not (0 < read_error < 1): + raise ValueError("read_error must be a float between 0 and 1.") + cmd.extend(["--read-error", str(read_error)]) + + if extra_params: + # Flye expects extra params as a single string, so we don't split it. + cmd.extend(["--extra-params", extra_params]) + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + # 3. Subprocess execution and error handling + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + except subprocess.CalledProcessError as e: + logging.error(f"Flye execution failed with exit code {e.returncode}") + logging.error(f"Stderr: {e.stderr}") + logging.error(f"Stdout: {e.stdout}") + # Return structured error information + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Flye failed with exit code {e.returncode}", + "output_files": [] + } + + # 4. Structured result return + output_files = [] + expected_outputs = [ + "assembly.fasta", + "assembly_graph.gfa", + "assembly_info.txt", + "flye.log", + "params.json" + ] + for f in expected_outputs: + output_path = out_dir / f + if output_path.exists(): + output_files.append(str(output_path)) + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..672e824f9d542ac50e4d73dff969f1df983afb82 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/flye_server.py') +SERVER_NAME = 'biosci_flye' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..02fcba1406f20e458cd69466b285439224edaaf8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-flye: + build: . + image: mcp-flye:latest + container_name: mcp-flye + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=flye + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b9da3a732c61cb3c8fd57969897cad39e5e8e0f6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - flye + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_flye/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_foldseek/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_foldseek/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_foldseek/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..514e5584fe2c6db4fd32bd51397c2c51d01e1aaa --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install gsmap via conda (e.g., from bioconda) +RUN conda install -c bioconda gsmap -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY gsmap_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/gsmap_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/gsmap_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_server.py new file mode 100644 index 0000000000000000000000000000000000000000..07ea0671fd4f98ea12a2a2eec1e793f7bd6b79c8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_server.py @@ -0,0 +1,643 @@ +import subprocess +import logging +import tempfile +from pathlib import Path +from typing import Optional, List + +# Configure logging +logging.basicConfig(level=logging.INFO) + +# Mock mcp.tool decorator for standalone execution +class mcp: + def tool(func): + return func + +@mcp.tool +def gsmap_quick_mode( + h5ad_path: Path, + gwas_path: Path, + output_dir: Path, + species: str = "human", + n_jobs: int = 1, + chunksize: int = 1, + device: str = "cpu", + ld_path: Optional[Path] = None, + weight_path: Optional[Path] = None, + annotation_path: Optional[Path] = None, + n_causal: int = 1000, + n_causal_annotation: int = 1000, + chrom: str = "all", + non_negative: bool = False, + print_process: bool = False, + find_latent_representations_args: Optional[str] = None, + latent_to_gene_args: Optional[str] = None, + generate_ldscore_args: Optional[str] = None, + spatial_ldsc_args: Optional[str] = None, + cauchy_combination_args: Optional[str] = None, + report_args: Optional[str] = None, +) -> dict: + """ + Run the entire gsMap pipeline in quick mode, utilizing pre-computed weights for faster execution. + """ + # Input validation + if not h5ad_path.exists(): + raise FileNotFoundError(f"Input h5ad file not found: {h5ad_path}") + if not gwas_path.exists(): + raise FileNotFoundError(f"Input GWAS file not found: {gwas_path}") + if species not in ["human", "mouse"]: + raise ValueError("species must be one of 'human' or 'mouse'") + if device not in ["cpu", "cuda"]: + raise ValueError("device must be one of 'cpu' or 'cuda'") + if ld_path and not ld_path.exists(): + raise FileNotFoundError(f"LD scores path not found: {ld_path}") + if weight_path and not weight_path.exists(): + raise FileNotFoundError(f"Weights path not found: {weight_path}") + if annotation_path and not annotation_path.exists(): + raise FileNotFoundError(f"Annotation file not found: {annotation_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "quick_mode", + "--h5ad_path", str(h5ad_path), + "--gwas_path", str(gwas_path), + "--output_dir", str(output_dir), + "--species", species, + "--n_jobs", str(n_jobs), + "--chunksize", str(chunksize), + "--device", device, + "--n_causal", str(n_causal), + "--n_causal_annotation", str(n_causal_annotation), + "--chrom", chrom, + ] + + if ld_path: + cmd.extend(["--ld_path", str(ld_path)]) + if weight_path: + cmd.extend(["--weight_path", str(weight_path)]) + if annotation_path: + cmd.extend(["--annotation_path", str(annotation_path)]) + if non_negative: + cmd.append("--non_negative") + if print_process: + cmd.append("--print_process") + if find_latent_representations_args: + cmd.extend(["--find_latent_representations_args", find_latent_representations_args]) + if latent_to_gene_args: + cmd.extend(["--latent_to_gene_args", latent_to_gene_args]) + if generate_ldscore_args: + cmd.extend(["--generate_ldscore_args", generate_ldscore_args]) + if spatial_ldsc_args: + cmd.extend(["--spatial_ldsc_args", spatial_ldsc_args]) + if cauchy_combination_args: + cmd.extend(["--cauchy_combination_args", cauchy_combination_args]) + if report_args: + cmd.extend(["--report_args", report_args]) + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(p) for p in output_dir.rglob('*') if p.is_file()] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap quick_mode failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap quick_mode failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_find_latent_representations( + h5ad_path: Path, + output_dir: Path, + n_neighbors: int = 6, + n_pcs: int = 50, + n_epochs: int = 1000, + lr: float = 0.001, + device: str = "cpu", + seed: int = 0, + print_process: bool = False, +) -> dict: + """ + Find the latent representations of each spot by running GNN. + """ + # Input validation + if not h5ad_path.exists(): + raise FileNotFoundError(f"Input h5ad file not found: {h5ad_path}") + if device not in ["cpu", "cuda"]: + raise ValueError("device must be one of 'cpu' or 'cuda'") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_find_latent_representations", + "--h5ad_path", str(h5ad_path), + "--output_dir", str(output_dir), + "--n_neighbors", str(n_neighbors), + "--n_pcs", str(n_pcs), + "--n_epochs", str(n_epochs), + "--lr", str(lr), + "--device", device, + "--seed", str(seed), + ] + + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Expected output file based on gsMap logic + output_file = output_dir / "latent.h5ad" + output_files = [str(output_file)] if output_file.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_find_latent_representations failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_find_latent_representations failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_latent_to_gene( + h5ad_path: Path, + output_dir: Path, + n_neighbors: int = 6, + n_jobs: int = 1, + chunksize: int = 1, + print_process: bool = False, +) -> dict: + """ + Estimate gene marker gene scores for each spot by using latent representations from nearby spots. + """ + # Input validation + if not h5ad_path.exists(): + raise FileNotFoundError(f"Input h5ad file not found: {h5ad_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_latent_to_gene", + "--h5ad_path", str(h5ad_path), + "--output_dir", str(output_dir), + "--n_neighbors", str(n_neighbors), + "--n_jobs", str(n_jobs), + "--chunksize", str(chunksize), + ] + + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Expected output file based on gsMap logic + output_file = output_dir / "latent_to_gene.h5ad" + output_files = [str(output_file)] if output_file.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_latent_to_gene failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_latent_to_gene failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_generate_ldscore( + output_dir: Path, + species: str, + ld_path: Optional[Path] = None, + weight_path: Optional[Path] = None, + n_jobs: int = 1, + chunksize: int = 1, + print_process: bool = False, +) -> dict: + """ + Generate LD scores for each spot. + """ + # Input validation + if species not in ["human", "mouse"]: + raise ValueError("species must be one of 'human' or 'mouse'") + if ld_path and not ld_path.exists(): + raise FileNotFoundError(f"LD scores path not found: {ld_path}") + if weight_path and not weight_path.exists(): + raise FileNotFoundError(f"Weights path not found: {weight_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_generate_ldscore", + "--output_dir", str(output_dir), + "--species", species, + "--n_jobs", str(n_jobs), + "--chunksize", str(chunksize), + ] + + if ld_path: + cmd.extend(["--ld_path", str(ld_path)]) + if weight_path: + cmd.extend(["--weight_path", str(weight_path)]) + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Expected output files based on gsMap logic + output_files = [str(p) for p in (output_dir / "ldscore").glob("*.l2.ldscore.gz")] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_generate_ldscore failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_generate_ldscore failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_spatial_ldsc( + gwas_path: Path, + output_dir: Path, + n_causal: int = 1000, + chrom: str = "all", + non_negative: bool = False, + n_jobs: int = 1, + chunksize: int = 1, + print_process: bool = False, +) -> dict: + """ + Run spatial LDSC for each spot. + """ + # Input validation + if not gwas_path.exists(): + raise FileNotFoundError(f"Input GWAS file not found: {gwas_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_spatial_ldsc", + "--gwas_path", str(gwas_path), + "--output_dir", str(output_dir), + "--n_causal", str(n_causal), + "--chrom", chrom, + "--n_jobs", str(n_jobs), + "--chunksize", str(chunksize), + ] + + if non_negative: + cmd.append("--non_negative") + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Expected output file based on gsMap logic + output_file = output_dir / "spatial_ldsc.csv" + output_files = [str(output_file)] if output_file.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_spatial_ldsc failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_spatial_ldsc failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_cauchy_combination( + output_dir: Path, + annotation_path: Path, + n_causal_annotation: int = 1000, + n_jobs: int = 1, + chunksize: int = 1, + print_process: bool = False, +) -> dict: + """ + Run Cauchy combination for each annotation. + """ + # Input validation + if not annotation_path.exists(): + raise FileNotFoundError(f"Annotation file not found: {annotation_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_cauchy_combination", + "--output_dir", str(output_dir), + "--annotation_path", str(annotation_path), + "--n_causal_annotation", str(n_causal_annotation), + "--n_jobs", str(n_jobs), + "--chunksize", str(chunksize), + ] + + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Expected output file based on gsMap logic + output_file = output_dir / "cauchy_combination.csv" + output_files = [str(output_file)] if output_file.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_cauchy_combination failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_cauchy_combination failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_run_report( + h5ad_path: Path, + output_dir: Path, + prefix: str = "gsMap", + spot_level_df_path: Optional[Path] = None, + annotation_level_df_path: Optional[Path] = None, + gene_level_df_path: Optional[Path] = None, + gene_name: Optional[str] = None, + annotation_name: Optional[str] = None, + fdr_threshold: float = 0.05, + dpi: int = 300, + print_process: bool = False, +) -> dict: + """ + Run Report to generate diagnostic plots and tables. + """ + # Input validation + if not h5ad_path.exists(): + raise FileNotFoundError(f"Input h5ad file not found: {h5ad_path}") + if spot_level_df_path and not spot_level_df_path.exists(): + raise FileNotFoundError(f"Spot level dataframe not found: {spot_level_df_path}") + if annotation_level_df_path and not annotation_level_df_path.exists(): + raise FileNotFoundError(f"Annotation level dataframe not found: {annotation_level_df_path}") + if gene_level_df_path and not gene_level_df_path.exists(): + raise FileNotFoundError(f"Gene level dataframe not found: {gene_level_df_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "run_report", + "--h5ad_path", str(h5ad_path), + "--output_dir", str(output_dir), + "--prefix", prefix, + "--fdr_threshold", str(fdr_threshold), + "--dpi", str(dpi), + ] + + if spot_level_df_path: + cmd.extend(["--spot_level_df_path", str(spot_level_df_path)]) + if annotation_level_df_path: + cmd.extend(["--annotation_level_df_path", str(annotation_level_df_path)]) + if gene_level_df_path: + cmd.extend(["--gene_level_df_path", str(gene_level_df_path)]) + if gene_name: + cmd.extend(["--gene_name", gene_name]) + if annotation_name: + cmd.extend(["--annotation_name", annotation_name]) + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(p) for p in output_dir.glob(f"{prefix}*")] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap run_report failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap run_report failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_format_sumstats( + gwas_path: Path, + output_path: Path, + snp: str = "SNP", + chr_col: str = "CHR", # Renamed to avoid conflict with builtin 'chr' + pos: str = "POS", + a1: str = "A1", + a2: str = "A2", + z: str = "Z", + n: str = "N", + p: str = "P", + info: str = "INFO", + maf: str = "MAF", + keep_ambiguous: bool = False, + print_process: bool = False, +) -> dict: + """ + Format GWAS summary statistics. + """ + # Input validation + if not gwas_path.exists(): + raise FileNotFoundError(f"Input GWAS file not found: {gwas_path}") + + output_path.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "format_sumstats", + "--gwas_path", str(gwas_path), + "--output_path", str(output_path), + "--snp", snp, + "--chr", chr_col, + "--pos", pos, + "--a1", a1, + "--a2", a2, + "--z", z, + "--n", n, + "--p", p, + "--info", info, + "--maf", maf, + ] + + if keep_ambiguous: + cmd.append("--keep_ambiguous") + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(output_path)] if output_path.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap format_sumstats failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap format_sumstats failed", + "return_code": e.returncode, + } + +@mcp.tool +def gsmap_create_slice_mean( + h5ad_paths: List[Path], + output_path: Path, + print_process: bool = False, +) -> dict: + """ + Create slice mean from multiple h5ad files. + """ + # Input validation + if not h5ad_paths: + raise ValueError("At least one h5ad path must be provided.") + for path in h5ad_paths: + if not path.exists(): + raise FileNotFoundError(f"Input h5ad file not found: {path}") + + output_path.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "gsmap", "create_slice_mean", + "--h5ad_paths", *[str(p) for p in h5ad_paths], + "--output_path", str(output_path), + ] + + if print_process: + cmd.append("--print_process") + + command_executed = " ".join(cmd) + logging.info(f"Executing command: {command_executed}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(output_path)] if output_path.exists() else [] + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + logging.error(f"gsmap create_slice_mean failed: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "gsmap create_slice_mean failed", + "return_code": e.returncode, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..a908c0bcfbc666ce26e5d0d3d06b170581a76bd8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/app/gsmap_server.py') +SERVER_NAME = 'biosci_gsmap' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..4e13f33899a40c515c76ae586978946b61fc9c56 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-gsmap: + build: . + image: mcp-gsmap:latest + container_name: mcp-gsmap + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=gsmap + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5182419fea6b98b4648059f2aebc72de2f176678 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - gsmap + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_gsmap/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..59483952effb91e93d6fe94ff3a4e05472227116 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install last via conda (e.g., from bioconda) +RUN conda install -c bioconda last -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/last_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/last_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/last_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c9294dc219d7821593823cbd26cb495b2615081e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_server.py @@ -0,0 +1,138 @@ +import subprocess +import shlex +from pathlib import Path +from typing import Optional, List, Literal + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be provided by the MCP framework. +class mcp: + @staticmethod + def tool(func): + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + return wrapper + +@mcp.tool +def last( + usernames: Optional[List[str]] = None, + ttys: Optional[List[str]] = None, + limit: Optional[int] = None, + hostlast: bool = False, + dns: bool = False, + file: Optional[Path] = None, + fulltimes: bool = False, + ip: bool = False, + nohostname: bool = False, + since: Optional[str] = None, + until: Optional[str] = None, + present: Optional[str] = None, + fullnames: bool = False, + system: bool = False, + time_format: Optional[Literal["notime", "short", "full", "iso"]] = None, +) -> dict: + """ + Show a listing of last logged in users. + + This tool is a wrapper for the 'last' command-line utility, which shows a + listing of the last users logged in, and their log in/out times. + + Args: + usernames: List of usernames to include in the report. + ttys: List of tty names to include in the report. + limit: How many lines to show. Corresponds to -n or -. + hostlast: Display hostnames in the last column. + dns: Translate the IP number back into a hostname. + file: Use a specific file instead of the system default (e.g., /var/log/wtmp). + fulltimes: Print full login and logout times and dates. + ip: Display IP numbers in numbers-and-dots notation. + nohostname: Don't display the hostname field. + since: Display the lines since the specified time. + until: Display the lines until the specified time. + present: Display who were present at the specified time. + fullnames: Display full user and domain names. + system: Display system shutdown entries and run level changes. + time_format: Show timestamps in the specified format. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output files. + """ + # --- Input Validation --- + if limit is not None and limit < 0: + raise ValueError("The 'limit' parameter must be a non-negative integer.") + + if file: + if not file.exists(): + raise FileNotFoundError(f"Input file not found: {file}") + if not file.is_file(): + raise ValueError(f"The path provided is not a file: {file}") + + # --- Command Construction --- + command = ["last"] + + if limit is not None: + command.extend(["-n", str(limit)]) + if hostlast: + command.append("-a") + if dns: + command.append("-d") + if file: + command.extend(["-f", str(file)]) + if fulltimes: + command.append("-F") + if ip: + command.append("-i") + if nohostname: + command.append("-R") + if since: + command.extend(["-s", since]) + if until: + command.extend(["-t", until]) + if present: + command.extend(["-p", present]) + if fullnames: + command.append("-w") + if system: + command.append("-x") + if time_format: + command.extend(["--time-format", time_format]) + + # Add positional arguments + if usernames: + command.extend(usernames) + if ttys: + command.extend(ttys) + + command_executed = shlex.join(command) + + # --- Subprocess Execution --- + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=True + ) + stdout = result.stdout + stderr = result.stderr + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'last' command not found. Please ensure it is installed and in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": [] # 'last' command does not produce output files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0eba9eaaea90e4d3869fb3ab64e8914c94a1c5c9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/last_server.py') +SERVER_NAME = 'biosci_last' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f11374230c29c61fa7cbe392bccd719c5bbd170f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-last: + build: . + image: mcp-last:latest + container_name: mcp-last + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=last + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3ca4459a1b5cfccdfb8ecc122b0d497c0670d4ff --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - last + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_last/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..089a5ac8ddef0130e2b63289fea1808fb4f8fa9b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install multivelo via conda (e.g., from bioconda) +RUN conda install -c bioconda multivelo -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY multivelo_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/multivelo_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/multivelo_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_server.py new file mode 100644 index 0000000000000000000000000000000000000000..71ff07ea56659c1b263921f5cf6db40854fb92f6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_server.py @@ -0,0 +1,153 @@ +import subprocess +from pathlib import Path +from typing import Optional, List +import logging + +# Set up logging +logging.basicConfig(level=logging.INFO) +log = logging.getLogger(__name__) + +# This is a placeholder for the actual MCP decorator. +# In a real MCP environment, this would be imported. +class mcp: + def tool(func): + return func + +@mcp.tool +def run_multivelo( + data_path: Path, + output_path: Path, + gene_list_path: Optional[Path] = None, + sample: Optional[str] = None, + modality: str = "rna", + cell_anno_key: str = "cell_type", + embed_key: str = "X_umap", + n_genes: int = 2000, + fig_path: Optional[Path] = None, + no_preproc: bool = False, + no_plot: bool = False, +) -> dict: + """ + Infers cell dynamics from multi-omics data using the multivelo command-line tool. + + This tool is a wrapper for the `multivelo` Python package, which performs + velocity estimation on multi-modal single-cell data. It requires an AnnData + object as input and produces a new AnnData object with velocity information. + + Args: + data_path: Path to the input anndata file (.h5ad). + output_path: Path to save the output anndata file (.h5ad). + gene_list_path: Optional path to a gene list file. + sample: Optional sample name to be processed from the anndata object. + modality: Modality to be used for velocity estimation (e.g., 'rna'). + cell_anno_key: Key in .obs for cell type annotations. + embed_key: Key in .obsm for the cell embedding (e.g., 'X_umap'). + n_genes: Number of highly variable genes to use for velocity estimation. + fig_path: Optional path to a directory to save figures. + no_preproc: If True, skips the preprocessing steps. + no_plot: If True, skips the plotting steps. + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of output files. + """ + # 1. Input Validation + if not data_path.is_file(): + raise FileNotFoundError(f"Input data file not found: {data_path}") + if gene_list_path and not gene_list_path.is_file(): + raise FileNotFoundError(f"Gene list file not found: {gene_list_path}") + if n_genes <= 0: + raise ValueError("n_genes must be a positive integer.") + + # 2. Ensure output directories exist + try: + output_path.parent.mkdir(parents=True, exist_ok=True) + if fig_path: + fig_path.mkdir(parents=True, exist_ok=True) + except OSError as e: + log.error(f"Failed to create output directories: {e}") + raise + + # 3. Command Construction + # The command is executed as a Python module. + cmd = [ + "python", + "-m", + "multivelo", + "--data_path", str(data_path), + "--output_path", str(output_path), + "--modality", modality, + "--cell_anno_key", cell_anno_key, + "--embed_key", embed_key, + "--n_genes", str(n_genes), + ] + + if gene_list_path: + cmd.extend(["--gene_list_path", str(gene_list_path)]) + if sample: + cmd.extend(["--sample", sample]) + if fig_path: + cmd.extend(["--fig_path", str(fig_path)]) + if no_preproc: + cmd.append("--no_preproc") + if no_plot: + cmd.append("--no_plot") + + command_executed = " ".join(cmd) + log.info(f"Executing command: {command_executed}") + + # 4. Subprocess Execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + except FileNotFoundError: + error_msg = "Error: 'python' executable not found. Please ensure Python and multivelo are installed and in your system's PATH." + log.error(error_msg) + # In a real MCP environment, you might raise a specific exception + # For this structure, we return an error dictionary. + return { + "error": error_msg, + "command_executed": command_executed, + "stdout": "", + "stderr": "", + } + except subprocess.CalledProcessError as e: + log.error(f"multivelo execution failed with return code {e.returncode}") + log.error(f"STDOUT: {e.stdout}") + log.error(f"STDERR: {e.stderr}") + return { + "error": "multivelo execution failed.", + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + } + + # 5. Structured Result Return + output_files = [] + if output_path.exists(): + output_files.append(str(output_path)) + else: + log.warning(f"Expected output file was not created: {output_path}") + + # If a figure path was provided, we can list the generated files. + # This assumes figures are PNGs, a common default. + if fig_path and fig_path.is_dir(): + generated_figs = [str(f) for f in fig_path.glob('*.png')] + if generated_figs: + output_files.extend(generated_figs) + else: + # Add the directory itself if no specific files are found + output_files.append(str(fig_path)) + + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..fe3dce043f820d5a19d8dd2ca3d0c0be31d9ee93 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/app/multivelo_server.py') +SERVER_NAME = 'biosci_multivelo' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..35bded64b155a199bf8d6c7650340b4ee9d41609 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-multivelo: + build: . + image: mcp-multivelo:latest + container_name: mcp-multivelo + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=multivelo + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9b2ed23315f6e900fd97d9dafc04758b6f6f29ae --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - multivelo + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_multivelo/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d305279877e92a2190f533f5e730714ffc279d56 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install peptide-shaker via conda (e.g., from bioconda) +RUN conda install -c bioconda peptide-shaker -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY peptide-shaker_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/peptide-shaker_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/peptide-shaker_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f5edc5f98c75f3f4687e5a8c164ceb02dad71c97 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_server.py @@ -0,0 +1,332 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Literal + +# MCP decorator is commented out as per instructions +# from mcp import tool as mcp + +@mcp.tool() +def peptide_shaker_run( + peptide_shaker_jar: Path, + identification_files: List[Path], + spectrum_files: List[Path], + fasta_file: Path, + output_psdb: Path, + id_params: Path, + config_folder: Optional[Path] = None, + threads: int = 4, + species: Optional[str] = None, + species_type: Optional[str] = None, + zip_output: Optional[Path] = None, + path_settings: Optional[str] = None, +): + """ + Runs the main PeptideShaker processing pipeline from identification and spectrum files. + + This is the primary tool for a de novo analysis, creating a PeptideShaker project + database (.psdb) from search engine results. + """ + # --- Input Validation --- + if not peptide_shaker_jar.is_file(): + raise FileNotFoundError(f"PeptideShaker JAR not found at: {peptide_shaker_jar}") + for f in identification_files: + if not f.is_file(): + raise FileNotFoundError(f"Identification file not found: {f}") + for f in spectrum_files: + if not f.is_file(): + raise FileNotFoundError(f"Spectrum file not found: {f}") + if not fasta_file.is_file(): + raise FileNotFoundError(f"FASTA file not found: {fasta_file}") + if not id_params.is_file(): + raise FileNotFoundError(f"Identification parameters file not found: {id_params}") + if config_folder and not config_folder.is_dir(): + raise NotADirectoryError(f"Config folder not found or is not a directory: {config_folder}") + if threads <= 0: + raise ValueError("Number of threads must be a positive integer.") + + # --- Command Construction --- + cmd = [ + "java", "-cp", str(peptide_shaker_jar), + "eu.isas.peptideshaker.cmd.PeptideShakerCLI", + "-identification_files", ",".join(map(str, identification_files)), + "-spectrum_files", ",".join(map(str, spectrum_files)), + "-fasta_file", str(fasta_file), + "-output", str(output_psdb), + "-id_params", str(id_params), + "-threads", str(threads), + ] + + if config_folder: + cmd.extend(["-config_folder", str(config_folder)]) + if species: + cmd.extend(["-species", species]) + if species_type: + cmd.extend(["-species_type", species_type]) + if zip_output: + cmd.extend(["-zip", str(zip_output)]) + if path_settings: + cmd.extend(["-path", path_settings]) + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(output_psdb)] + if zip_output: + output_files.append(str(zip_output)) + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "PeptideShakerCLI failed", + } + +@mcp.tool() +def peptide_shaker_report( + peptide_shaker_jar: Path, + input_psdb: Path, + output_folder: Path, + reports: List[int], + documentation_folder: Optional[Path] = None, +): + """ + Exports reports from an existing PeptideShaker project file (.psdb). + """ + # --- Input Validation --- + if not peptide_shaker_jar.is_file(): + raise FileNotFoundError(f"PeptideShaker JAR not found at: {peptide_shaker_jar}") + if not input_psdb.is_file(): + raise FileNotFoundError(f"Input PeptideShaker project file not found: {input_psdb}") + if not reports: + raise ValueError("At least one report index must be provided.") + for report_index in reports: + if not isinstance(report_index, int) or report_index <= 0: + raise ValueError(f"Report index '{report_index}' is invalid; indices must be positive integers.") + + # --- File Path Handling --- + output_folder.mkdir(parents=True, exist_ok=True) + if documentation_folder: + documentation_folder.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + cmd = [ + "java", "-cp", str(peptide_shaker_jar), + "eu.isas.peptideshaker.cmd.ReportCLI", + "-in", str(input_psdb), + "-out_reports", str(output_folder), + "-reports", ",".join(map(str, reports)), + ] + + if documentation_folder: + cmd.extend(["-documentation", str(documentation_folder)]) + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + # Return the directories as output, as file names are generated by the tool + output_locations = [str(output_folder)] + if documentation_folder: + output_locations.append(str(documentation_folder)) + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": output_locations, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ReportCLI failed", + } + +@mcp.tool() +def peptide_shaker_follow_up( + peptide_shaker_jar: Path, + input_psdb: Path, + output_psdb: Path, + contact: Optional[str] = None, + description: Optional[str] = None, + gene_mapping: bool = False, + go_analysis: bool = False, + validation_level: Optional[Literal["protein", "peptide", "psm"]] = None, + output_reports_folder: Optional[Path] = None, + reports: Optional[List[int]] = None, + documentation_folder: Optional[Path] = None, + zip_output: Optional[Path] = None, +): + """ + Performs follow-up analysis (e.g., gene mapping) on an existing PeptideShaker project. + """ + # --- Input Validation --- + if not peptide_shaker_jar.is_file(): + raise FileNotFoundError(f"PeptideShaker JAR not found at: {peptide_shaker_jar}") + if not input_psdb.is_file(): + raise FileNotFoundError(f"Input PeptideShaker project file not found: {input_psdb}") + if reports and not output_reports_folder: + raise ValueError("The 'reports' parameter requires 'output_reports_folder' to be set.") + + # --- File Path Handling --- + if output_reports_folder: + output_reports_folder.mkdir(parents=True, exist_ok=True) + if documentation_folder: + documentation_folder.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + cmd = [ + "java", "-cp", str(peptide_shaker_jar), + "eu.isas.peptideshaker.cmd.FollowUpCLI", + "-in", str(input_psdb), + "-output", str(output_psdb), + ] + + if contact: + cmd.extend(["-contact", contact]) + if description: + cmd.extend(["-description", description]) + if gene_mapping: + cmd.append("-gene") + if go_analysis: + cmd.append("-go") + if validation_level: + cmd.extend(["-validation_level", validation_level]) + if output_reports_folder: + cmd.extend(["-out_reports", str(output_reports_folder)]) + if reports: + cmd.extend(["-reports", ",".join(map(str, reports))]) + if documentation_folder: + cmd.extend(["-documentation", str(documentation_folder)]) + if zip_output: + cmd.extend(["-zip", str(zip_output)]) + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_files = [str(output_psdb)] + if zip_output: + output_files.append(str(zip_output)) + if output_reports_folder: + output_files.append(str(output_reports_folder)) + if documentation_folder: + output_files.append(str(documentation_folder)) + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "FollowUpCLI failed", + } + +@mcp.tool() +def peptide_shaker_mzid( + peptide_shaker_jar: Path, + input_psdb: Path, + output_mzid: Path, + contact_first_name: Optional[str] = None, + contact_last_name: Optional[str] = None, + contact_email: Optional[str] = None, + contact_address: Optional[str] = None, + contact_url: Optional[str] = None, + organization_name: Optional[str] = None, + organization_email: Optional[str] = None, + organization_address: Optional[str] = None, + organization_url: Optional[str] = None, + include_protein_sequences: bool = False, + gzip: bool = False, +): + """ + Exports a PeptideShaker project to the mzIdentML (.mzid) format. + """ + # --- Input Validation --- + if not peptide_shaker_jar.is_file(): + raise FileNotFoundError(f"PeptideShaker JAR not found at: {peptide_shaker_jar}") + if not input_psdb.is_file(): + raise FileNotFoundError(f"Input PeptideShaker project file not found: {input_psdb}") + + # --- Command Construction --- + cmd = [ + "java", "-cp", str(peptide_shaker_jar), + "eu.isas.peptideshaker.cmd.MzidCLI", + "-in", str(input_psdb), + "-output_file", str(output_mzid), + ] + + # Add contact and organization details if provided + contact_details = { + "-contact_first_name": contact_first_name, + "-contact_last_name": contact_last_name, + "-contact_email": contact_email, + "-contact_address": contact_address, + "-contact_url": contact_url, + } + org_details = { + "-organization_name": organization_name, + "-organization_email": organization_email, + "-organization_address": organization_address, + "-organization_url": organization_url, + } + for flag, value in {**contact_details, **org_details}.items(): + if value: + cmd.extend([flag, value]) + + if include_protein_sequences: + cmd.append("-include_protein_sequences") + if gzip: + cmd.append("-gzip") + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + output_file_path = str(output_mzid) + if gzip: + output_file_path += ".gz" + + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [output_file_path], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "MzidCLI failed", + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..656be787884a861b47b4d717d68263a04cfc86ef --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/app/peptide-shaker_server.py') +SERVER_NAME = 'biosci_peptide_shaker' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..0ea6b2d3c35625a373b36a54ced23734c0dcf8d0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-peptide-shaker: + build: . + image: mcp-peptide-shaker:latest + container_name: mcp-peptide-shaker + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=peptide-shaker + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d1e4c8c4259d63b89c1caceb0d821e17e2b375ad --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - peptide-shaker + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_peptide-shaker/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ffb5eaac759ff0959075bb715683824bbc7e7dde --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install perl-metabolomics-fragment-annotation via conda (e.g., from bioconda) +RUN conda install -c bioconda perl-metabolomics-fragment-annotation -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY perl-metabolomics-fragment-annotation_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/perl-metabolomics-fragment-annotation_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/perl-metabolomics-fragment-annotation_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_server.py new file mode 100644 index 0000000000000000000000000000000000000000..50a609b52de8d4e0a49849a2df54d1a7018cd213 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_server.py @@ -0,0 +1,140 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import Optional, List + +# The mcp.tool decorator is not defined here, as per the problem description. +# It is assumed to be provided by the MCP framework. +# +# @mcp.tool() +# def placeholder(): +# pass + + +@mcp.tool() +def fragment_annotation( + in_file: Path, + out_file: Path, + db_file: Optional[Path] = None, + mode: str = "positive", + precursor_mz: Optional[float] = None, + precursor_adduct: Optional[str] = None, + fragment_tol: float = 0.01, + fragment_tol_unit: str = "Da", + min_intensity: float = 1.0, + max_depth: int = 2, + verbose: bool = False, +) -> dict: + """ + Annotates MS/MS fragment ions from metabolomics data using fragment-annotation.pl. + + This tool takes a peak list file (e.g., MGF, MSP) and annotates the fragments + against a compound database. + + Args: + in_file: Input file containing peak list data (e.g., MGF, MSP). + out_file: Output file for annotated results (e.g., CSV, TSV). + db_file: Database file of known compounds (e.g., SDF, MOL). Highly recommended for annotation. + mode: Ionization mode. Must be 'positive' or 'negative'. + precursor_mz: Precursor m/z value. If not provided, it will be read from the input file. + precursor_adduct: Precursor adduct type (e.g., '[M+H]+', '[M-H]-'). + fragment_tol: Fragment tolerance value. Must be a positive number. + fragment_tol_unit: Fragment tolerance unit. Must be 'Da' or 'ppm'. + min_intensity: Minimum relative intensity for fragments to be considered (0-100). + max_depth: Maximum fragmentation depth to consider. Must be a positive integer. + verbose: Enable verbose logging. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # 1. Input Validation + if not in_file.is_file(): + raise FileNotFoundError(f"Input file not found: {in_file}") + + if db_file and not db_file.is_file(): + raise FileNotFoundError(f"Database file not found: {db_file}") + + if out_file.parent and not out_file.parent.exists(): + out_file.parent.mkdir(parents=True, exist_ok=True) + + if mode not in ["positive", "negative"]: + raise ValueError(f"Invalid mode '{mode}'. Must be 'positive' or 'negative'.") + + if fragment_tol <= 0: + raise ValueError(f"Fragment tolerance must be positive, but got {fragment_tol}.") + + if fragment_tol_unit not in ["Da", "ppm"]: + raise ValueError(f"Invalid fragment tolerance unit '{fragment_tol_unit}'. Must be 'Da' or 'ppm'.") + + if not (0.0 <= min_intensity <= 100.0): + raise ValueError(f"Minimum intensity must be between 0 and 100, but got {min_intensity}.") + + if max_depth <= 0: + raise ValueError(f"Maximum depth must be a positive integer, but got {max_depth}.") + + # 2. Command Construction + # Assuming the tool is available in the system's PATH as 'fragment-annotation.pl' + cmd = [ + "fragment-annotation.pl", + "--in", str(in_file), + "--out", str(out_file), + "--mode", mode, + "--fragment_tol", str(fragment_tol), + "--fragment_tol_unit", fragment_tol_unit, + "--min_intensity", str(min_intensity), + "--max_depth", str(max_depth), + ] + + if db_file: + cmd.extend(["--db", str(db_file)]) + if precursor_mz is not None: + cmd.extend(["--precursor_mz", str(precursor_mz)]) + if precursor_adduct: + cmd.extend(["--precursor_adduct", precursor_adduct]) + if verbose: + cmd.append("--verbose") + + # 3. Subprocess Execution and Error Handling + command_executed = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + + # 4. Structured Result Return (Success) + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_file)] + } + except FileNotFoundError: + # This error occurs if 'fragment-annotation.pl' is not in the PATH + raise RuntimeError("The command 'fragment-annotation.pl' was not found. Please ensure the tool is installed and in your system's PATH.") + except subprocess.CalledProcessError as e: + # This error occurs if the tool returns a non-zero exit code + # The MCP framework will typically handle this exception, but returning a + # structured error provides more context to the user. + error_message = ( + f"Tool execution failed with return code {e.returncode}.\n" + f"Command: {command_executed}\n" + f"Stdout: {e.stdout}\n" + f"Stderr: {e.stderr}" + ) + # Re-raising is often better for MCP to handle, but if we must return: + # For this problem, we will re-raise to let the MCP framework handle it, + # as this is a more robust pattern. If a dictionary must be returned, + # the following code could be used instead of raising the exception. + # + # return { + # "command_executed": command_executed, + # "stdout": e.stdout, + # "stderr": e.stderr, + # "error": f"Tool execution failed with return code {e.returncode}.", + # "output_files": [] + # } + raise RuntimeError(error_message) from e \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..2b1dae85b27cd09b8ec536c3a14de7e61ab261af --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/app/perl-metabolomics-fragment-annotation_server.py') +SERVER_NAME = 'biosci_perl_metabolomics_fragment_annotation' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..b523ed6b72467dcd5874c2cefd94dcd3ef457613 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-perl-metabolomics-fragment-annotation: + build: . + image: mcp-perl-metabolomics-fragment-annotation:latest + container_name: mcp-perl-metabolomics-fragment-annotation + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=perl-metabolomics-fragment-annotation + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ded292d05dc8663928c1e34800953b626c95932f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - perl-metabolomics-fragment-annotation + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_perl-metabolomics-fragment-annotation/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f601a803ec38d238369efa7d6e980988d48b19ed --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install picard via conda (e.g., from bioconda) +RUN conda install -c bioconda picard -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/picard_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/picard_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/picard_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_server.py new file mode 100644 index 0000000000000000000000000000000000000000..793a52bab6d0dbdc26df6bfef493cb16edc23ed0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_server.py @@ -0,0 +1,509 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List, Union + +# --- MCP Tool Definition for Picard --- + +# Configure logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +# Assume 'picard' is an executable in the system's PATH. +# This is a common setup when installed via Conda or as a standalone wrapper script. +PICARD_COMMAND = "picard" + +# Helper function to handle the return logic, not exposed as an MCP tool. +def _run_picard_command(cmd: List[Union[str, Path]], output_file_key: str, output_path: Path, create_md5: bool = False): + """ + Internal helper to execute a Picard command and return a structured response. + """ + # Convert all command parts to strings for execution + cmd_str_list = [str(c) for c in cmd] + command_to_execute = " ".join(cmd_str_list) + logging.info(f"Executing command: {command_to_execute}") + + try: + result = subprocess.run( + cmd_str_list, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + error_msg = f"'{PICARD_COMMAND}' command not found. Is Picard installed and in your system's PATH?" + logging.error(error_msg) + raise RuntimeError(error_msg) from None + except subprocess.CalledProcessError as e: + logging.error(f"Picard command failed with exit code {e.returncode}") + logging.error(f"Stderr: {e.stderr}") + logging.error(f"Stdout: {e.stdout}") + # Re-raise to be handled by the MCP framework + raise e + + output_files = {output_file_key: str(output_path)} + if create_md5: + md5_file = output_path.with_suffix(output_path.suffix + ".md5") + if md5_file.exists(): + output_files["md5"] = str(md5_file) + + return { + "command_executed": command_to_execute, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + + +@mcp.tool() +def add_or_replace_read_groups( + input_bam: Path, + output_bam: Path, + read_group_id: str, + read_group_library: str, + read_group_platform: str, + read_group_platform_unit: str, + read_group_sample_name: str, + sort_order: Optional[str] = None, + validation_stringency: str = "STRICT", + create_index: bool = True, + create_md5_file: bool = False, + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Replaces all read groups in the input BAM file with a single new read group. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + valid_stringencies = ["STRICT", "LENIENT", "SILENT"] + if validation_stringency not in valid_stringencies: + raise ValueError(f"VALIDATION_STRINGENCY must be one of {valid_stringencies}") + + output_bam.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "AddOrReplaceReadGroups", + f"INPUT={input_bam}", + f"OUTPUT={output_bam}", + f"RGID={read_group_id}", + f"RGLB={read_group_library}", + f"RGPL={read_group_platform}", + f"RGPU={read_group_platform_unit}", + f"RGSM={read_group_sample_name}", + f"VALIDATION_STRINGENCY={validation_stringency}", + f"CREATE_INDEX={str(create_index).lower()}", + f"CREATE_MD5_FILE={str(create_md5_file).lower()}", + ] + + if sort_order: + valid_sort_orders = ["unsorted", "queryname", "coordinate", "duplicate", "unknown"] + if sort_order not in valid_sort_orders: + raise ValueError(f"SORT_ORDER must be one of {valid_sort_orders}") + cmd.append(f"SORT_ORDER={sort_order}") + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + return _run_picard_command(cmd, "output_bam", output_bam, create_md5_file) + + +@mcp.tool() +def build_bam_index( + input_bam: Path, + output_bai: Optional[Path] = None, + validation_stringency: str = "STRICT", +) -> dict: + """ + Generates a BAM index (.bai) file for a coordinate-sorted BAM file. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + if output_bai is None: + # Picard defaults to creating a .bai file next to the input + output_bai = input_bam.with_suffix(input_bam.suffix + ".bai") + + output_bai.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "BuildBamIndex", + f"INPUT={input_bam}", + f"OUTPUT={output_bai}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + return _run_picard_command(cmd, "bai_file", output_bai) + + +@mcp.tool() +def collect_alignment_summary_metrics( + input_bam: Path, + output_metrics: Path, + reference_fasta: Path, + assume_sorted: bool = True, + adapter_sequence: Optional[List[str]] = None, + max_insert_size: int = 100000, + validation_stringency: str = "STRICT", + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Collects alignment metrics from a BAM file. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + if not reference_fasta.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + output_metrics.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "CollectAlignmentSummaryMetrics", + f"INPUT={input_bam}", + f"OUTPUT={output_metrics}", + f"REFERENCE_SEQUENCE={reference_fasta}", + f"ASSUME_SORTED={str(assume_sorted).lower()}", + f"MAX_INSERT_SIZE={max_insert_size}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + if adapter_sequence: + for seq in adapter_sequence: + cmd.append(f"ADAPTER_SEQUENCE={seq}") + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + return _run_picard_command(cmd, "metrics_file", output_metrics) + + +@mcp.tool() +def collect_insert_size_metrics( + input_bam: Path, + output_metrics: Path, + output_histogram: Path, + minimum_pct: float = 0.05, + validation_stringency: str = "STRICT", + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Collects insert size metrics from a BAM file. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + output_metrics.parent.mkdir(parents=True, exist_ok=True) + output_histogram.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "CollectInsertSizeMetrics", + f"INPUT={input_bam}", + f"OUTPUT={output_metrics}", + f"HISTOGRAM_FILE={output_histogram}", + f"MINIMUM_PCT={minimum_pct}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + # This tool produces two primary outputs + result = _run_picard_command(cmd, "metrics_file", output_metrics) + result["output_files"]["histogram_file"] = str(output_histogram) + return result + + +@mcp.tool() +def create_sequence_dictionary( + reference_fasta: Path, + output_dict: Path, + genome_assembly: Optional[str] = None, + uri: Optional[str] = None, + species: Optional[str] = None, + truncate_names_at_whitespace: bool = True, + validation_stringency: str = "STRICT", +) -> dict: + """ + Creates a sequence dictionary file (.dict) from a reference FASTA file. + """ + if not reference_fasta.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + output_dict.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "CreateSequenceDictionary", + f"REFERENCE={reference_fasta}", + f"OUTPUT={output_dict}", + f"TRUNCATE_NAMES_AT_WHITESPACE={str(truncate_names_at_whitespace).lower()}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + if genome_assembly: + cmd.append(f"GENOME_ASSEMBLY={genome_assembly}") + if uri: + cmd.append(f"URI={uri}") + if species: + cmd.append(f"SPECIES={species}") + + return _run_picard_command(cmd, "dictionary_file", output_dict) + + +@mcp.tool() +def fastq_to_sam( + fastq1: Path, + output_bam: Path, + sample_name: str, + read_group_name: str, + library_name: str, + platform: str, + platform_unit: str, + fastq2: Optional[Path] = None, + sort_order: str = "queryname", + validation_stringency: str = "STRICT", + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Converts FASTQ files to an unaligned BAM file. + """ + if not fastq1.is_file(): + raise FileNotFoundError(f"Input FASTQ1 file not found: {fastq1}") + if fastq2 and not fastq2.is_file(): + raise FileNotFoundError(f"Input FASTQ2 file not found: {fastq2}") + + valid_sort_orders = ["unsorted", "queryname", "coordinate", "duplicate", "unknown"] + if sort_order not in valid_sort_orders: + raise ValueError(f"SORT_ORDER must be one of {valid_sort_orders}") + + output_bam.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "FastqToSam", + f"FASTQ={fastq1}", + f"OUTPUT={output_bam}", + f"SAMPLE_NAME={sample_name}", + f"READ_GROUP_NAME={read_group_name}", + f"LIBRARY_NAME={library_name}", + f"PLATFORM={platform}", + f"PLATFORM_UNIT={platform_unit}", + f"SORT_ORDER={sort_order}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + if fastq2: + cmd.append(f"FASTQ2={fastq2}") + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + return _run_picard_command(cmd, "output_bam", output_bam) + + +@mcp.tool() +def mark_duplicates( + input_bam: Path, + output_bam: Path, + metrics_file: Path, + remove_duplicates: bool = False, + assume_sorted: bool = True, + optical_duplicate_pixel_distance: int = 100, + validation_stringency: str = "STRICT", + create_index: bool = True, + create_md5_file: bool = False, + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Identifies and flags duplicate reads in a BAM file. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + output_bam.parent.mkdir(parents=True, exist_ok=True) + metrics_file.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "MarkDuplicates", + f"INPUT={input_bam}", + f"OUTPUT={output_bam}", + f"METRICS_FILE={metrics_file}", + f"REMOVE_DUPLICATES={str(remove_duplicates).lower()}", + f"ASSUME_SORTED={str(assume_sorted).lower()}", + f"OPTICAL_DUPLICATE_PIXEL_DISTANCE={optical_duplicate_pixel_distance}", + f"VALIDATION_STRINGENCY={validation_stringency}", + f"CREATE_INDEX={str(create_index).lower()}", + f"CREATE_MD5_FILE={str(create_md5_file).lower()}", + ] + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + result = _run_picard_command(cmd, "output_bam", output_bam, create_md5_file) + result["output_files"]["metrics_file"] = str(metrics_file) + return result + + +@mcp.tool() +def merge_sam_files( + input_bams: List[Path], + output_bam: Path, + sort_order: str = "coordinate", + assume_sorted: bool = False, + merge_sequence_dictionaries: bool = False, + validation_stringency: str = "STRICT", + create_index: bool = True, + create_md5_file: bool = False, + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Merges multiple BAM files into a single BAM file. + """ + for bam in input_bams: + if not bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {bam}") + if not input_bams: + raise ValueError("At least one input BAM file is required.") + + valid_sort_orders = ["unsorted", "queryname", "coordinate", "duplicate", "unknown"] + if sort_order not in valid_sort_orders: + raise ValueError(f"SORT_ORDER must be one of {valid_sort_orders}") + + output_bam.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "MergeSamFiles", + f"OUTPUT={output_bam}", + f"SORT_ORDER={sort_order}", + f"ASSUME_SORTED={str(assume_sorted).lower()}", + f"MERGE_SEQUENCE_DICTIONARIES={str(merge_sequence_dictionaries).lower()}", + f"VALIDATION_STRINGENCY={validation_stringency}", + f"CREATE_INDEX={str(create_index).lower()}", + f"CREATE_MD5_FILE={str(create_md5_file).lower()}", + ] + + for bam in input_bams: + cmd.append(f"INPUT={bam}") + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + return _run_picard_command(cmd, "output_bam", output_bam, create_md5_file) + + +@mcp.tool() +def sort_sam( + input_bam: Path, + output_bam: Path, + sort_order: str, + validation_stringency: str = "STRICT", + create_index: bool = True, + create_md5_file: bool = False, + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Sorts a BAM file by coordinate, queryname, etc. + """ + if not input_bam.is_file(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + valid_sort_orders = ["unsorted", "queryname", "coordinate", "duplicate", "unknown"] + if sort_order not in valid_sort_orders: + raise ValueError(f"SORT_ORDER must be one of {valid_sort_orders}") + + output_bam.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + PICARD_COMMAND, "SortSam", + f"INPUT={input_bam}", + f"OUTPUT={output_bam}", + f"SORT_ORDER={sort_order}", + f"VALIDATION_STRINGENCY={validation_stringency}", + f"CREATE_INDEX={str(create_index).lower()}", + f"CREATE_MD5_FILE={str(create_md5_file).lower()}", + ] + + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + return _run_picard_command(cmd, "output_bam", output_bam, create_md5_file) + + +@mcp.tool() +def validate_sam_file( + input_sam: Path, + output_report: Optional[Path] = None, + reference_fasta: Optional[Path] = None, + mode: str = "SUMMARY", + ignore_warnings: bool = False, + max_output: int = 100, + validation_stringency: str = "STRICT", + tmp_dir: Optional[Path] = None, +) -> dict: + """ + Validates a SAM or BAM file. + """ + if not input_sam.is_file(): + raise FileNotFoundError(f"Input SAM/BAM file not found: {input_sam}") + if reference_fasta and not reference_fasta.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + valid_modes = ["SUMMARY", "VERBOSE"] + if mode not in valid_modes: + raise ValueError(f"MODE must be one of {valid_modes}") + + cmd = [ + PICARD_COMMAND, "ValidateSamFile", + f"INPUT={input_sam}", + f"MODE={mode}", + f"IGNORE_WARNINGS={str(ignore_warnings).lower()}", + f"MAX_OUTPUT={max_output}", + f"VALIDATION_STRINGENCY={validation_stringency}", + ] + + if output_report: + output_report.parent.mkdir(parents=True, exist_ok=True) + cmd.append(f"OUTPUT={output_report}") + if reference_fasta: + cmd.append(f"REFERENCE_SEQUENCE={reference_fasta}") + if tmp_dir: + tmp_dir.mkdir(parents=True, exist_ok=True) + cmd.append(f"TMP_DIR={tmp_dir}") + + # The primary output of this tool is its stdout/stderr report. + # The file output is optional. + command_to_execute = " ".join(map(str, cmd)) + logging.info(f"Executing command: {command_to_execute}") + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + raise RuntimeError(f"'{PICARD_COMMAND}' command not found. Is Picard installed and in your PATH?") + except subprocess.CalledProcessError as e: + # For ValidateSamFile, a non-zero exit code IS the result if errors are found. + # We capture this as a successful run that found validation errors. + logging.warning(f"ValidateSamFile finished with a non-zero exit code, indicating validation errors.") + return { + "command_executed": command_to_execute, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": {"report": str(output_report)} if output_report else {}, + "validation_passed": False + } + + return { + "command_executed": command_to_execute, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": {"report": str(output_report)} if output_report else {}, + "validation_passed": True + } diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..045bea8f0ce2b17ec59624e2c64b52fde2741c79 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/picard_server.py') +SERVER_NAME = 'biosci_picard' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f562a180baf655ff1d15161868a30fd34cfd9aca --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-picard: + build: . + image: mcp-picard:latest + container_name: mcp-picard + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=picard + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..194f3da9c887dfb19492e9b511ce5533157315b5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - picard + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_picard/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..821e28ab9fc7a2248d3b6c99215247da8b11d037 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install proteomiqon-peptidedb via conda (e.g., from bioconda) +RUN conda install -c bioconda proteomiqon-peptidedb -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/proteomiqon-peptidedb_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/proteomiqon-peptidedb_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/proteomiqon-peptidedb_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py new file mode 100644 index 0000000000000000000000000000000000000000..179ff000b8375b0de4edab522ffdef3040031d93 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py @@ -0,0 +1,128 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Dict + +# The mcp.tool decorator is assumed to be available in the execution environment. +# It is not imported here as per the instructions. + +@mcp.tool() +def peptidedb( + input_fasta: Path, + output_db: Path, + enzyme: str = "Trypsin/P", + missed_cleavages: int = 2, + min_peptide_length: int = 7, + max_peptide_length: int = 50, + fixed_modifications: Optional[List[str]] = None, + variable_modifications: Optional[List[str]] = None, + threads: int = 1, +) -> Dict: + """ + Creates a peptide database from a protein FASTA file using proteomiqon-peptidedb. + + NOTE: This is a hypothetical wrapper. The actual tool failed to run during + analysis due to a missing .NET dependency, so its command-line arguments are + inferred. The parameters defined here are based on common features of similar + proteomics tools and should be verified against the actual tool's documentation. + + Args: + input_fasta: Path to the input protein FASTA file. + output_db: Path for the generated output peptide database file. + enzyme: The enzyme to use for in-silico digestion (e.g., 'Trypsin/P'). + missed_cleavages: Maximum number of allowed missed cleavages. + min_peptide_length: Minimum length of peptides to include in the database. + max_peptide_length: Maximum length of peptides to include in the database. + fixed_modifications: List of fixed modifications to apply. + variable_modifications: List of variable modifications to apply. + threads: Number of processor threads to use. + + Returns: + A dictionary containing the execution command, stdout, stderr, and a list + of output files. + """ + # --- Input Validation --- + if not input_fasta.is_file(): + raise FileNotFoundError(f"Input FASTA file not found at: {input_fasta}") + + if threads < 1: + raise ValueError("The number of threads must be at least 1.") + + if missed_cleavages < 0: + raise ValueError("Missed cleavages cannot be negative.") + + if min_peptide_length < 1 or max_peptide_length < min_peptide_length: + raise ValueError( + f"Invalid peptide length range: min={min_peptide_length}, max={max_peptide_length}" + ) + + # Ensure the output directory exists + output_db.parent.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + # This command structure is HYPOTHETICAL. You MUST replace these flags + # with the actual flags from the tool's documentation. + cmd = [ + "proteomiqon-peptidedb", + "--input", str(input_fasta), + "--output", str(output_db), + "--enzyme", enzyme, + "--missed-cleavages", str(missed_cleavages), + "--min-length", str(min_peptide_length), + "--max-length", str(max_peptide_length), + "--threads", str(threads), + ] + + if fixed_modifications: + for mod in fixed_modifications: + # Assuming a repeatable flag like --fixed-mod + cmd.extend(["--fixed-mod", mod]) + + if variable_modifications: + for mod in variable_modifications: + # Assuming a repeatable flag like --variable-mod + cmd.extend(["--variable-mod", mod]) + + # --- Subprocess Execution --- + command_executed = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + + # --- Result Handling --- + # Verify that the output file was actually created + if not output_db.is_file(): + raise FileNotFoundError( + f"Tool executed successfully, but the expected output file was not created: {output_db}" + ) + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(output_db)] + } + + except FileNotFoundError: + # This error occurs if 'proteomiqon-peptidedb' is not in the PATH + stderr_msg = ( + "Error: 'proteomiqon-peptidedb' command not found. " + "Ensure the Proteomiqon suite is installed and its bin directory is in your system's PATH." + ) + return { + "command_executed": command_executed, + "stdout": "", + "stderr": stderr_msg, + "output_files": [] + } + except subprocess.CalledProcessError as e: + # This error occurs if the tool returns a non-zero exit code + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..3f50da245a6500cdbb40611840e2c12a59df1800 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py') +SERVER_NAME = 'biosci_proteomiqon_peptidedb' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..6d339b247891e009ea5b07eec1f4b1ccef41e3cf --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-proteomiqon-peptidedb: + build: . + image: mcp-proteomiqon-peptidedb:latest + container_name: mcp-proteomiqon-peptidedb + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=proteomiqon-peptidedb + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..21c204dd7433ce319a4c838e0f9e56969be62320 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - proteomiqon-peptidedb + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_proteomiqon-peptidedb/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78a3227eb4d434212bf5fdf8a94dad3c3e06635f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install pycistopic via conda (e.g., from bioconda) +RUN conda install -c bioconda pycistopic -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY pycistopic_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/pycistopic_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/pycistopic_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c96f14c008adcb888ada912e1dc369368b1ac46f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_server.py @@ -0,0 +1,310 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Union +import os + +@mcp.tool() +def pycistopic_run_models( + input_path: str, + output_path: str, + n_topics: str, + n_iter: int = 150, + burn_in: int = 100, + n_cores: int = 1, + seed: int = 123, + alpha: float = 50.0, + eta: float = 0.1, +): + """ + Run Latent Dirichlet Allocation (LDA) models for a range of topics. + + Args: + input_path: Path to the input cisTopic object (.pkl). + output_path: Path to save the cisTopic object with models (.pkl). + n_topics: Comma-separated list of topic numbers to run (e.g., "2,5,10,20,30,40,50"). + n_iter: Number of iterations for LDA (default: 150). + burn_in: Number of burn-in iterations (default: 100). + n_cores: Number of cores to use for parallel processing (default: 1). + seed: Random seed for reproducibility (default: 123). + alpha: Alpha parameter for LDA (default: 50.0). + eta: Eta parameter for LDA (default: 0.1). + """ + # Input validation + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + # Validate n_topics format + try: + [int(x.strip()) for x in n_topics.split(",")] + except ValueError: + return {"error": "n_topics must be a comma-separated list of integers."} + + cmd = [ + "pycistopic", "run_models", + "-i", str(in_p), + "-o", str(out_p), + "-nt", n_topics, + "-it", str(n_iter), + "-bi", str(burn_in), + "-c", str(n_cores), + "-s", str(seed), + "-a", str(alpha), + "-e", str(eta) + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def pycistopic_analyze_models( + input_path: str, + output_path: str, + select_model: Optional[int] = None, +): + """ + Analyze LDA models to select the optimal number of topics. + + Args: + input_path: Path to the cisTopic object containing models (.pkl). + output_path: Path to save the cisTopic object with the selected model (.pkl). + select_model: Manually select a specific topic number. If None, the tool uses metrics to suggest one. + """ + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pycistopic", "analyze_models", + "-i", str(in_p), + "-o", str(out_p) + ] + + if select_model is not None: + cmd.extend(["-sm", str(select_model)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def pycistopic_get_dar( + input_path: str, + output_path: str, + group_by: str, + contrast_type: str = "one_vs_rest", + adj_pval_threshold: float = 0.05, + log2fc_threshold: float = 1.0, +): + """ + Find Differentially Accessible Regions (DARs) between cell groups. + + Args: + input_path: Path to the cisTopic object (.pkl). + output_path: Path to save the DAR results (.pkl or .csv). + group_by: Metadata column to group cells by (e.g., 'cell_type'). + contrast_type: Type of contrast to perform ('one_vs_rest' or 'pairwise'). + adj_pval_threshold: Adjusted p-value threshold for significance (default: 0.05). + log2fc_threshold: Log2 Fold Change threshold (default: 1.0). + """ + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pycistopic", "get_dar", + "-i", str(in_p), + "-o", str(out_p), + "-g", group_by, + "-ct", contrast_type, + "-p", str(adj_pval_threshold), + "-l", str(log2fc_threshold) + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def pycistopic_binarize_topics( + input_path: str, + output_path: str, + method: str = "otsu", + threshold: float = 0.0, +): + """ + Binarize the topic-region matrix. + + Args: + input_path: Path to the cisTopic object (.pkl). + output_path: Path to save the binarized results (.pkl). + method: Binarization method ('otsu', 'std', or 'threshold'). + threshold: Threshold value if method is 'threshold' (default: 0.0). + """ + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pycistopic", "binarize_topics", + "-i", str(in_p), + "-o", str(out_p), + "-m", method, + "-t", str(threshold) + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def pycistopic_impute_accessibility( + input_path: str, + output_path: str, + scale_factor: int = 10000, +): + """ + Compute imputed accessibility from the LDA model. + + Args: + input_path: Path to the cisTopic object (.pkl). + output_path: Path to save the imputed accessibility matrix (.pkl). + scale_factor: Scaling factor for imputation (default: 10000). + """ + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pycistopic", "impute_accessibility", + "-i", str(in_p), + "-o", str(out_p), + "-s", str(scale_factor) + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def pycistopic_get_markers( + input_path: str, + output_path: str, + group_by: str, + method: str = "wilcoxon", +): + """ + Identify marker regions for specific cell groups. + + Args: + input_path: Path to the cisTopic object (.pkl). + output_path: Path to save the marker results (.pkl or .csv). + group_by: Metadata column to group cells by. + method: Statistical test to use ('wilcoxon' or 't-test'). + """ + in_p = Path(input_path) + if not in_p.exists(): + return {"error": f"Input file not found: {input_path}"} + + out_p = Path(output_path) + out_p.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pycistopic", "get_markers", + "-i", str(in_p), + "-o", str(out_p), + "-g", group_by, + "-m", method + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(out_p)] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6a9514503d941e3f8208dc1ee272eab75a386c81 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/app/pycistopic_server.py') +SERVER_NAME = 'biosci_pycistopic' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..6644b0ff37e9b251f7157e45c43150644fe8a6ba --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-pycistopic: + build: . + image: mcp-pycistopic:latest + container_name: mcp-pycistopic + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=pycistopic + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6285d45abce74c8790fdb0ce3ed8e979a3989ec6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - pycistopic + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pycistopic/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..23aafb51b24869270b33c17721d9059cb63aa376 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install pyroe via conda (e.g., from bioconda) +RUN conda install -c bioconda pyroe -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY pyroe_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/pyroe_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/pyroe_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_server.py new file mode 100644 index 0000000000000000000000000000000000000000..59568a29fb8b43a32acd68c3f09e8098f8b2f8ef --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_server.py @@ -0,0 +1,435 @@ +from pathlib import Path +from typing import Optional, List +import subprocess +import tempfile +import shutil + +# Note: mcp is not imported as per instructions, but @mcp.tool is used for clarity. + +@mcp.tool() +def make_splici( + genome_fasta: Path, + gtf_annotation: Path, + output_dir: Path, + flank_length: int = 90, + threads: int = 1, + keep_intermediate: bool = False, + fasta_name: Optional[str] = None, + gtf_name: Optional[str] = None, +) -> dict: + """ + Make a spliced + intronic reference (splici) for alevin-fry. + + This function generates a reference transcriptome that includes both spliced + and intronic sequences, suitable for single-cell RNA-seq quantification + with tools like alevin-fry. + + Args: + genome_fasta: Path to the input genome FASTA file. + gtf_annotation: Path to the input GTF annotation file. + output_dir: Directory where the generated reference files will be saved. + flank_length: Length of flanking sequence to include for intronic regions. + Must be a non-negative integer. + threads: Number of threads to use for processing. Must be a positive integer. + keep_intermediate: If True, intermediate files generated during reference + creation will be kept. + fasta_name: Optional name for the output FASTA file. If None, a default + name like 'splici_ref.fasta' will be used. + gtf_name: Optional name for the output GTF file. If None, a default + name like 'splici_ref.gtf' will be used. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list + of generated output files. + """ + # Input validation + if not genome_fasta.is_file(): + raise FileNotFoundError(f"Genome FASTA file not found: {genome_fasta}") + if not gtf_annotation.is_file(): + raise FileNotFoundError(f"GTF annotation file not found: {gtf_annotation}") + + if flank_length < 0: + raise ValueError("Flank length must be a non-negative integer.") + if threads < 1: + raise ValueError("Number of threads must be a positive integer.") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pyroe", + "make-splici", + "--genome", str(genome_fasta), + "--gtf", str(gtf_annotation), + "--output", str(output_dir), + "--flank-length", str(flank_length), + "--threads", str(threads), + ] + + if keep_intermediate: + cmd.append("--keep-intermediate") + if fasta_name: + cmd.extend(["--fasta-name", fasta_name]) + if gtf_name: + cmd.extend(["--gtf-name", gtf_name]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + stdout = result.stdout + stderr = result.stderr + + # Determine output files based on common pyroe behavior + # Assuming default names if not specified + output_fasta = output_dir / (fasta_name if fasta_name else "splici_ref.fasta") + output_gtf = output_dir / (gtf_name if gtf_name else "splici_ref.gtf") + + output_files = [str(f) for f in [output_fasta, output_gtf] if f.exists()] + + return { + "command_executed": " ".join(cmd), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"pyroe make-splici failed with exit code {e.returncode}: {e}", + "returncode": e.returncode, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "error": "pyroe command not found. Is it installed and in your PATH?", + } + +@mcp.tool() +def make_spliceu( + genome_fasta: Path, + gtf_annotation: Path, + output_dir: Path, + flank_length: int = 90, + threads: int = 1, + keep_intermediate: bool = False, + fasta_name: Optional[str] = None, + gtf_name: Optional[str] = None, +) -> dict: + """ + Make a spliced + unspliced reference (spliceu) for alevin-fry. + + This function generates a reference transcriptome that includes both spliced + and unspliced sequences, suitable for single-cell RNA-seq quantification + with tools like alevin-fry. + + Args: + genome_fasta: Path to the input genome FASTA file. + gtf_annotation: Path to the input GTF annotation file. + output_dir: Directory where the generated reference files will be saved. + flank_length: Length of flanking sequence to include for unspliced regions. + Must be a non-negative integer. + threads: Number of threads to use for processing. Must be a positive integer. + keep_intermediate: If True, intermediate files generated during reference + creation will be kept. + fasta_name: Optional name for the output FASTA file. If None, a default + name like 'spliceu_ref.fasta' will be used. + gtf_name: Optional name for the output GTF file. If None, a default + name like 'spliceu_ref.gtf' will be used. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list + of generated output files. + """ + # Input validation + if not genome_fasta.is_file(): + raise FileNotFoundError(f"Genome FASTA file not found: {genome_fasta}") + if not gtf_annotation.is_file(): + raise FileNotFoundError(f"GTF annotation file not found: {gtf_annotation}") + + if flank_length < 0: + raise ValueError("Flank length must be a non-negative integer.") + if threads < 1: + raise ValueError("Number of threads must be a positive integer.") + + output_dir.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pyroe", + "make-spliceu", + "--genome", str(genome_fasta), + "--gtf", str(gtf_annotation), + "--output", str(output_dir), + "--flank-length", str(flank_length), + "--threads", str(threads), + ] + + if keep_intermediate: + cmd.append("--keep-intermediate") + if fasta_name: + cmd.extend(["--fasta-name", fasta_name]) + if gtf_name: + cmd.extend(["--gtf-name", gtf_name]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + stdout = result.stdout + stderr = result.stderr + + # Determine output files based on common pyroe behavior + # Assuming default names if not specified + output_fasta = output_dir / (fasta_name if fasta_name else "spliceu_ref.fasta") + output_gtf = output_dir / (gtf_name if gtf_name else "spliceu_ref.gtf") + + output_files = [str(f) for f in [output_fasta, output_gtf] if f.exists()] + + return { + "command_executed": " ".join(cmd), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"pyroe make-spliceu failed with exit code {e.returncode}: {e}", + "returncode": e.returncode, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "error": "pyroe command not found. Is it installed and in your PATH?", + } + +@mcp.tool() +def fetch_quant( + quant_path: Path, + output_dir: Path, + format: str = "csv", + gene_id_to_name_map: Optional[Path] = None, +) -> dict: + """ + Fetch processed quantification results from an alevin-fry output directory. + + This function retrieves and potentially converts quantification results + into a specified format. + + Args: + quant_path: Path to the input alevin-fry quantification directory. + output_dir: Directory where the fetched/converted results will be saved. + format: The desired output format for the quantification results. + Common options include "csv", "tsv", "json". + gene_id_to_name_map: Optional path to a gene ID to gene name mapping file. + If provided, gene IDs in the output will be replaced + with gene names. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list + of generated output files. + """ + # Input validation + if not quant_path.is_dir(): + raise FileNotFoundError(f"Quantification directory not found: {quant_path}") + + output_dir.mkdir(parents=True, exist_ok=True) + + valid_formats = ["csv", "tsv", "json", "mtx"] # Assuming common formats + if format.lower() not in valid_formats: + raise ValueError(f"Invalid format '{format}'. Must be one of: {', '.join(valid_formats)}") + + cmd = [ + "pyroe", + "fetch-quant", + "--quant-path", str(quant_path), + "--output", str(output_dir), + "--format", format.lower(), + ] + + if gene_id_to_name_map: + if not gene_id_to_name_map.is_file(): + raise FileNotFoundError(f"Gene ID to name map file not found: {gene_id_to_name_map}") + cmd.extend(["--id-to-name", str(gene_id_to_name_map)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + stdout = result.stdout + stderr = result.stderr + + # Assuming a generic output file name based on format + output_file_name = f"quant_results.{format.lower()}" + output_file_path = output_dir / output_file_name + + output_files = [str(output_file_path)] if output_file_path.exists() else [] + + return { + "command_executed": " ".join(cmd), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"pyroe fetch-quant failed with exit code {e.returncode}: {e}", + "returncode": e.returncode, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "error": "pyroe command not found. Is it installed and in your PATH?", + } + +@mcp.tool() +def id_to_name( + gtf_annotation: Path, + output_file: Path, + attribute_id: str = "gene_id", + attribute_name: str = "gene_name", +) -> dict: + """ + Generate a gene ID to gene name mapping file from a GTF annotation. + + This function parses a GTF file to extract gene IDs and their corresponding + gene names, saving them into a tab-separated file. + + Args: + gtf_annotation: Path to the input GTF annotation file. + output_file: Path where the gene ID to gene name mapping file will be saved. + The parent directory must exist. + attribute_id: The GTF attribute key used for gene IDs (e.g., "gene_id"). + attribute_name: The GTF attribute key used for gene names (e.g., "gene_name"). + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list + of generated output files. + """ + # Input validation + if not gtf_annotation.is_file(): + raise FileNotFoundError(f"GTF annotation file not found: {gtf_annotation}") + + output_file.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "pyroe", + "id-to-name", + "--gtf", str(gtf_annotation), + "--output", str(output_file), + "--attribute-id", attribute_id, + "--attribute-name", attribute_name, + ] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + stdout = result.stdout + stderr = result.stderr + + output_files = [str(output_file)] if output_file.exists() else [] + + return { + "command_executed": " ".join(cmd), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"pyroe id-to-name failed with exit code {e.returncode}: {e}", + "returncode": e.returncode, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "error": "pyroe command not found. Is it installed and in your PATH?", + } + +@mcp.tool() +def convert( + input_quant_dir: Path, + output_format: str, + output_file: Path, + gene_id_to_name_map: Optional[Path] = None, + cell_barcode_file: Optional[Path] = None, +) -> dict: + """ + Convert alevin-fry quantification results to another format. + + This function takes an alevin-fry quantification directory and converts + its contents into a specified single-cell data format (e.g., loom, h5ad, mtx). + + Args: + input_quant_dir: Path to the input alevin-fry quantification directory. + output_format: The desired output format (e.g., "loom", "h5ad", "mtx"). + This parameter is required. + output_file: Path where the converted output file will be saved. + The parent directory must exist. + gene_id_to_name_map: Optional path to a gene ID to gene name mapping file. + If provided, gene IDs in the output will be replaced + with gene names. + cell_barcode_file: Optional path to a file containing cell barcodes. + If provided, these barcodes will be used for cell + annotation in the output. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list + of generated output files. + """ + # Input validation + if not input_quant_dir.is_dir(): + raise FileNotFoundError(f"Input quantification directory not found: {input_quant_dir}") + + output_file.parent.mkdir(parents=True, exist_ok=True) + + valid_formats = ["loom", "h5ad", "mtx"] # Common single-cell formats + if output_format.lower() not in valid_formats: + raise ValueError(f"Invalid output format '{output_format}'. Must be one of: {', '.join(valid_formats)}") + + cmd = [ + "pyroe", + "convert", + "--input", str(input_quant_dir), + "--output-format", output_format.lower(), + "--output", str(output_file), + ] + + if gene_id_to_name_map: + if not gene_id_to_name_map.is_file(): + raise FileNotFoundError(f"Gene ID to name map file not found: {gene_id_to_name_map}") + cmd.extend(["--id-to-name", str(gene_id_to_name_map)]) + + if cell_barcode_file: + if not cell_barcode_file.is_file(): + raise FileNotFoundError(f"Cell barcode file not found: {cell_barcode_file}") + cmd.extend(["--cell-barcodes", str(cell_barcode_file)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + stdout = result.stdout + stderr = result.stderr + + output_files = [str(output_file)] if output_file.exists() else [] + + return { + "command_executed": " ".join(cmd), + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"pyroe convert failed with exit code {e.returncode}: {e}", + "returncode": e.returncode, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "error": "pyroe command not found. Is it installed and in your PATH?", + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..288c2ef2fd7ffda3295b6140fcc30fb2a5584373 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/app/pyroe_server.py') +SERVER_NAME = 'biosci_pyroe' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..25e7f9f27f7f5b5de6ba28f45cb58432bd7a46b3 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-pyroe: + build: . + image: mcp-pyroe:latest + container_name: mcp-pyroe + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=pyroe + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..471797530eee2dad6c86e39b7ce6339f40fd1f95 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - pyroe + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_pyroe/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..130cc046b9b4ba419e8625b3dbab709542e2bd0a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install r-scpred via conda (e.g., from bioconda) +RUN conda install -c bioconda r-scpred -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY r-scpred_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/r-scpred_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/r-scpred_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e649a395e80a30ce8d66778dd5f03971d38e18ad --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_server.py @@ -0,0 +1,290 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List + +# MCP decorator stub. In a real environment, this would be imported. +class mcp: + @staticmethod + def tool(): + def decorator(f): + return f + return decorator + +# Set up logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +@mcp.tool() +def scpred_train( + train_data: Path, + cell_type_col: str, + output_model: Path, + n_features: int = 30, + model: str = "svmRadial", + allow_parallel: bool = False, + seed: Optional[int] = None, +) -> dict: + """ + Trains an scpred cell type classification model. + + This function wraps the training process of scpred, which involves feature selection + from principal components and training a specified classification model. + + Args: + train_data: Path to the training data (e.g., a Seurat object in .rds format). + cell_type_col: The name of the metadata column containing the cell type labels. + output_model: Path to save the trained scpred model object (.rds format). + n_features: The number of principal components to use for feature selection. + model: The classification model to use (e.g., 'svmRadial', 'glmnet', 'ranger'). + allow_parallel: If True, enables parallel processing for model training. + seed: An optional integer for setting the random seed for reproducibility. + + Returns: + A dictionary containing the execution command, stdout, stderr, and output file path. + """ + # --- Input Validation --- + if not train_data.exists(): + raise FileNotFoundError(f"Training data not found at: {train_data}") + if n_features <= 0: + raise ValueError("n_features must be a positive integer.") + if not cell_type_col: + raise ValueError("cell_type_col must be a non-empty string.") + + # Ensure output directory exists + output_model.parent.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + # Based on a hypothetical scpred-cli.R script that wraps the R package functions. + cmd = [ + "Rscript", "scpred-cli.R", "train", + "--train-data", str(train_data), + "--cell-type-col", cell_type_col, + "--output-model", str(output_model), + "--n-features", str(n_features), + "--model", model, + ] + + if allow_parallel: + cmd.append("--allow-parallel") + if seed is not None: + cmd.extend(["--seed", str(seed)]) + + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + stdout = result.stdout + stderr = result.stderr + output_files = [str(output_model)] if output_model.exists() else [] + + except FileNotFoundError: + logger.error("Rscript or scpred-cli.R not found. Ensure R and the scpred wrapper script are in your PATH.") + raise + except subprocess.CalledProcessError as e: + logger.error(f"scpred training failed with exit code {e.returncode}") + logger.error(f"STDOUT: {e.stdout}") + logger.error(f"STDERR: {e.stderr}") + raise e + + # --- Structured Result Return --- + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + +@mcp.tool() +def scpred_predict( + model_file: Path, + test_data: Path, + output_rds: Path, + threshold: float = 0.9, + output_csv: Optional[Path] = None, +) -> dict: + """ + Predicts cell types in a new dataset using a trained scpred model. + + This function applies a pre-trained scpred model to a new single-cell dataset + to classify each cell. + + Args: + model_file: Path to the trained scpred model object (.rds format). + test_data: Path to the test data to be classified (e.g., a Seurat object in .rds format). + output_rds: Path to save the test data object with prediction results added (.rds format). + threshold: The minimum probability score required to assign a cell to a class. + output_csv: Optional path to save a CSV file with cell predictions. + + Returns: + A dictionary containing the execution command, stdout, stderr, and output file paths. + """ + # --- Input Validation --- + if not model_file.exists(): + raise FileNotFoundError(f"Model file not found at: {model_file}") + if not test_data.exists(): + raise FileNotFoundError(f"Test data not found at: {test_data}") + if not (0.0 <= threshold <= 1.0): + raise ValueError("threshold must be between 0.0 and 1.0.") + + # Ensure output directories exist + output_rds.parent.mkdir(parents=True, exist_ok=True) + if output_csv: + output_csv.parent.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + cmd = [ + "Rscript", "scpred-cli.R", "predict", + "--model-file", str(model_file), + "--test-data", str(test_data), + "--output-rds", str(output_rds), + "--threshold", str(threshold), + ] + + if output_csv: + cmd.extend(["--output-csv", str(output_csv)]) + + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + stdout = result.stdout + stderr = result.stderr + + output_files = [] + if output_rds.exists(): + output_files.append(str(output_rds)) + if output_csv and output_csv.exists(): + output_files.append(str(output_csv)) + + except FileNotFoundError: + logger.error("Rscript or scpred-cli.R not found. Ensure R and the scpred wrapper script are in your PATH.") + raise + except subprocess.CalledProcessError as e: + logger.error(f"scpred prediction failed with exit code {e.returncode}") + logger.error(f"STDOUT: {e.stdout}") + logger.error(f"STDERR: {e.stderr}") + raise e + + # --- Structured Result Return --- + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + +@mcp.tool() +def scpred_cv( + train_data: Path, + cell_type_col: str, + output_prefix: str, + n_folds: int = 10, + n_repeats: int = 10, + n_features: int = 30, + model: str = "svmRadial", + allow_parallel: bool = False, + seed: Optional[int] = None, +) -> dict: + """ + Performs cross-validation for an scpred model on a training dataset. + + This function evaluates model performance using k-fold cross-validation, which can help + in tuning parameters like the number of features. + + Args: + train_data: Path to the training data (e.g., a Seurat object in .rds format). + cell_type_col: The name of the metadata column containing the cell type labels. + output_prefix: A prefix for output files (e.g., plots, summary tables). + n_folds: The number of folds for cross-validation. + n_repeats: The number of times to repeat the cross-validation. + n_features: The number of principal components to use for feature selection. + model: The classification model to use (e.g., 'svmRadial', 'glmnet', 'ranger'). + allow_parallel: If True, enables parallel processing. + seed: An optional integer for setting the random seed for reproducibility. + + Returns: + A dictionary containing the execution command, stdout, and stderr. + Output files are not explicitly listed as they depend on the script's implementation. + """ + # --- Input Validation --- + if not train_data.exists(): + raise FileNotFoundError(f"Training data not found at: {train_data}") + if n_folds <= 1: + raise ValueError("n_folds must be greater than 1.") + if n_repeats <= 0: + raise ValueError("n_repeats must be a positive integer.") + if n_features <= 0: + raise ValueError("n_features must be a positive integer.") + if not cell_type_col: + raise ValueError("cell_type_col must be a non-empty string.") + if not output_prefix: + raise ValueError("output_prefix must be a non-empty string.") + + # --- Command Construction --- + cmd = [ + "Rscript", "scpred-cli.R", "cv", + "--train-data", str(train_data), + "--cell-type-col", cell_type_col, + "--output-prefix", output_prefix, + "--n-folds", str(n_folds), + "--n-repeats", str(n_repeats), + "--n-features", str(n_features), + "--model", model, + ] + + if allow_parallel: + cmd.append("--allow-parallel") + if seed is not None: + cmd.extend(["--seed", str(seed)]) + + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + stdout = result.stdout + stderr = result.stderr + # Note: The exact output files are unknown and depend on the R script. + # The user should know what files are generated based on the output_prefix. + output_files = [] + + except FileNotFoundError: + logger.error("Rscript or scpred-cli.R not found. Ensure R and the scpred wrapper script are in your PATH.") + raise + except subprocess.CalledProcessError as e: + logger.error(f"scpred cross-validation failed with exit code {e.returncode}") + logger.error(f"STDOUT: {e.stdout}") + logger.error(f"STDERR: {e.stderr}") + raise e + + # --- Structured Result Return --- + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..3faf96e236a54360aa027dcf4617f465bdbdfb6d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/app/r-scpred_server.py') +SERVER_NAME = 'biosci_r_scpred' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..ddf0527d367f6c800597d2fb4e6dde82c668d966 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-r-scpred: + build: . + image: mcp-r-scpred:latest + container_name: mcp-r-scpred + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=r-scpred + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b6eb1b829c2a4959b7abb8f5cf0548248ffcfc6c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - r-scpred + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-scpred/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0eb7efcf3eb48163d4122751f572f3c1cd91b8d7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install r-seurat-scripts via conda (e.g., from bioconda) +RUN conda install -c bioconda r-seurat-scripts -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY r-seurat-scripts_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/r-seurat-scripts_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/r-seurat-scripts_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0760c43cc11c37e64fbdd1f714658759bd857673 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_server.py @@ -0,0 +1,131 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List, Dict + +# Configure logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +@mcp.tool() +def rscript_run( + script_file: Optional[Path] = None, + expressions: Optional[List[str]] = None, + script_args: Optional[List[str]] = None, + verbose: bool = False, + default_packages: Optional[str] = None, + save: bool = False, + no_environ: bool = False, + no_site_file: bool = False, + no_init_file: bool = False, + restore: bool = False, + vanilla: bool = False, +) -> Dict: + """ + Executes an R script or R expressions using the Rscript command-line tool. + + This tool serves as a wrapper for Rscript, commonly used for running bioinformatics + scripts, such as those using the Seurat package. You must provide either a script + file to execute or a list of R expressions. + + Args: + script_file (Optional[Path]): Path to the R script file to be executed. Mutually exclusive with 'expressions'. + expressions (Optional[List[str]]): A list of R expressions to execute using the '-e' flag. Mutually exclusive with 'script_file'. + script_args (Optional[List[str]]): A list of arguments to be passed to the R script itself. + verbose (bool): If True, print information on progress (--verbose). Defaults to False. + default_packages (Optional[str]): A comma-separated list of package names to be loaded by default (--default-packages). + save (bool): If True, save the workspace at the end of the session (--save). Ignored if 'vanilla' is True. Defaults to False. + no_environ (bool): If True, do not read the site and user environment files (--no-environ). Ignored if 'vanilla' is True. Defaults to False. + no_site_file (bool): If True, do not read the site-wide Rprofile (--no-site-file). Ignored if 'vanilla' is True. Defaults to False. + no_init_file (bool): If True, do not read the user R profile (--no-init-file). Ignored if 'vanilla' is True. Defaults to False. + restore (bool): If True, restore previously saved objects at startup (--restore). Ignored if 'vanilla' is True. Defaults to False. + vanilla (bool): If True, combines --no-save, --no-restore, --no-site-file, --no-init-file, and --no-environ. Defaults to False. + + Returns: + Dict: A dictionary containing the executed command, stdout, stderr, and a list of potential output files. + """ + # 1. Input Validation + if script_file and expressions: + raise ValueError("Cannot provide both 'script_file' and 'expressions'. They are mutually exclusive.") + if not script_file and not expressions: + raise ValueError("Must provide either 'script_file' or 'expressions' to execute.") + + if script_file: + if not script_file.is_file(): + raise FileNotFoundError(f"The specified script file does not exist: {script_file}") + + # 2. Command Construction + command = ["Rscript"] + + if vanilla: + command.append("--vanilla") + else: + # These options are combined in --vanilla, so we only process them if vanilla is false. + if save: + command.append("--save") + if no_environ: + command.append("--no-environ") + if no_site_file: + command.append("--no-site-file") + if no_init_file: + command.append("--no-init-file") + if restore: + command.append("--restore") + + if verbose: + command.append("--verbose") + + if default_packages: + command.append(f"--default-packages={default_packages}") + + if expressions: + for expr in expressions: + command.extend(["-e", expr]) + elif script_file: + command.append(str(script_file)) + + if script_args: + command.extend(script_args) + + # 3. Subprocess Execution + command_str = " ".join(command) + logging.info(f"Executing command: {command_str}") + + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=True + ) + stdout = result.stdout + stderr = result.stderr + logging.info("Rscript execution completed successfully.") + + except FileNotFoundError: + error_msg = "Rscript command not found. Please ensure R is installed and in your system's PATH." + logging.error(error_msg) + return { + "command_executed": command_str, + "stdout": "", + "stderr": error_msg, + "output_files": [] + } + except subprocess.CalledProcessError as e: + logging.error(f"Rscript execution failed with exit code {e.returncode}.") + logging.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # 4. Structured Result Return + # Rscript itself doesn't define output files; the script it runs does. + # We return an empty list, as we can't reliably determine what files the script might create. + return { + "command_executed": command_str, + "stdout": stdout, + "stderr": stderr, + "output_files": [] + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..55686706f3b1389e8dfc40b0ef6da0419f3f0078 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/app/r-seurat-scripts_server.py') +SERVER_NAME = 'biosci_r_seurat_scripts' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..c7e41432b1df433fcc2bdb0aa9cff82423355741 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-r-seurat-scripts: + build: . + image: mcp-r-seurat-scripts:latest + container_name: mcp-r-seurat-scripts + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=r-seurat-scripts + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..074b0cc004c9bd5ed9623010a5ba0315729c1e90 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - r-seurat-scripts + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat-scripts/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..76344dfbe56dfa5f0cc9c6e2a91db9442b7e7892 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install r-seurat via conda (e.g., from bioconda) +RUN conda install -c bioconda r-seurat -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY r-seurat_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/r-seurat_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/r-seurat_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_server.py new file mode 100644 index 0000000000000000000000000000000000000000..06dbb32b100b37f2e3f2dda11aa79481ed5a5cd6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_server.py @@ -0,0 +1,263 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +def run_r_command(script: str) -> Dict[str, Any]: + """Helper to execute R code via Rscript and handle errors.""" + try: + # We use -e to execute the expression directly + result = subprocess.run( + ["Rscript", "-e", script], + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": f"Rscript -e \"{script}\"", + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": f"Rscript -e \"{script}\"", + "stdout": e.stdout, + "stderr": e.stderr, + "status": "error", + "error_message": str(e) + } + +@mcp.tool() +def seurat_create_from_csv( + input_csv: str, + output_rds: str, + project_name: str = "SeuratProject", + min_cells: int = 3, + min_features: int = 200, +): + """ + Initialize a Seurat object from a CSV count matrix (genes as rows, cells as columns). + """ + input_path = Path(input_csv) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input file {input_csv} not found."} + + r_code = ( + f"library(Seurat); " + f"counts <- read.csv('{input_path}', row.names = 1, check.names = FALSE); " + f"obj <- CreateSeuratObject(counts = counts, project = '{project_name}', " + f"min.cells = {min_cells}, min.features = {min_features}); " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_normalize_data( + input_rds: str, + output_rds: str, + normalization_method: str = "LogNormalize", + scale_factor: int = 10000, +): + """ + Normalize the Seurat object data. + """ + input_path = Path(input_rds) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"obj <- NormalizeData(obj, normalization.method = '{normalization_method}', " + f"scale.factor = {scale_factor}); " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_find_variable_features( + input_rds: str, + output_rds: str, + selection_method: str = "vst", + n_features: int = 2000, +): + """ + Identify highly variable features in the dataset. + """ + input_path = Path(input_rds) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"obj <- FindVariableFeatures(obj, selection.method = '{selection_method}', " + f"nfeatures = {n_features}); " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_scale_and_pca( + input_rds: str, + output_rds: str, + npcs: int = 50, + vars_to_regress: Optional[List[str]] = None, +): + """ + Scales data and runs Principal Component Analysis (PCA). + """ + input_path = Path(input_rds) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + regress_cmd = "NULL" + if vars_to_regress: + regress_cmd = "c(" + ",".join([f"'{v}'" for v in vars_to_regress]) + ")" + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"obj <- ScaleData(obj, vars.to.regress = {regress_cmd}); " + f"obj <- RunPCA(obj, npcs = {npcs}, verbose = FALSE); " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_cluster_and_umap( + input_rds: str, + output_rds: str, + dims_to_use: int = 20, + resolution: float = 0.5, + run_umap: bool = True, + run_tsne: bool = False, +): + """ + Find neighbors, identify clusters, and run UMAP/tSNE dimensionality reduction. + """ + input_path = Path(input_rds) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + umap_cmd = "obj <- RunUMAP(obj, dims = 1:dims_to_use);" if run_umap else "" + tsne_cmd = "obj <- RunTSNE(obj, dims = 1:dims_to_use);" if run_tsne else "" + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"dims_to_use <- {dims_to_use}; " + f"obj <- FindNeighbors(obj, dims = 1:dims_to_use); " + f"obj <- FindClusters(obj, resolution = {resolution}); " + f"{umap_cmd} " + f"{tsne_cmd} " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_find_all_markers( + input_rds: str, + output_csv: str, + logfc_threshold: float = 0.25, + min_pct: float = 0.1, + only_pos: bool = True, +): + """ + Find markers (differentially expressed genes) for every cluster compared to all remaining cells. + """ + input_path = Path(input_rds) + output_path = Path(output_csv) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + only_pos_r = "TRUE" if only_pos else "FALSE" + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"markers <- FindAllMarkers(obj, only.pos = {only_pos_r}, " + f"min.pct = {min_pct}, logfc.threshold = {logfc_threshold}); " + f"write.csv(markers, '{output_path}', row.names = TRUE)" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_subset_object( + input_rds: str, + output_rds: str, + subset_expression: str, +): + """ + Subset a Seurat object based on metadata criteria (e.g., 'nFeature_RNA > 200 & percent.mt < 5'). + """ + input_path = Path(input_rds) + output_path = Path(output_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + # We use parse/eval to handle the string expression safely in R + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"obj <- subset(obj, subset = {subset_expression}); " + f"saveRDS(obj, '{output_path}')" + ) + + result = run_r_command(r_code) + result["output_files"] = [str(output_path)] if output_path.exists() else [] + return result + +@mcp.tool() +def seurat_get_metadata_summary( + input_rds: str, +): + """ + Retrieve a summary of the Seurat object metadata and cluster counts. + """ + input_path = Path(input_rds) + + if not input_path.exists(): + return {"error": f"Input RDS {input_rds} not found."} + + r_code = ( + f"library(Seurat); " + f"obj <- readRDS('{input_path}'); " + f"print(head(obj@meta.data)); " + f"print(table(Idents(obj))); " + f"cat('Assays:', Assays(obj), '\\n'); " + f"cat('Cells:', ncol(obj), '\\n'); " + f"cat('Features:', nrow(obj), '\\n')" + ) + + return run_r_command(r_code) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c6d38cb673489af5ef3c36e20b9d20d50d66b844 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/app/r-seurat_server.py') +SERVER_NAME = 'biosci_r_seurat' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..b41d508b23a947d2115b0fd165f7084098ee9b70 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-r-seurat: + build: . + image: mcp-r-seurat:latest + container_name: mcp-r-seurat + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=r-seurat + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fb92ef0ff8c7c1a5e281e2e8305d7bf64d2bcf34 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - r-seurat + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-seurat/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..703c28ae236475e6486aeba846341fc03fe1157e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install r-signac via conda (e.g., from bioconda) +RUN conda install -c bioconda r-signac -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY r-signac_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/r-signac_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/r-signac_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b2edb0ae049b55a338b595fa9c04d119d8f0ce66 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_server.py @@ -0,0 +1,178 @@ +from typing import List, Optional +import subprocess +from pathlib import Path + +@mcp.tool() +def r_signac_run_script( + script_file: str, + args: List[str] = [], + verbose: bool = False, + default_packages: Optional[str] = None, + save: bool = False, + no_environ: bool = False, + no_site_file: bool = False, + no_init_file: bool = False, + restore: bool = False, + vanilla: bool = False, +): + """ + Runs an R script file using Rscript, typically used for Signac genomic analysis workflows. + + Args: + script_file: Path to the R script (.R) to execute. + args: Additional command line arguments to pass to the R script. + verbose: Print information on progress. + default_packages: Comma-separated set of package names to load, or 'NULL'. + save: Do save workspace at the end of the session. + no_environ: Don't read the site and user environment files. + no_site_file: Don't read the site-wide Rprofile. + no_init_file: Don't read the user R profile. + restore: Do restore previously saved objects at startup. + vanilla: Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ. + """ + # Input validation + script_path = Path(script_file) + if not script_path.exists(): + return {"error": f"Script file not found: {script_file}"} + if not script_path.is_file(): + return {"error": f"Path is not a file: {script_file}"} + + # Build command + cmd = ["Rscript"] + + # Add options + if verbose: + cmd.append("--verbose") + if default_packages: + cmd.append(f"--default-packages={default_packages}") + if save: + cmd.append("--save") + if no_environ: + cmd.append("--no-environ") + if no_site_file: + cmd.append("--no-site-file") + if no_init_file: + cmd.append("--no-init-file") + if restore: + cmd.append("--restore") + if vanilla: + cmd.append("--vanilla") + + # Add the script file + cmd.append(str(script_path)) + + # Add trailing arguments + if args: + cmd.extend(args) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def r_signac_run_expression( + expressions: List[str], + verbose: bool = False, + default_packages: Optional[str] = None, + save: bool = False, + no_environ: bool = False, + no_site_file: bool = False, + no_init_file: bool = False, + restore: bool = False, + vanilla: bool = False, +): + """ + Executes one or more R expressions directly from the command line. + Useful for quick Signac commands like checking versions or loading small datasets. + + Args: + expressions: A list of R code strings to execute (e.g., ["library(Signac)", "print(sessionInfo())"]). + verbose: Print information on progress. + default_packages: Comma-separated set of package names to load, or 'NULL'. + save: Do save workspace at the end of the session. + no_environ: Don't read the site and user environment files. + no_site_file: Don't read the site-wide Rprofile. + no_init_file: Don't read the user R profile. + restore: Do restore previously saved objects at startup. + vanilla: Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ. + """ + if not expressions: + return {"error": "No R expressions provided."} + + # Build command + cmd = ["Rscript"] + + # Add options + if verbose: + cmd.append("--verbose") + if default_packages: + cmd.append(f"--default-packages={default_packages}") + if save: + cmd.append("--save") + if no_environ: + cmd.append("--no-environ") + if no_site_file: + cmd.append("--no-site-file") + if no_init_file: + cmd.append("--no-init-file") + if restore: + cmd.append("--restore") + if vanilla: + cmd.append("--vanilla") + + # Add expressions + for expr in expressions: + cmd.append("-e") + cmd.append(expr) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def r_signac_get_version(): + """ + Prints the version of Rscript and the R environment. + """ + cmd = ["Rscript", "--version"] + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + # Rscript --version often outputs to stderr + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "version_info": result.stderr if result.stderr else result.stdout + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "status": "error" + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..df6c7c5b9f4b75c9d679b5fdb7c69fb06e76aeeb --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/app/r-signac_server.py') +SERVER_NAME = 'biosci_r_signac' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..7b8ab61681f8170ef2f01550a8d7cf0bf0cdcd95 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-r-signac: + build: . + image: mcp-r-signac:latest + container_name: mcp-r-signac + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=r-signac + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9342de5412f258fe008a34c3ff7d04b3e467f278 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - r-signac + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_r-signac/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c3466c3e1924a54976d282de13c5f020d8406c5b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install samtools via conda (e.g., from bioconda) +RUN conda install -c bioconda samtools -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/samtools_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/samtools_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/samtools_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e1c17ae7020a89991d8e4ca5f3079dbd3964ee8d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_server.py @@ -0,0 +1,1337 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Union + +# Helper function to run samtools commands +def _run_samtools_command( + command_args: List[str], + input_files: Optional[List[Path]] = None, + output_files: Optional[List[Path]] = None, + check_existence: bool = True, +) -> dict: + """ + Executes a samtools command and handles output/errors. + + Args: + command_args: List of command-line arguments for samtools. + input_files: List of input file paths to check for existence. + output_files: List of expected output file paths. + check_existence: If True, checks if input_files exist before running. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + full_command = ["samtools"] + command_args + + if check_existence and input_files: + for f in input_files: + if not f.exists(): + raise FileNotFoundError(f"Input file not found: {f}") + + try: + process = subprocess.run( + [str(arg) for arg in full_command], + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join([str(arg) for arg in full_command]), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [str(f) for f in output_files] if output_files else [], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join([str(arg) for arg in full_command]), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Samtools command failed with exit code {e.returncode}", + "output_files": [], + } + except FileNotFoundError: + return { + "command_executed": " ".join([str(arg) for arg in full_command]), + "stdout": "", + "stderr": "Error: samtools command not found. Is it installed and in PATH?", + "error": "Samtools executable not found.", + "output_files": [], + } + + +# --- Indexing Commands --- + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_dict( + fasta_file: Path, + output_dict_file: Optional[Path] = None, + sequence_name_style: Optional[str] = None, +) -> dict: + """ + Creates a sequence dictionary file (.dict) from a FASTA reference. + + Args: + fasta_file: Path to the input FASTA reference file. + output_dict_file: Optional path for the output dictionary file. If not + provided, it defaults to .dict. + sequence_name_style: Optional style for sequence names in the dictionary. + (e.g., 'ucsc', 'ensembl', 'genbank'). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not fasta_file.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {fasta_file}") + + cmd = ["dict", fasta_file] + output_file = output_dict_file if output_dict_file else fasta_file.with_suffix(".dict") + cmd.extend(["-o", output_file]) + + if sequence_name_style: + cmd.extend(["-s", sequence_name_style]) + + return _run_samtools_command(cmd, input_files=[fasta_file], output_files=[output_file]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_faidx( + fasta_file: Path, + regions: Optional[List[str]] = None, + output_file: Optional[Path] = None, + regions_file: Optional[Path] = None, + line_length: Optional[int] = None, + chrom_only: bool = False, +) -> dict: + """ + Indexes a FASTA file or extracts sequences from an indexed FASTA. + + Args: + fasta_file: Path to the input FASTA file. + regions: Optional list of regions (e.g., "chr1:100-200") to extract. + If provided, sequences are extracted. + output_file: Optional path for the output FASTA file when extracting regions. + If not provided, extracted sequences go to stdout. + regions_file: Optional path to a file containing regions to extract. + line_length: Optional line length for output sequences (default is 60). + chrom_only: If True, only output chromosome names, not full headers. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not fasta_file.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {fasta_file}") + + cmd = ["faidx", fasta_file] + + if output_file: + cmd.extend(["-o", output_file]) + if regions_file: + if not regions_file.exists(): + raise FileNotFoundError(f"Regions file not found: {regions_file}") + cmd.extend(["-r", regions_file]) + if line_length is not None: + if line_length < 1: + raise ValueError("Line length must be a positive integer.") + cmd.extend(["-n", str(line_length)]) + if chrom_only: + cmd.append("-c") + if regions: + cmd.extend(regions) + + output_files_list = [output_file] if output_file else [] + # faidx also creates a .fai file, but it's implicit and often not returned explicitly + # unless it's the primary output. For extraction, the output_file is primary. + return _run_samtools_command(cmd, input_files=[fasta_file], output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_fqidx( + fastq_file: Path, + regions: Optional[List[str]] = None, + output_file: Optional[Path] = None, + regions_file: Optional[Path] = None, + line_length: Optional[int] = None, + chrom_only: bool = False, +) -> dict: + """ + Indexes a FASTQ file or extracts sequences from an indexed FASTQ. + + Args: + fastq_file: Path to the input FASTQ file. + regions: Optional list of regions (e.g., "chr1:100-200") to extract. + If provided, sequences are extracted. + output_file: Optional path for the output FASTQ file when extracting regions. + If not provided, extracted sequences go to stdout. + regions_file: Optional path to a file containing regions to extract. + line_length: Optional line length for output sequences (default is 60). + chrom_only: If True, only output chromosome names, not full headers. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not fastq_file.exists(): + raise FileNotFoundError(f"Input FASTQ file not found: {fastq_file}") + + cmd = ["fqidx", fastq_file] + + if output_file: + cmd.extend(["-o", output_file]) + if regions_file: + if not regions_file.exists(): + raise FileNotFoundError(f"Regions file not found: {regions_file}") + cmd.extend(["-r", regions_file]) + if line_length is not None: + if line_length < 1: + raise ValueError("Line length must be a positive integer.") + cmd.extend(["-n", str(line_length)]) + if chrom_only: + cmd.append("-c") + if regions: + cmd.extend(regions) + + output_files_list = [output_file] if output_file else [] + # fqidx also creates a .fqi file, but it's implicit. + return _run_samtools_command(cmd, input_files=[fastq_file], output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_index( + alignment_file: Path, + use_csi: bool = False, + min_shift: Optional[int] = None, +) -> dict: + """ + Indexes a BAM or CRAM alignment file. + + Args: + alignment_file: Path to the input BAM or CRAM file. + use_csi: If True, create a CSI index (.csi) instead of a BAI index (.bai). + min_shift: Minimum shift for CSI indexing (default 14 for BAI, 13 for CSI). + Only applicable if `use_csi` is True. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {alignment_file}") + + cmd = ["index", alignment_file] + output_suffix = ".csi" if use_csi else ".bai" + output_index_file = alignment_file.with_suffix(alignment_file.suffix + output_suffix) + + if use_csi: + cmd.append("-c") + if min_shift is not None: + if min_shift < 1: + raise ValueError("Minimum shift must be a positive integer.") + cmd.extend(["-m", str(min_shift)]) + elif min_shift is not None: + # min_shift is only relevant for CSI, warn if used with BAI + print("Warning: --min-shift is only applicable for CSI indexing (-c). Ignoring for BAI.") + + return _run_samtools_command(cmd, input_files=[alignment_file], output_files=[output_index_file]) + + +# --- Editing Commands --- + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_calmd( + input_bam: Path, + reference_fasta: Path, + output_bam: Optional[Path] = None, + recalculate_tags: bool = False, + uncompressed_output: bool = False, + coefficient: Optional[int] = None, + threads: int = 0, +) -> dict: + """ + Recalculates MD/NM tags and '=' bases in an alignment file. + + Args: + input_bam: Path to the input BAM file. + reference_fasta: Path to the reference FASTA file. + output_bam: Optional path for the output BAM file. If not provided, output goes to stdout. + recalculate_tags: If True, recalculate NM and MD tags. + uncompressed_output: If True, output uncompressed BAM. + coefficient: Coefficient for calculating BQ. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + if not reference_fasta.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + cmd = ["calmd", input_bam, reference_fasta] + + if output_bam: + cmd.extend(["-o", output_bam]) + if recalculate_tags: + cmd.append("-e") + if uncompressed_output: + cmd.append("-u") + if coefficient is not None: + cmd.extend(["-C", str(coefficient)]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + output_files_list = [output_bam] if output_bam else [] + return _run_samtools_command( + cmd, input_files=[input_bam, reference_fasta], output_files=output_files_list + ) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_fixmate( + input_bam: Path, + output_bam: Path, + remove_secondary_supplementary: bool = False, + add_pg_tag: bool = False, + add_mate_score: bool = False, + threads: int = 0, +) -> dict: + """ + Fixes mate information for paired-end reads in a BAM file. + Input BAM must be sorted by read name. + + Args: + input_bam: Path to the input BAM file (must be sorted by read name). + output_bam: Path for the output BAM file. + remove_secondary_supplementary: If True, remove secondary and supplementary alignments. + add_pg_tag: If True, add PG tag to output. + add_mate_score: If True, add mate score (ms tag). + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["fixmate", input_bam, output_bam] + + if remove_secondary_supplementary: + cmd.append("-r") + if add_pg_tag: + cmd.append("-p") + if add_mate_score: + cmd.append("-m") + if threads > 0: + cmd.extend(["-@", str(threads)]) + + return _run_samtools_command(cmd, input_files=[input_bam], output_files=[output_bam]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_reheader( + new_header_file: Path, + input_bam: Path, + output_bam: Optional[Path] = None, +) -> dict: + """ + Replaces the header of a BAM file with a new header from a SAM file. + + Args: + new_header_file: Path to the SAM file containing the new header. + input_bam: Path to the input BAM file. + output_bam: Optional path for the output BAM file. If not provided, output goes to stdout. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not new_header_file.exists(): + raise FileNotFoundError(f"New header file not found: {new_header_file}") + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["reheader", new_header_file, input_bam] + + if output_bam: + cmd.extend(["-o", output_bam]) + + output_files_list = [output_bam] if output_bam else [] + return _run_samtools_command( + cmd, input_files=[new_header_file, input_bam], output_files=output_files_list + ) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_targetcut( + input_bam: Path, + output_bam: Optional[Path] = None, + reference_fasta: Optional[Path] = None, +) -> dict: + """ + Cuts fosmid regions (for fosmid pool only). This is a specialized tool. + + Args: + input_bam: Path to the input BAM file. + output_bam: Optional path for the output BAM file. If not provided, output goes to stdout. + reference_fasta: Optional path to the reference FASTA file. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + if reference_fasta and not reference_fasta.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + cmd = ["targetcut", input_bam] + + if output_bam: + cmd.extend(["-o", output_bam]) + if reference_fasta: + cmd.extend(["-f", reference_fasta]) + + output_files_list = [output_bam] if output_bam else [] + input_files_list = [input_bam] + if reference_fasta: + input_files_list.append(reference_fasta) + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_addreplacerg( + input_bam: Path, + rg_line: str, + output_bam: Optional[Path] = None, + overwrite_existing_rg: bool = False, + threads: int = 0, +) -> dict: + """ + Adds or replaces RG (Read Group) tags in an alignment file. + + Args: + input_bam: Path to the input BAM file. + rg_line: The full RG line to add or replace (e.g., '@RG\\tID:group1\\tSM:sample1'). + output_bam: Optional path for the output BAM file. If not provided, output goes to stdout. + overwrite_existing_rg: If True, overwrite existing RG tags. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["addreplacerg", "-r", rg_line, input_bam] + + if output_bam: + cmd.extend(["-o", output_bam]) + if overwrite_existing_rg: + cmd.append("-w") + if threads > 0: + cmd.extend(["-@", str(threads)]) + + output_files_list = [output_bam] if output_bam else [] + return _run_samtools_command(cmd, input_files=[input_bam], output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_markdup( + input_bam: Path, + output_bam: Path, + remove_duplicates: bool = False, + mark_supplementary: bool = False, + fill_tags: bool = False, + max_isize: Optional[int] = None, + threads: int = 0, +) -> dict: + """ + Marks duplicates in a BAM file. Input BAM must be sorted by coordinate. + + Args: + input_bam: Path to the input BAM file (must be sorted by coordinate). + output_bam: Path for the output BAM file. + remove_duplicates: If True, remove duplicate reads instead of just marking them. + mark_supplementary: If True, mark supplementary alignments as duplicates. + fill_tags: If True, fill in the MC and ML tags. + max_isize: Maximum insert size to consider for duplicates. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["markdup", input_bam, output_bam] + + if remove_duplicates: + cmd.append("-r") + if mark_supplementary: + cmd.append("-s") + if fill_tags: + cmd.append("-f") + if max_isize is not None: + if max_isize < 0: + raise ValueError("Maximum insert size must be a non-negative integer.") + cmd.extend(["-l", str(max_isize)]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + return _run_samtools_command(cmd, input_files=[input_bam], output_files=[output_bam]) + + +# --- File Operations Commands --- + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_collate( + input_bam: Path, + output_prefix: Path, + uncompressed_output: bool = False, + threads: int = 0, +) -> dict: + """ + Shuffles and groups alignments by name. + + Args: + input_bam: Path to the input BAM file. + output_prefix: Prefix for the output BAM file(s). + E.g., if 'output_prefix' is 'out', output will be 'out.bam'. + uncompressed_output: If True, output uncompressed BAM. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["collate", input_bam, output_prefix] + + if uncompressed_output: + cmd.append("-u") + if threads > 0: + cmd.extend(["-@", str(threads)]) + + # samtools collate outputs to .bam + output_file = output_prefix.with_suffix(".bam") + return _run_samtools_command(cmd, input_files=[input_bam], output_files=[output_file]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_cat( + input_bams: List[Path], + output_bam: Optional[Path] = None, + threads: int = 0, +) -> dict: + """ + Concatenates BAM files. All input files must have identical headers. + + Args: + input_bams: List of paths to input BAM files. + output_bam: Optional path for the output concatenated BAM file. + If not provided, output goes to stdout. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for f in input_bams: + if not f.exists(): + raise FileNotFoundError(f"Input BAM file not found: {f}") + + cmd = ["cat"] + if output_bam: + cmd.extend(["-o", output_bam]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + cmd.extend(input_bams) + + output_files_list = [output_bam] if output_bam else [] + return _run_samtools_command(cmd, input_files=input_bams, output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_merge( + output_bam: Path, + input_bams: List[Path], + add_rg_tags: bool = False, + header_file: Optional[Path] = None, + uncompressed_output: bool = False, + threads: int = 0, +) -> dict: + """ + Merges multiple sorted alignment files into a single sorted file. + + Args: + output_bam: Path for the output merged BAM file. + input_bams: List of paths to input BAM files (must be sorted). + add_rg_tags: If True, add RG tags to output reads. + header_file: Optional path to a SAM header file to use. + uncompressed_output: If True, output uncompressed BAM. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for f in input_bams: + if not f.exists(): + raise FileNotFoundError(f"Input BAM file not found: {f}") + if header_file and not header_file.exists(): + raise FileNotFoundError(f"Header file not found: {header_file}") + + cmd = ["merge", output_bam] + + if add_rg_tags: + cmd.append("-r") + if header_file: + cmd.extend(["-h", header_file]) + if uncompressed_output: + cmd.append("-u") + if threads > 0: + cmd.extend(["-@", str(threads)]) + cmd.extend(input_bams) + + input_files_list = list(input_bams) + if header_file: + input_files_list.append(header_file) + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=[output_bam]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_mpileup( + reference_fasta: Path, + input_bams: List[Path], + output_file: Optional[Path] = None, + region: Optional[str] = None, + regions_file: Optional[Path] = None, + min_base_quality: int = 0, + min_mapping_quality: int = 0, + uncompressed_bcf_output: bool = False, + threads: int = 0, +) -> dict: + """ + Generates a multi-way pileup from multiple alignment files. + + Args: + reference_fasta: Path to the reference FASTA file. + input_bams: List of paths to input BAM/CRAM files. + output_file: Optional path for the output pileup file. If not provided, output goes to stdout. + region: Optional genomic region to pileup (e.g., "chr1:100-200"). + regions_file: Optional path to a BED file containing regions to pileup. + min_base_quality: Minimum base quality to consider (default 0). + min_mapping_quality: Minimum mapping quality to consider (default 0). + uncompressed_bcf_output: If True, output uncompressed BCF (implies -g). + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not reference_fasta.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for f in input_bams: + if not f.exists(): + raise FileNotFoundError(f"Input BAM file not found: {f}") + if regions_file and not regions_file.exists(): + raise FileNotFoundError(f"Regions file not found: {regions_file}") + if min_base_quality < 0 or min_mapping_quality < 0: + raise ValueError("Quality scores must be non-negative.") + + cmd = ["mpileup", "-f", reference_fasta] + + if output_file: + cmd.extend(["-o", output_file]) + if region: + cmd.extend(["-r", region]) + if regions_file: + cmd.extend(["-l", regions_file]) + if min_base_quality > 0: + cmd.extend(["-q", str(min_base_quality)]) + if min_mapping_quality > 0: + cmd.extend(["-Q", str(min_mapping_quality)]) + if uncompressed_bcf_output: + cmd.append("-u") # -u implies -g for BCF output + if threads > 0: + cmd.extend(["-@", str(threads)]) + cmd.extend(input_bams) + + input_files_list = [reference_fasta] + list(input_bams) + if regions_file: + input_files_list.append(regions_file) + output_files_list = [output_file] if output_file else [] + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_sort( + input_alignment_file: Path, + output_alignment_file: Path, + sort_by_name: bool = False, + sort_by_tag: Optional[str] = None, + max_memory_per_thread: Optional[str] = None, + threads: int = 0, + output_format: Optional[str] = None, # 'bam', 'sam', 'cram' +) -> dict: + """ + Sorts an alignment file. + + Args: + input_alignment_file: Path to the input alignment file (BAM, SAM, or CRAM). + output_alignment_file: Path for the output sorted alignment file. + sort_by_name: If True, sort by read name instead of coordinate. + sort_by_tag: Optional tag to sort by (e.g., "RG"). + max_memory_per_thread: Maximum memory per thread (e.g., "750M", "4G"). + threads: Number of additional threads to use (0 for single thread). + output_format: Optional output format ('bam', 'sam', 'cram'). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + + cmd = ["sort", input_alignment_file, "-o", output_alignment_file] + + if sort_by_name: + cmd.append("-n") + if sort_by_tag: + cmd.extend(["-t", sort_by_tag]) + if max_memory_per_thread: + cmd.extend(["-m", max_memory_per_thread]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + if output_format: + if output_format not in ["bam", "sam", "cram"]: + raise ValueError(f"Invalid output format: {output_format}. Must be 'bam', 'sam', or 'cram'.") + cmd.extend(["-O", output_format]) + + return _run_samtools_command( + cmd, input_files=[input_alignment_file], output_files=[output_alignment_file] + ) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_split( + input_bam: Path, + output_prefix: Optional[Path] = None, + unmapped_output: Optional[Path] = None, + delete_rg_tag: bool = False, +) -> dict: + """ + Splits a BAM file by read group. + + Args: + input_bam: Path to the input BAM file. + output_prefix: Optional prefix for output files. If not provided, files are named + after read group IDs in the current directory. + unmapped_output: Optional path for a file to store unmapped reads. + delete_rg_tag: If True, delete the RG tag from output reads. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["split", input_bam] + + if output_prefix: + cmd.extend(["-o", output_prefix]) + if unmapped_output: + cmd.extend(["-u", unmapped_output]) + if delete_rg_tag: + cmd.append("-d") + + # The output files are dynamic based on RG tags. We can't predict them precisely. + # If output_prefix is given, we can assume files like ..bam + # For now, we'll just return the prefix if provided, or an empty list. + output_files_list = [] + if output_prefix: + output_files_list.append(output_prefix) # This is a prefix, not a final file + if unmapped_output: + output_files_list.append(unmapped_output) + + return _run_samtools_command(cmd, input_files=[input_bam], output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_quickcheck( + input_files: List[Path], +) -> dict: + """ + Quickly checks if SAM/BAM/CRAM files appear intact. + + Args: + input_files: List of paths to SAM/BAM/CRAM files to check. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_files: + raise ValueError("At least one input file is required.") + for f in input_files: + if not f.exists(): + raise FileNotFoundError(f"Input file not found: {f}") + + cmd = ["quickcheck"] + input_files + + return _run_samtools_command(cmd, input_files=input_files, output_files=[]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_fastq( + input_alignment_file: Path, + output_fastq_file: Optional[Path] = None, + output_fastq_r1: Optional[Path] = None, + output_fastq_r2: Optional[Path] = None, + output_fastq_single_end: Optional[Path] = None, + no_comment: bool = False, + threads: int = 0, +) -> dict: + """ + Converts a BAM/CRAM file to FASTQ format. + + Args: + input_alignment_file: Path to the input BAM/CRAM file. + output_fastq_file: Optional path for a single output FASTQ file (for interleaved or single-end). + If not provided, output goes to stdout. + output_fastq_r1: Optional path for R1 output FASTQ file (for paired-end). + output_fastq_r2: Optional path for R2 output FASTQ file (for paired-end). + output_fastq_single_end: Optional path for single-end reads output FASTQ file. + no_comment: If True, do not output comments in FASTQ header. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + + cmd = ["fastq", input_alignment_file] + output_files_list = [] + + if output_fastq_file: + cmd.extend(["-o", output_fastq_file]) + output_files_list.append(output_fastq_file) + if output_fastq_r1: + cmd.extend(["-1", output_fastq_r1]) + output_files_list.append(output_fastq_r1) + if output_fastq_r2: + cmd.extend(["-2", output_fastq_r2]) + output_files_list.append(output_fastq_r2) + if output_fastq_single_end: + cmd.extend(["-s", output_fastq_single_end]) + output_files_list.append(output_fastq_single_end) + + if no_comment: + cmd.append("-N") + if threads > 0: + cmd.extend(["-@", str(threads)]) + + # Validate output file combinations + if sum([1 for x in [output_fastq_file, output_fastq_r1, output_fastq_r2] if x is not None]) > 1: + raise ValueError("Cannot specify -o, -1, or -2 simultaneously. Choose one output mode.") + if (output_fastq_r1 and not output_fastq_r2) or (output_fastq_r2 and not output_fastq_r1): + raise ValueError("Both -1 and -2 must be specified for paired-end output.") + + return _run_samtools_command( + cmd, input_files=[input_alignment_file], output_files=output_files_list + ) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_fasta( + input_alignment_file: Path, + output_fasta_file: Optional[Path] = None, + no_comment: bool = False, + region: Optional[str] = None, + regions_file: Optional[Path] = None, + threads: int = 0, +) -> dict: + """ + Converts a BAM/CRAM file to FASTA format. + + Args: + input_alignment_file: Path to the input BAM/CRAM file. + output_fasta_file: Optional path for the output FASTA file. If not provided, output goes to stdout. + no_comment: If True, do not output comments in FASTA header. + region: Optional genomic region to extract (e.g., "chr1:100-200"). + regions_file: Optional path to a BED file containing regions to extract. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + if regions_file and not regions_file.exists(): + raise FileNotFoundError(f"Regions file not found: {regions_file}") + + cmd = ["fasta", input_alignment_file] + output_files_list = [] + + if output_fasta_file: + cmd.extend(["-o", output_fasta_file]) + output_files_list.append(output_fasta_file) + if no_comment: + cmd.append("-N") + if region: + cmd.extend(["-r", region]) + if regions_file: + cmd.extend(["-L", regions_file]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + input_files_list = [input_alignment_file] + if regions_file: + input_files_list.append(regions_file) + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# --- Statistics Commands --- + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_bedcov( + bed_file: Path, + input_bams: List[Path], + min_base_quality: int = 0, + min_mapping_quality: int = 0, +) -> dict: + """ + Computes read depth per BED region. + + Args: + bed_file: Path to the input BED file. + input_bams: List of paths to input BAM/CRAM files. + min_base_quality: Minimum base quality to consider (default 0). + min_mapping_quality: Minimum mapping quality to consider (default 0). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not bed_file.exists(): + raise FileNotFoundError(f"Input BED file not found: {bed_file}") + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for f in input_bams: + if not f.exists(): + raise FileNotFoundError(f"Input BAM file not found: {f}") + if min_base_quality < 0 or min_mapping_quality < 0: + raise ValueError("Quality scores must be non-negative.") + + cmd = ["bedcov"] + + if min_base_quality > 0: + cmd.extend(["-q", str(min_base_quality)]) + if min_mapping_quality > 0: + cmd.extend(["-Q", str(min_mapping_quality)]) + + cmd.extend([bed_file] + input_bams) + + input_files_list = [bed_file] + list(input_bams) + return _run_samtools_command(cmd, input_files=input_files_list, output_files=[]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_depth( + input_bams: List[Path], + output_file: Optional[Path] = None, + all_positions: bool = False, + bed_file: Optional[Path] = None, + region: Optional[str] = None, + min_base_quality: int = 0, + min_mapping_quality: int = 0, + threads: int = 0, +) -> dict: + """ + Computes the depth of coverage at each position or within specified regions. + + Args: + input_bams: List of paths to input BAM/CRAM files. + output_file: Optional path for the output depth file. If not provided, output goes to stdout. + all_positions: If True, output all positions, even if depth is 0. + bed_file: Optional path to a BED file to restrict depth calculation to specific regions. + region: Optional genomic region to calculate depth for (e.g., "chr1:100-200"). + min_base_quality: Minimum base quality to consider (default 0). + min_mapping_quality: Minimum mapping quality to consider (default 0). + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for f in input_bams: + if not f.exists(): + raise FileNotFoundError(f"Input BAM file not found: {f}") + if bed_file and not bed_file.exists(): + raise FileNotFoundError(f"BED file not found: {bed_file}") + if min_base_quality < 0 or min_mapping_quality < 0: + raise ValueError("Quality scores must be non-negative.") + + cmd = ["depth"] + + if output_file: + cmd.extend(["-o", output_file]) + if all_positions: + cmd.append("-a") + if bed_file: + cmd.extend(["-b", bed_file]) + if region: + cmd.extend(["-r", region]) + if min_base_quality > 0: + cmd.extend(["-q", str(min_base_quality)]) + if min_mapping_quality > 0: + cmd.extend(["-Q", str(min_mapping_quality)]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + cmd.extend(input_bams) + + input_files_list = list(input_bams) + if bed_file: + input_files_list.append(bed_file) + output_files_list = [output_file] if output_file else [] + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_flagstat( + input_alignment_file: Path, + output_file: Optional[Path] = None, + threads: int = 0, +) -> dict: + """ + Generates simple statistics on alignment flags. + + Args: + input_alignment_file: Path to the input BAM/SAM/CRAM file. + output_file: Optional path for the output statistics file. If not provided, output goes to stdout. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + + cmd = ["flagstat", input_alignment_file] + + if output_file: + cmd.extend(["-o", output_file]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + output_files_list = [output_file] if output_file else [] + return _run_samtools_command( + cmd, input_files=[input_alignment_file], output_files=output_files_list + ) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_idxstats( + input_alignment_file: Path, +) -> dict: + """ + Retrieves and prints statistics from the BAM index file. + + Args: + input_alignment_file: Path to the input BAM/CRAM file. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + + cmd = ["idxstats", input_alignment_file] + + return _run_samtools_command(cmd, input_files=[input_alignment_file], output_files=[]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_phase( + input_bam: Path, + output_file: Optional[Path] = None, + min_base_quality: int = 0, + min_mapping_quality: int = 0, + min_coverage: int = 0, +) -> dict: + """ + Phases heterozygotes in a BAM file. + + Args: + input_bam: Path to the input BAM file. + output_file: Optional path for the output phased variants file. If not provided, output goes to stdout. + min_base_quality: Minimum base quality to consider (default 0). + min_mapping_quality: Minimum mapping quality to consider (default 0). + min_coverage: Minimum coverage to consider a site (default 0). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + if min_base_quality < 0 or min_mapping_quality < 0 or min_coverage < 0: + raise ValueError("Quality scores and coverage must be non-negative.") + + cmd = ["phase", input_bam] + + if output_file: + cmd.extend(["-o", output_file]) + if min_base_quality > 0: + cmd.extend(["-q", str(min_base_quality)]) + if min_mapping_quality > 0: + cmd.extend(["-Q", str(min_mapping_quality)]) + if min_coverage > 0: + cmd.extend(["-k", str(min_coverage)]) + + output_files_list = [output_file] if output_file else [] + return _run_samtools_command(cmd, input_files=[input_bam], output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_stats( + input_alignment_file: Path, + output_file: Optional[Path] = None, + reference_fasta: Optional[Path] = None, + coverage_cap: Optional[int] = None, + threads: int = 0, +) -> dict: + """ + Generates detailed statistics from an alignment file. + + Args: + input_alignment_file: Path to the input BAM/SAM/CRAM file. + output_file: Optional path for the output statistics file. If not provided, output goes to stdout. + reference_fasta: Optional path to the reference FASTA file. + coverage_cap: Optional maximum coverage to count (default 250). + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + if reference_fasta and not reference_fasta.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + if coverage_cap is not None and coverage_cap < 0: + raise ValueError("Coverage cap must be a non-negative integer.") + + cmd = ["stats", input_alignment_file] + + if output_file: + cmd.extend(["-o", output_file]) + if reference_fasta: + cmd.extend(["-r", reference_fasta]) + if coverage_cap is not None: + cmd.extend(["-c", str(coverage_cap)]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + input_files_list = [input_alignment_file] + if reference_fasta: + input_files_list.append(reference_fasta) + output_files_list = [output_file] if output_file else [] + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# --- Viewing Commands --- + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_flags( + flag_value: Union[int, str], +) -> dict: + """ + Explains BAM flags (integer value or symbolic string). + + Args: + flag_value: An integer representing the flag value or a symbolic string + (e.g., "0x4", "PAIRED", "UNMAP"). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + cmd = ["flags", str(flag_value)] + + return _run_samtools_command(cmd, check_existence=False) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_tview( + input_alignment_file: Path, + reference_fasta: Optional[Path] = None, + region: Optional[str] = None, + display_deletions: bool = False, + position: Optional[str] = None, + sequence: Optional[str] = None, +) -> dict: + """ + Provides a text alignment viewer. Note: This is an interactive tool and its + output is typically not suitable for automated parsing. This wrapper will + capture the initial screen output if not interactive. + + Args: + input_alignment_file: Path to the input BAM/SAM/CRAM file. + reference_fasta: Optional path to the reference FASTA file. + region: Optional genomic region to view (e.g., "chr1:100-200"). + display_deletions: If True, display deletions as '-'. + position: Optional starting position (e.g., "chr1:100"). + sequence: Optional sequence to highlight. + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + if reference_fasta and not reference_fasta.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + + cmd = ["tview", input_alignment_file] + + if reference_fasta: + cmd.extend(["-f", reference_fasta]) + if region: + cmd.extend(["-r", region]) + if display_deletions: + cmd.append("-d") + if position: + cmd.extend(["-p", position]) + if sequence: + cmd.extend(["-s", sequence]) + + input_files_list = [input_alignment_file] + if reference_fasta: + input_files_list.append(reference_fasta) + + # tview is interactive, so capturing stdout might not be useful for all cases. + # It will capture the initial screen dump. + return _run_samtools_command(cmd, input_files=input_files_list, output_files=[]) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_view( + input_alignment_file: Path, + output_file: Optional[Path] = None, + output_format: Optional[str] = None, # 'sam', 'bam', 'cram' + input_is_sam: bool = False, + include_header: bool = False, + regions: Optional[List[str]] = None, + regions_file: Optional[Path] = None, + min_mapping_quality: int = 0, + filter_flags: Optional[int] = None, + require_flags: Optional[int] = None, + threads: int = 0, +) -> dict: + """ + Views, filters, and converts SAM/BAM/CRAM files. + + Args: + input_alignment_file: Path to the input SAM/BAM/CRAM file. + output_file: Optional path for the output alignment file. If not provided, output goes to stdout. + output_format: Optional output format ('sam', 'bam', 'cram'). + input_is_sam: If True, assume input is SAM format. + include_header: If True, include header in output. + regions: Optional list of genomic regions to extract (e.g., "chr1:100-200"). + regions_file: Optional path to a BED file containing regions to extract. + min_mapping_quality: Minimum mapping quality to include reads (default 0). + filter_flags: Exclude reads with any of these flags set (integer value). + require_flags: Only include reads with all of these flags set (integer value). + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_alignment_file.exists(): + raise FileNotFoundError(f"Input alignment file not found: {input_alignment_file}") + if regions_file and not regions_file.exists(): + raise FileNotFoundError(f"Regions file not found: {regions_file}") + if min_mapping_quality < 0: + raise ValueError("Minimum mapping quality must be non-negative.") + if filter_flags is not None and filter_flags < 0: + raise ValueError("Filter flags must be a non-negative integer.") + if require_flags is not None and require_flags < 0: + raise ValueError("Require flags must be a non-negative integer.") + if output_format and output_format not in ["sam", "bam", "cram"]: + raise ValueError(f"Invalid output format: {output_format}. Must be 'sam', 'bam', or 'cram'.") + + cmd = ["view", input_alignment_file] + output_files_list = [] + + if output_file: + cmd.extend(["-o", output_file]) + output_files_list.append(output_file) + if output_format == "sam": + cmd.append("-S") # This is usually for input, but samtools view -O SAM is also possible + # For output, -O is preferred. Let's use -O. + cmd.extend(["-O", "SAM"]) + elif output_format == "bam": + cmd.extend(["-O", "BAM"]) + elif output_format == "cram": + cmd.extend(["-O", "CRAM"]) + + if input_is_sam: + cmd.append("-S") + if include_header: + cmd.append("-h") + if regions_file: + cmd.extend(["-L", regions_file]) + if min_mapping_quality > 0: + cmd.extend(["-q", str(min_mapping_quality)]) + if filter_flags is not None: + cmd.extend(["-F", str(filter_flags)]) + if require_flags is not None: + cmd.extend(["-f", str(require_flags)]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + if regions: + cmd.extend(regions) + + input_files_list = [input_alignment_file] + if regions_file: + input_files_list.append(regions_file) + + return _run_samtools_command(cmd, input_files=input_files_list, output_files=output_files_list) + + +# @mcp.tool() # Uncomment this line when integrating with MCP +def samtools_depad( + input_bam: Path, + output_bam: Optional[Path] = None, + threads: int = 0, +) -> dict: + """ + Converts a padded BAM to an unpadded BAM. + + Args: + input_bam: Path to the input padded BAM file. + output_bam: Optional path for the output unpadded BAM file. If not provided, output goes to stdout. + threads: Number of additional threads to use (0 for single thread). + + Returns: + A dictionary containing command_executed, stdout, stderr, and output_files. + """ + if not input_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + cmd = ["depad", input_bam] + + if output_bam: + cmd.extend(["-o", output_bam]) + if threads > 0: + cmd.extend(["-@", str(threads)]) + + output_files_list = [output_bam] if output_bam else [] + return _run_samtools_command(cmd, input_files=[input_bam], output_files=output_files_list) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..3ec3c0a7c11ab882e3c2e864050b858734e16766 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/app/samtools_server.py') +SERVER_NAME = 'biosci_samtools' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f9f04a0472441a8d98331fc909defa24d3a7bb82 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-samtools: + build: . + image: mcp-samtools:latest + container_name: mcp-samtools + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=samtools + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..863d9f9be5842148dc7d8b005e221928749232c5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - samtools + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_samtools/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..86574672f7c83d0ef9240aed53d424f28c7325b5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scanpy via conda (e.g., from bioconda) +RUN conda install -c bioconda scanpy -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scanpy_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scanpy_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scanpy_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e282e6ec4333229a29db92a4561877c1b5ad4f08 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_server.py @@ -0,0 +1,109 @@ +import subprocess +from pathlib import Path +from typing import Optional, Literal + +# In a real MCP environment, the mcp package would be available. +# This is a placeholder for the linter. +class _MCP: + def tool(self): + def decorator(func): + return func + return decorator +mcp = _MCP() + + +@mcp.tool() +def settings( + verbosity: Optional[Literal[0, 1, 2, 3, 4, 5]] = None, + plot_prefix: Optional[str] = None, + file_format_data: Optional[Literal['h5ad', 'loom', 'zarr', 'csv', 'txt', 'npz', 'mtx']] = None, + file_format_figs: Optional[Literal['pdf', 'png', 'svg', 'jpg']] = None, + autoshow: Optional[bool] = None, + autosave: Optional[bool] = None, + figdir: Optional[Path] = None, + cachedir: Optional[Path] = None, + datasetdir: Optional[Path] = None, + logfile: Optional[Path] = None, + max_memory: Optional[float] = None, + n_jobs: Optional[int] = None, + allow_online_downloads: Optional[bool] = None, +): + """ + Configure global settings for the Scanpy toolkit. + + This tool provides a command-line interface to configure various global + settings of Scanpy, such as verbosity, file formats, and directories + for figures and caches. If no arguments are provided, it typically prints + the current settings. + """ + # --- Input Validation --- + if max_memory is not None and max_memory <= 0: + raise ValueError("max_memory must be a positive number.") + if n_jobs is not None and n_jobs <= 0: + raise ValueError("n_jobs must be a positive integer.") + + # --- Command Construction --- + cmd = ["scanpy", "settings"] + + if verbosity is not None: + cmd.extend(["--verbosity", str(verbosity)]) + if plot_prefix is not None: + cmd.extend(["--plot-prefix", plot_prefix]) + if file_format_data is not None: + cmd.extend(["--file-format-data", file_format_data]) + if file_format_figs is not None: + cmd.extend(["--file-format-figs", file_format_figs]) + if autoshow is not None: + cmd.extend(["--autoshow", str(autoshow)]) + if autosave is not None: + cmd.extend(["--autosave", str(autosave)]) + if figdir is not None: + cmd.extend(["--figdir", str(figdir)]) + if cachedir is not None: + cmd.extend(["--cachedir", str(cachedir)]) + if datasetdir is not None: + cmd.extend(["--datasetdir", str(datasetdir)]) + if logfile is not None: + cmd.extend(["--logfile", str(logfile)]) + if max_memory is not None: + cmd.extend(["--max-memory", str(max_memory)]) + if n_jobs is not None: + cmd.extend(["--n-jobs", str(n_jobs)]) + if allow_online_downloads is not None: + cmd.extend(["--allow-online-downloads", str(allow_online_downloads)]) + + # --- Subprocess Execution --- + command_executed = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + stdout = result.stdout + stderr = result.stderr + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'scanpy' command not found. Please ensure Scanpy is installed and in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + # This command modifies a configuration file and doesn't produce + # specific output files. + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": [] + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f781be7579c5bc1c581438f2cc83bae691428d5b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/app/scanpy_server.py') +SERVER_NAME = 'biosci_scanpy' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..abb7f4fc50b3c763eea77b370df5d866e4817df4 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scanpy: + build: . + image: mcp-scanpy:latest + container_name: mcp-scanpy + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scanpy + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76416fbe28a1189f22467945ebb2174bf25e443b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scanpy + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scanpy/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c9576ce941b478d9f266f004a80e053b9a74f8a2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scar via conda (e.g., from bioconda) +RUN conda install -c bioconda scar -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scar_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scar_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scar_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_server.py new file mode 100644 index 0000000000000000000000000000000000000000..732370b58666ccb523c69eb3a03a0b0d30e4e917 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_server.py @@ -0,0 +1,212 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Dict, Any + +# The @mcp.tool decorator is assumed to be available in the environment. +# from mcp import tool + +@mcp.tool() +def scar_remove_ambient_signals( + count_matrix: List[Path], + ambient_profile: Optional[Path] = None, + feature_type: Optional[str] = None, + output: Optional[Path] = None, + count_model: Optional[str] = None, + sparsity: Optional[float] = None, + batchkey: Optional[str] = None, + cachecapacity: Optional[int] = None, + get_native_frequencies: bool = False, + hidden_layer1: Optional[int] = None, + hidden_layer2: Optional[int] = None, + latent_dim: Optional[int] = None, + epochs: Optional[int] = None, + device: Optional[str] = None, + save_model: bool = False, + batchsize: Optional[int] = None, + batchsize_infer: Optional[int] = None, + adjust: str = "micro", + cutoff: Optional[float] = None, + round2int: bool = False, + clip_to_obs: bool = False, + moi: Optional[float] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + scAR (single-cell Ambient Remover) is a deep learning model for removal of ambient signals + in droplet-based single cell omics data. + + This tool processes raw count matrices to estimate and remove ambient RNA contamination, + providing a more accurate representation of native gene expression. + """ + # --- Input Validation --- + + # Validate count_matrix paths + if not count_matrix: + raise ValueError("At least one count_matrix file must be provided.") + for matrix_path in count_matrix: + if not isinstance(matrix_path, Path): + raise TypeError(f"Count matrix path must be a Path object, got {type(matrix_path)}") + if not matrix_path.is_file(): + raise FileNotFoundError(f"Count matrix file not found: {matrix_path}") + + # Validate ambient_profile path + if ambient_profile: + if not isinstance(ambient_profile, Path): + raise TypeError(f"Ambient profile path must be a Path object, got {type(ambient_profile)}") + if not ambient_profile.is_file(): + raise FileNotFoundError(f"Ambient profile file not found: {ambient_profile}") + + # Determine output directory and create it if necessary + output_dir: Path = output if output else Path.cwd() + if not isinstance(output_dir, Path): + raise TypeError(f"Output path must be a Path object, got {type(output_dir)}") + output_dir.mkdir(parents=True, exist_ok=True) + + # Validate sparsity + if sparsity is not None: + if not isinstance(sparsity, (int, float)): + raise TypeError(f"Sparsity must be a float, got {type(sparsity)}") + if sparsity <= 0: + raise ValueError("Sparsity must be a positive float.") + + # Validate cachecapacity + if cachecapacity is not None: + if not isinstance(cachecapacity, int): + raise TypeError(f"Cache capacity must be an integer, got {type(cachecapacity)}") + if cachecapacity < 0: + raise ValueError("Cache capacity must be a non-negative integer.") + + # Validate hidden_layer1, hidden_layer2, latent_dim, epochs, batchsize, batchsize_infer + for param_name, param_value in [ + ("hidden_layer1", hidden_layer1), + ("hidden_layer2", hidden_layer2), + ("latent_dim", latent_dim), + ("epochs", epochs), + ("batchsize", batchsize), + ("batchsize_infer", batchsize_infer), + ]: + if param_value is not None: + if not isinstance(param_value, int): + raise TypeError(f"{param_name} must be an integer, got {type(param_value)}") + if param_value <= 0: + raise ValueError(f"{param_name} must be a positive integer.") + + # Validate device + if device is not None: + if not isinstance(device, str): + raise TypeError(f"Device must be a string, got {type(device)}") + if device not in ["auto", "cpu", "cuda"]: + raise ValueError(f"Device must be 'auto', 'cpu', or 'cuda', but got '{device}'.") + + # Validate adjust + if not isinstance(adjust, str): + raise TypeError(f"Adjust must be a string, got {type(adjust)}") + if adjust not in ["micro", "global", "False"]: + raise ValueError(f"Adjust must be 'micro', 'global', or 'False', but got '{adjust}'.") + + # Validate cutoff + if cutoff is not None: + if not isinstance(cutoff, (int, float)): + raise TypeError(f"Cutoff must be a float, got {type(cutoff)}") + if cutoff <= 0: + raise ValueError("Cutoff must be a positive float.") + + # Validate moi + if moi is not None: + if not isinstance(moi, (int, float)): + raise TypeError(f"Multiplicity of Infection (moi) must be a float, got {type(moi)}") + if moi <= 0: + raise ValueError("Multiplicity of Infection (moi) must be a positive float.") + + # --- Construct Command --- + command = ["scar"] + + # Positional arguments + for matrix_path in count_matrix: + command.append(str(matrix_path)) + + # Optional arguments + if ambient_profile: + command.extend(["-ap", str(ambient_profile)]) + if feature_type: + command.extend(["-ft", feature_type]) + if output: # Only add -o if the user explicitly provided an output path + command.extend(["-o", str(output_dir)]) + if count_model: + command.extend(["-m", count_model]) + if sparsity is not None: + command.extend(["-sp", str(sparsity)]) + if batchkey: + command.extend(["-bk", batchkey]) + if cachecapacity is not None: + command.extend(["-cache", str(cachecapacity)]) + command.extend(["-gnf", "1" if get_native_frequencies else "0"]) + if hidden_layer1 is not None: + command.extend(["-hl1", str(hidden_layer1)]) + if hidden_layer2 is not None: + command.extend(["-hl2", str(hidden_layer2)]) + if latent_dim is not None: + command.extend(["-ls", str(latent_dim)]) + if epochs is not None: + command.extend(["-epo", str(epochs)]) + if device: + command.extend(["-d", device]) + command.extend(["-s", "1" if save_model else "0"]) # Interpreting -s as a boolean flag (0 or 1) + if batchsize is not None: + command.extend(["-batchsize", str(batchsize)]) + if batchsize_infer is not None: + command.extend(["-batchsize_infer", str(batchsize_infer)]) + command.extend(["-adjust", adjust]) + if cutoff is not None: + command.extend(["-cutoff", str(cutoff)]) + command.extend(["-round2int", "1" if round2int else "0"]) + command.extend(["-clip_to_obs", "1" if clip_to_obs else "0"]) + if moi is not None: + command.extend(["-moi", str(moi)]) + command.extend(["-verbose", "1" if verbose else "0"]) + + # --- Execute Subprocess --- + try: + process = subprocess.run( + command, + check=True, + capture_output=True, + text=True, + cwd=output_dir # Run in the output directory to capture files generated there + ) + stdout = process.stdout + stderr = process.stderr + command_executed = " ".join(command) + + # --- Collect Output Files --- + # scAR typically outputs files like 'native_counts.h5ad', 'scar_model.pt', etc. + # The exact names are not in the help, but they would be in the output_dir. + # We return all files found in the designated output directory. + output_files = [str(p) for p in output_dir.iterdir() if p.is_file()] + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + "output_directory": str(output_dir) # Explicitly return the output directory path + } + + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(command), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"scAR command failed with exit code {e.returncode}", + "returncode": e.returncode, + "output_files": [], + } + except FileNotFoundError: + return { + "command_executed": " ".join(command), + "stdout": "", + "stderr": "Error: 'scar' command not found. Is scAR installed and in your PATH?", + "error": "scAR executable not found.", + "returncode": 127, # Common exit code for command not found + "output_files": [], + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..492e4edcf97144c875558df494b59a312361e308 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/app/scar_server.py') +SERVER_NAME = 'biosci_scar' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..cb2ab7ce9badba1f896d72b513c525111b647fa0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scar: + build: . + image: mcp-scar:latest + container_name: mcp-scar + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scar + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..62da5be6ab92cc7a7c0b201d2ef09d15d5c2f2f8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scar + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scar/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d67440809be85f6d1dfadf357bbed328e43b193d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scarches via conda (e.g., from bioconda) +RUN conda install -c bioconda scarches -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scarches_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scarches_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scarches_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_server.py new file mode 100644 index 0000000000000000000000000000000000000000..9432554de05dc27efb94d65dd298a412917dd6b7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_server.py @@ -0,0 +1,353 @@ +import subprocess +import logging +from pathlib import Path +from typing import List, Dict, Any, Optional + +# Configure logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +# MCP decorator is not defined here, but the functions are structured +# as if it were present (e.g., @mcp.tool()). + +def _run_scarches_command(cmd: List[str], output_path: Path) -> Dict[str, Any]: + """ + A helper function to execute scarches commands, handle errors, and + return a structured output. + """ + command_str = " ".join(cmd) + logger.info(f"Executing command: {command_str}") + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(output_path)] if output_path.exists() else [], + } + except FileNotFoundError: + logger.error("Error: 'python' executable not found. Make sure Python is in your PATH.") + raise + except subprocess.CalledProcessError as e: + logger.error(f"Command failed with exit code {e.returncode}") + logger.error(f"Stdout: {e.stdout}") + logger.error(f"Stderr: {e.stderr}") + raise e + +# @mcp.tool() +def train_scvi( + adata_path: Path, + model_path: Path, + gpus: str = "0", + n_epochs: int = 400, + learning_rate: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Trains a scVI model using the scarches command-line interface. + + Args: + adata_path: Path to anndata object with raw counts. + model_path: Path where the trained model will be saved. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs: Number of epochs for training. + learning_rate: Learning rate for training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input anndata file not found: {adata_path}") + if not model_path.parent.exists(): + model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {model_path.parent}") + if n_epochs <= 0: + raise ValueError("n_epochs must be a positive integer.") + if batch_size <= 0: + raise ValueError("batch_size must be a positive integer.") + + cmd = [ + "python", "-m", "scarches", "train-scvi", + str(adata_path), + str(model_path), + "--gpus", gpus, + "--n_epochs", str(n_epochs), + "--learning_rate", str(learning_rate), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, model_path) + +# @mcp.tool() +def train_scanvi( + adata_path: Path, + model_path: Path, + labels_key: str, + unlabeled_category: str, + gpus: str = "0", + n_epochs_unsupervised: int = 400, + n_epochs_semisupervised: int = 400, + lr_unsupervised: float = 1e-3, + lr_semisupervised: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Trains a scANVI model using the scarches command-line interface. + + Args: + adata_path: Path to anndata object with raw counts. + model_path: Path where the trained model will be saved. + labels_key: Key in adata.obs for cell type labels. + unlabeled_category: Value in adata.obs[labels_key] for unlabeled cells. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs_unsupervised: Number of epochs for unsupervised training. + n_epochs_semisupervised: Number of epochs for semi-supervised training. + lr_unsupervised: Learning rate for unsupervised training. + lr_semisupervised: Learning rate for semi-supervised training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input anndata file not found: {adata_path}") + if not model_path.parent.exists(): + model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {model_path.parent}") + + cmd = [ + "python", "-m", "scarches", "train-scanvi", + str(adata_path), + str(model_path), + "--labels_key", labels_key, + "--unlabeled_category", unlabeled_category, + "--gpus", gpus, + "--n_epochs_unsupervised", str(n_epochs_unsupervised), + "--n_epochs_semisupervised", str(n_epochs_semisupervised), + "--lr_unsupervised", str(lr_unsupervised), + "--lr_semisupervised", str(lr_semisupervised), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, model_path) + +# @mcp.tool() +def train_trvae( + adata_path: Path, + model_path: Path, + condition_key: str, + gpus: str = "0", + n_epochs: int = 400, + learning_rate: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Trains a trVAE model using the scarches command-line interface. + + Args: + adata_path: Path to anndata object with raw counts. + model_path: Path where the trained model will be saved. + condition_key: Key in adata.obs for batch information. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs: Number of epochs for training. + learning_rate: Learning rate for training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input anndata file not found: {adata_path}") + if not model_path.parent.exists(): + model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {model_path.parent}") + + cmd = [ + "python", "-m", "scarches", "train-trvae", + str(adata_path), + str(model_path), + "--condition_key", condition_key, + "--gpus", gpus, + "--n_epochs", str(n_epochs), + "--learning_rate", str(learning_rate), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, model_path) + +# @mcp.tool() +def query_scvi( + adata_path: Path, + ref_model_path: Path, + new_model_path: Path, + gpus: str = "0", + n_epochs: int = 200, + learning_rate: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Maps a query dataset to a reference scVI model. + + Args: + adata_path: Path to query anndata object with raw counts. + ref_model_path: Path to the reference model. + new_model_path: Path where the updated query model will be saved. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs: Number of epochs for training. + learning_rate: Learning rate for training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input query anndata file not found: {adata_path}") + if not ref_model_path.is_dir(): + raise FileNotFoundError(f"Reference model directory not found: {ref_model_path}") + if not new_model_path.parent.exists(): + new_model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {new_model_path.parent}") + + cmd = [ + "python", "-m", "scarches", "query-scvi", + str(adata_path), + str(ref_model_path), + str(new_model_path), + "--gpus", gpus, + "--n_epochs", str(n_epochs), + "--learning_rate", str(learning_rate), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, new_model_path) + +# @mcp.tool() +def query_scanvi( + adata_path: Path, + ref_model_path: Path, + new_model_path: Path, + gpus: str = "0", + n_epochs_unsupervised: int = 200, + n_epochs_semisupervised: int = 100, + lr_unsupervised: float = 1e-3, + lr_semisupervised: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Maps a query dataset to a reference scANVI model. + + Args: + adata_path: Path to query anndata object with raw counts. + ref_model_path: Path to the reference model. + new_model_path: Path where the updated query model will be saved. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs_unsupervised: Number of epochs for unsupervised training. + n_epochs_semisupervised: Number of epochs for semi-supervised training. + lr_unsupervised: Learning rate for unsupervised training. + lr_semisupervised: Learning rate for semi-supervised training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input query anndata file not found: {adata_path}") + if not ref_model_path.is_dir(): + raise FileNotFoundError(f"Reference model directory not found: {ref_model_path}") + if not new_model_path.parent.exists(): + new_model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {new_model_path.parent}") + + cmd = [ + "python", "-m", "scarches", "query-scanvi", + str(adata_path), + str(ref_model_path), + str(new_model_path), + "--gpus", gpus, + "--n_epochs_unsupervised", str(n_epochs_unsupervised), + "--n_epochs_semisupervised", str(n_epochs_semisupervised), + "--lr_unsupervised", str(lr_unsupervised), + "--lr_semisupervised", str(lr_semisupervised), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, new_model_path) + +# @mcp.tool() +def query_trvae( + adata_path: Path, + ref_model_path: Path, + new_model_path: Path, + condition_key: str, + gpus: str = "0", + n_epochs: int = 200, + learning_rate: float = 1e-3, + batch_size: int = 128, + early_stopping: bool = False, +) -> Dict[str, Any]: + """ + Maps a query dataset to a reference trVAE model. + + Args: + adata_path: Path to query anndata object with raw counts. + ref_model_path: Path to the reference model. + new_model_path: Path where the updated query model will be saved. + condition_key: Key in adata.obs for batch information. + gpus: String specifying which GPUs to use (e.g., '0,1'). + n_epochs: Number of epochs for training. + learning_rate: Learning rate for training. + batch_size: Batch size for training. + early_stopping: If True, enables early stopping. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output file path. + """ + if not adata_path.is_file(): + raise FileNotFoundError(f"Input query anndata file not found: {adata_path}") + if not ref_model_path.is_dir(): + raise FileNotFoundError(f"Reference model directory not found: {ref_model_path}") + if not new_model_path.parent.exists(): + new_model_path.parent.mkdir(parents=True, exist_ok=True) + logger.info(f"Created output directory: {new_model_path.parent}") + + cmd = [ + "python", "-m", "scarches", "query-trvae", + str(adata_path), + str(ref_model_path), + str(new_model_path), + "--condition_key", condition_key, + "--gpus", gpus, + "--n_epochs", str(n_epochs), + "--learning_rate", str(learning_rate), + "--batch_size", str(batch_size), + ] + if early_stopping: + cmd.append("--early_stopping") + + return _run_scarches_command(cmd, new_model_path) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..15c24506b610f5f7a23c7e5cbef9cad99cc59586 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/app/scarches_server.py') +SERVER_NAME = 'biosci_scarches' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..36515829bd5c93102752c1a043532a508bcab763 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scarches: + build: . + image: mcp-scarches:latest + container_name: mcp-scarches + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scarches + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7ae141f0d6db963f6b50ae1249b206c468ca6d98 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scarches + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scarches/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..951b1c9c12b9a51375afc80056f842c8211e1a93 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install sccaf via conda (e.g., from bioconda) +RUN conda install -c bioconda sccaf -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY sccaf_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/sccaf_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/sccaf_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_server.py new file mode 100644 index 0000000000000000000000000000000000000000..2f94928d2f15dd4fd616951b38021a43b761ab0d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_server.py @@ -0,0 +1,180 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +# MCP decorator placeholder. In a real MCP environment, this would be imported. +class mcp: + @staticmethod + def tool(func): + return func + +@mcp.tool +def sccaf( + input_adata: Path, + output_adata: Path, + self_project: bool = False, + min_acc: float = 0.9, + prefix: str = 'sccaf', + n_jobs: int = 1, + use_rep: str = 'X_pca', + n_features: int = 2000, + n_components: int = 50, + resolution: float = 0.2, + k: int = 15, + reference: Optional[Path] = None, + reference_leiden: str = 'leiden', + reference_cell_type: str = 'cell_type', + reference_embedding: str = 'X_umap', + reference_n_jobs: int = 1, + reference_n_features: int = 2000, + reference_n_components: int = 50, + reference_resolution: float = 0.2, + reference_k: int = 15, + log_file: Optional[Path] = None, + verbose: int = 1, +) -> Dict[str, Any]: + """ + Runs SCCAF (Single-Cell Clustering Assessment Framework) for clustering and cell type identification. + + SCCAF is a tool for automated cell type identification and clustering refinement based on the + self-projection of a dataset. It can also project a query dataset onto a reference. + + Args: + input_adata: Path to the input AnnData object (.h5ad). + output_adata: Path where the output AnnData object (.h5ad) will be saved. + self_project: If True, run in self-projection mode. + min_acc: Minimum accuracy for self-projection. + prefix: Prefix for the column names for the results in the output AnnData. + n_jobs: Number of jobs to run in parallel. + use_rep: The key in `.obsm` for the embedding to use (e.g., 'X_pca'). + n_features: Number of features to use. + n_components: Number of components to use. + resolution: Resolution for Louvain clustering. + k: Number of nearest neighbors. + reference: Path to the reference AnnData object for projection. + reference_leiden: The key in `.obs` for the reference leiden clusters. + reference_cell_type: The key in `.obs` for the reference cell type annotations. + reference_embedding: The key in `.obsm` for the reference embedding. + reference_n_jobs: Number of jobs to run in parallel for the reference analysis. + reference_n_features: Number of features to use for the reference. + reference_n_components: Number of components to use for the reference. + reference_resolution: Resolution for Louvain for the reference. + reference_k: Number of nearest neighbors for the reference. + log_file: Optional path to a file for logging output. + verbose: Verbosity level (e.g., 0 for silent, 1 for info). + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of output files. + """ + # --- Input Validation --- + if not input_adata.is_file(): + raise FileNotFoundError(f"Input file not found: {input_adata}") + if reference and not reference.is_file(): + raise FileNotFoundError(f"Reference file not found: {reference}") + + # --- Output Directory Handling --- + output_adata.parent.mkdir(parents=True, exist_ok=True) + if log_file: + log_file.parent.mkdir(parents=True, exist_ok=True) + + # --- Parameter Value Validation --- + if not (0.0 <= min_acc <= 1.0): + raise ValueError("min_acc must be between 0.0 and 1.0") + if n_jobs <= 0: + raise ValueError("n_jobs must be a positive integer") + if n_features <= 0: + raise ValueError("n_features must be a positive integer") + if n_components <= 0: + raise ValueError("n_components must be a positive integer") + if resolution <= 0: + raise ValueError("resolution must be a positive float") + if k <= 0: + raise ValueError("k must be a positive integer") + if verbose < 0: + raise ValueError("verbose must be a non-negative integer") + + # --- Command Construction --- + cmd = [ + "sccaf", + "-i", str(input_adata), + "-o", str(output_adata), + "--min-acc", str(min_acc), + "--prefix", prefix, + "--n-jobs", str(n_jobs), + "--use-rep", use_rep, + "--n-features", str(n_features), + "--n-components", str(n_components), + "--resolution", str(resolution), + "--k", str(k), + "--verbose", str(verbose), + ] + + if self_project: + cmd.append("--self-project") + + if reference: + if reference_n_jobs <= 0: + raise ValueError("reference_n_jobs must be a positive integer") + if reference_n_features <= 0: + raise ValueError("reference_n_features must be a positive integer") + if reference_n_components <= 0: + raise ValueError("reference_n_components must be a positive integer") + if reference_resolution <= 0: + raise ValueError("reference_resolution must be a positive float") + if reference_k <= 0: + raise ValueError("reference_k must be a positive integer") + + cmd.extend([ + "--reference", str(reference), + "--reference-leiden", reference_leiden, + "--reference-cell-type", reference_cell_type, + "--reference-embedding", reference_embedding, + "--reference-n-jobs", str(reference_n_jobs), + "--reference-n-features", str(reference_n_features), + "--reference-n-components", str(reference_n_components), + "--reference-resolution", str(reference_resolution), + "--reference-k", str(reference_k), + ]) + + if log_file: + cmd.extend(["--log-file", str(log_file)]) + + command_executed = " ".join(cmd) + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + encoding='utf-8' + ) + stdout = result.stdout + stderr = result.stderr + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'sccaf' command not found. Make sure the tool is installed and in your system's PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + output_files: List[str] = [str(output_adata)] + if log_file and log_file.exists(): + output_files.append(str(log_file)) + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e4ac6aa9a1b5e2877318bfbb31bdd605850682e9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/app/sccaf_server.py') +SERVER_NAME = 'biosci_sccaf' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..6068a48b1fd1b217fd92ff7a691d6ed4a3c02d61 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-sccaf: + build: . + image: mcp-sccaf:latest + container_name: mcp-sccaf + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=sccaf + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..629ed66308b69d792273a7db85a5e52aac46a7a6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - sccaf + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_sccaf/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..63b22ab3f3f20c6d172ef8628da393ad8ff3135b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scelvis via conda (e.g., from bioconda) +RUN conda install -c bioconda scelvis -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scelvis_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scelvis_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scelvis_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_server.py new file mode 100644 index 0000000000000000000000000000000000000000..33ee94520c387b383078714d5d22836b9c9febad --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_server.py @@ -0,0 +1,381 @@ +import logging +import subprocess +from pathlib import Path +from typing import Any, Dict, Optional + +# The @mcp.tool decorator is injected by the MCP server runtime. +# It is not necessary to import it in this file. + +# --- Module-level Documentation --- +# This module provides MCP tool definitions for the `scelvis` bioinformatics tool. +# `scelvis` is a tool for single-cell visualization. This wrapper focuses on the +# `scelvis convert` functionality, which prepares data from various single-cell +# analysis pipelines for visualization in SCelVis. +# +# The `scelvis run` subcommand, which starts a web server, is intentionally +# not implemented as an MCP tool. MCP tools are designed for finite, batch-style +# computational tasks, whereas `scelvis run` initiates a long-running service, +# which is an anti-pattern for the MCP execution model. + +# --- Private Helper Function --- +# This helper function is not an MCP tool itself but is used by the tools below +# to reduce code duplication and ensure consistent command execution and error handling. + +def _run_scelvis_convert( + converter_name: str, + input_path: Path, + output_dir: Path, + genome: Optional[str], + chemistry: Optional[str], + verbose: bool, + is_file: bool = False, +) -> Dict[str, Any]: + """ + A private helper to construct and execute `scelvis convert` commands. + + Args: + converter_name: The specific converter to use (e.g., '10x-cellranger'). + input_path: The path to the input file or directory. + output_dir: The path to the output directory. + genome: The genome build to use. + chemistry: The chemistry to use. + verbose: If True, increases verbosity. + is_file: If True, the input_path is a file (`--input-file`), otherwise a directory (`--input-dir`). + + Returns: + A dictionary containing the execution results. + """ + # --- Input Validation --- + if not input_path.exists(): + raise FileNotFoundError(f"Input path does not exist: {input_path}") + if is_file and not input_path.is_file(): + raise ValueError(f"Input path must be a file: {input_path}") + if not is_file and not input_path.is_dir(): + raise ValueError(f"Input path must be a directory: {input_path}") + + # --- File Path Handling --- + output_dir.mkdir(parents=True, exist_ok=True) + + # --- Command Construction --- + command = ["scelvis", "convert", converter_name] + + input_arg = "--input-file" if is_file else "--input-dir" + command.extend([input_arg, str(input_path)]) + + command.extend(["--output-dir", str(output_dir)]) + + if genome: + command.extend(["--genome", genome]) + if chemistry: + command.extend(["--chemistry", chemistry]) + if verbose: + command.append("--verbose") + + command_str = " ".join(command) + logging.info(f"Executing command: {command_str}") + + # --- Subprocess Execution and Error Handling --- + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=True, + ) + + output_files = [str(p) for p in output_dir.rglob('*') if p.is_file()] + + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + error_message = "scelvis not found. Please ensure it is installed and in your system's PATH." + logging.error(error_message) + raise RuntimeError(error_message) + except subprocess.CalledProcessError as e: + logging.error(f"Command failed with exit code {e.returncode}") + logging.error(f"Stderr: {e.stderr}") + logging.error(f"Stdout: {e.stdout}") + # Return structured error information + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Command failed with exit code {e.returncode}", + "output_files": [], + } + +# --- MCP Tool Definitions --- + +@mcp.tool() +def scelvis_convert_10x_cellranger( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts 10x CellRanger HDF5 data to SCelVis input format. + + This tool wraps the 'scelvis convert 10x-cellranger' command. + + Args: + input_dir: Path to the input directory with CellRanger HDF5 files. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="10x-cellranger", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_alevin( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts alevin data to SCelVis input format. + + This tool wraps the 'scelvis convert alevin' command. + + Args: + input_dir: Path to the input directory with alevin output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="alevin", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_alevin_fry( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts alevin-fry data to SCelVis input format. + + This tool wraps the 'scelvis convert alevin-fry' command. + + Args: + input_dir: Path to the input directory with alevin-fry output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="alevin-fry", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_cellranger_vdj( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts 10x CellRanger VDJ data to SCelVis input format. + + This tool wraps the 'scelvis convert cellranger-vdj' command. + + Args: + input_dir: Path to the input directory with CellRanger VDJ output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="cellranger-vdj", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_cumulus( + input_file: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts Cumulus Zarr data to SCelVis input format. + + This tool wraps the 'scelvis convert cumulus' command. + + Args: + input_file: Path to the input Cumulus Zarr file. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="cumulus", + input_path=input_file, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=True, + ) + +@mcp.tool() +def scelvis_convert_kallisto_bustools( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts kallisto/bustools data to SCelVis input format. + + This tool wraps the 'scelvis convert kallisto-bustools' command. + + Args: + input_dir: Path to the input directory with kallisto/bustools output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="kallisto-bustools", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_optimus( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts Optimus data to SCelVis input format. + + This tool wraps the 'scelvis convert optimus' command. + + Args: + input_dir: Path to the input directory with Optimus output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="optimus", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_salmon_alevin( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts salmon-alevin data to SCelVis input format. + + This tool wraps the 'scelvis convert salmon-alevin' command. + + Args: + input_dir: Path to the input directory with salmon-alevin output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="salmon-alevin", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) + +@mcp.tool() +def scelvis_convert_starsolo( + input_dir: Path, + output_dir: Path, + genome: Optional[str] = None, + chemistry: Optional[str] = None, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Converts STARsolo data to SCelVis input format. + + This tool wraps the 'scelvis convert starsolo' command. + + Args: + input_dir: Path to the input directory with STARsolo output. + output_dir: Path to the output directory. + genome: Optional genome build to use. + chemistry: Optional chemistry to use. + verbose: If True, increases verbosity. + """ + return _run_scelvis_convert( + converter_name="starsolo", + input_path=input_dir, + output_dir=output_dir, + genome=genome, + chemistry=chemistry, + verbose=verbose, + is_file=False, + ) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c2e5242a2aebba5e2f5baad48ae4a7f1f90c97f4 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/app/scelvis_server.py') +SERVER_NAME = 'biosci_scelvis' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..0e58282db2e2c5d812773e859352b9e7c839ec00 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scelvis: + build: . + image: mcp-scelvis:latest + container_name: mcp-scelvis + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scelvis + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e44302ca1dd1e9d1bd5005d8441b1dc0ac807e56 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scelvis + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scelvis/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3ed31694e2abff593981c9e57f7bebf381e84db6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scpred-cli via conda (e.g., from bioconda) +RUN conda install -c bioconda scpred-cli -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scpred-cli_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scpred-cli_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scpred-cli_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_server.py new file mode 100644 index 0000000000000000000000000000000000000000..357a0603d4e320a7b7abaed9e39a953d2bbfa4dc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_server.py @@ -0,0 +1,221 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List, Dict, Any + +# Configure logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +# Mock mcp.tool decorator for standalone execution +class mcp: + def tool(func): + return func + +@mcp.tool +def train( + training_data: Path, + metadata: Path, + cell_type_column: str, + output_dir: Path, + model_name: str = "scPred_model", + seed: int = 66, +) -> Dict[str, Any]: + """ + Trains a scPred cell type prediction model. + + This tool corresponds to the --train functionality of scpred-cli.R. + It takes a training dataset and corresponding metadata to build and save + a scPred model. + + Args: + training_data: Path to the input training data file in .rds format. + metadata: Path to the metadata file in .tsv format. + cell_type_column: Name of the cell type column in the metadata file. + output_dir: Path to the directory where the trained model will be saved. + model_name: Name for the trained model file (without extension). + seed: An integer seed for reproducibility. + + Returns: + A dictionary containing the execution details and output file path. + """ + # --- Input Validation --- + if not training_data.is_file(): + raise FileNotFoundError(f"Training data file not found: {training_data}") + if not metadata.is_file(): + raise FileNotFoundError(f"Metadata file not found: {metadata}") + if not cell_type_column: + raise ValueError("The 'cell_type_column' parameter cannot be empty.") + if not model_name: + raise ValueError("The 'model_name' parameter cannot be empty.") + + # --- File Path Handling --- + try: + output_dir.mkdir(parents=True, exist_ok=True) + except OSError as e: + logger.error(f"Failed to create output directory {output_dir}: {e}") + raise + + # --- Command Construction --- + # Assumes scpred-cli.R is accessible in the environment. + # The command is executed via Rscript. + cmd = [ + "Rscript", "scpred-cli.R", + "--train", + "--input", str(training_data), + "--metadata", str(metadata), + "--celltype", cell_type_column, + "--output", str(output_dir), + "--name", model_name, + "--seed", str(seed), + ] + + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + stdout = process.stdout + stderr = process.stderr + logger.info("scPred training completed successfully.") + + except FileNotFoundError: + error_message = "Error: 'Rscript' or 'scpred-cli.R' not found. Please ensure R and scpred are installed and in your system's PATH." + logger.error(error_message) + return { + "command_executed": command_executed, + "stdout": "", + "stderr": error_message, + "output_files": [], + } + except subprocess.CalledProcessError as e: + logger.error(f"scPred training failed with exit code {e.returncode}.") + logger.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [], + } + + # --- Structured Result Return --- + output_model_path = output_dir / f"{model_name}.rds" + output_files = [str(output_model_path)] if output_model_path.exists() else [] + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } + + +@mcp.tool +def predict( + model: Path, + query_data: Path, + output_dir: Path, + reference_data: Optional[Path] = None, + seed: int = 66, +) -> Dict[str, Any]: + """ + Predicts cell types for a query dataset using a pre-trained scPred model. + + This tool corresponds to the --predict functionality of scpred-cli.R. + It uses a trained model to classify cells in a new query dataset. + + Args: + model: Path to a pre-trained scPred model file (.rds format). + query_data: Path to the query dataset file (.rds format). + output_dir: Path to the directory where prediction results will be saved. + reference_data: Optional path to a reference dataset (.rds format) for alignment. + seed: An integer seed for reproducibility. + + Returns: + A dictionary containing the execution details and output file paths. + """ + # --- Input Validation --- + if not model.is_file(): + raise FileNotFoundError(f"Model file not found: {model}") + if not query_data.is_file(): + raise FileNotFoundError(f"Query data file not found: {query_data}") + if reference_data and not reference_data.is_file(): + raise FileNotFoundError(f"Reference data file not found: {reference_data}") + + # --- File Path Handling --- + try: + output_dir.mkdir(parents=True, exist_ok=True) + except OSError as e: + logger.error(f"Failed to create output directory {output_dir}: {e}") + raise + + # --- Command Construction --- + cmd = [ + "Rscript", "scpred-cli.R", + "--predict", + "--model", str(model), + "--query", str(query_data), + "--output", str(output_dir), + "--seed", str(seed), + ] + + if reference_data: + cmd.extend(["--reference", str(reference_data)]) + + command_executed = " ".join(cmd) + logger.info(f"Executing command: {command_executed}") + + # --- Subprocess Execution --- + try: + process = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + stdout = process.stdout + stderr = process.stderr + logger.info("scPred prediction completed successfully.") + + except FileNotFoundError: + error_message = "Error: 'Rscript' or 'scpred-cli.R' not found. Please ensure R and scpred are installed and in your system's PATH." + logger.error(error_message) + return { + "command_executed": command_executed, + "stdout": "", + "stderr": error_message, + "output_files": [], + } + except subprocess.CalledProcessError as e: + logger.error(f"scPred prediction failed with exit code {e.returncode}.") + logger.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [], + } + + # --- Structured Result Return --- + # Based on the scpred-cli.R script, it produces these two output files. + output_rds = output_dir / "scpred_prediction.rds" + output_tsv = output_dir / "scpred_prediction_metadata.tsv" + + output_files = [] + if output_rds.exists(): + output_files.append(str(output_rds)) + if output_tsv.exists(): + output_files.append(str(output_tsv)) + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c1e242a2a5fc99deb18e1f4cd54e36cced7fd4e7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/app/scpred-cli_server.py') +SERVER_NAME = 'biosci_scpred_cli' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..524bd3adbfe65916ad50ae4b52aa7afa514bc519 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scpred-cli: + build: . + image: mcp-scpred-cli:latest + container_name: mcp-scpred-cli + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scpred-cli + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da5eda79832d108307282c7c4a676e663f84a821 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scpred-cli + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scpred-cli/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..519679c3b53455daa5768ae7c5d743ddb5e2ea91 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install scvelo via conda (e.g., from bioconda) +RUN conda install -c bioconda scvelo -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY scvelo_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/scvelo_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/scvelo_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_server.py new file mode 100644 index 0000000000000000000000000000000000000000..228b31d3a58944d0715186518c73a011ffafb71f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_server.py @@ -0,0 +1,79 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +@mcp.tool() +def scvelo_cli_unavailable(): + """ + Reports on the unavailability of scvelo's command-line interface. + + Based on the provided documentation, `scvelo` fails to execute its command-line + interface due to a `matplotlib` incompatibility. This tool captures that + error, indicating that no subcommands or parameters can be extracted from + the CLI. + + scvelo is primarily a Python library, and its functionality is typically + accessed by importing it within Python scripts rather than through a + traditional command-line interface with subcommands. Therefore, direct + conversion of CLI subcommands is not possible with the current information. + """ + command = ["python", "-m", "scvelo", "--help"] + command_str = " ".join(command) + + try: + # Attempt to run the command. We expect it to fail based on the provided help doc. + # check=False is used to capture stderr even if the command returns a non-zero exit code. + process = subprocess.run(command, capture_output=True, text=True, check=False, encoding='utf-8') + + stdout = process.stdout + stderr = process.stderr + return_code = process.returncode + + if return_code != 0: + # This is the expected scenario based on the provided help document. + # The specific error is 'AttributeError: module 'matplotlib.cbook' has no attribute 'mplDeprecation'' + # We will include this in the stderr and a specific error message. + error_message = ( + "scvelo command-line interface failed to execute. " + "The provided help document shows a traceback indicating " + "an 'AttributeError: module 'matplotlib.cbook' has no attribute 'mplDeprecation''. " + "This suggests an incompatibility issue preventing the CLI from launching. " + "As a result, no command-line subcommands or parameters could be extracted " + "for conversion into MCP tools." + ) + return { + "command_executed": command_str, + "stdout": stdout, + "stderr": stderr, + "error": error_message, + "return_code": return_code, + "output_files": [], + } + else: + # This path should ideally not be reached if the provided help doc is accurate. + # If it does, it means the environment issue was resolved, and we would then + # need to parse the actual help output. For now, we assume the error persists. + return { + "command_executed": command_str, + "stdout": stdout, + "stderr": stderr, + "warning": "scvelo --help executed successfully, contrary to provided documentation. " + "Please update the tool definition with actual CLI commands parsed from stdout.", + "output_files": [], + } + + except FileNotFoundError: + return { + "command_executed": command_str, + "stdout": "", + "stderr": f"Error: The command '{command[0]}' (python) was not found. " + "Ensure Python is installed and accessible in your system's PATH.", + "output_files": [], + } + except Exception as e: + return { + "command_executed": command_str, + "stdout": "", + "stderr": f"An unexpected error occurred while attempting to run scvelo --help: {str(e)}", + "output_files": [], + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6b3baebf489da538ba533c15ef8a4c2a19b11e65 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/app/scvelo_server.py') +SERVER_NAME = 'biosci_scvelo' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..af258f7a7089e9a2084c00914cd3bacd27c6c51e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-scvelo: + build: . + image: mcp-scvelo:latest + container_name: mcp-scvelo + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=scvelo + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7202cbe20911b8b81b75720ed64edd732368c3eb --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - scvelo + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_scvelo/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6d43805f4926c30db68de71abf94e6c8cd9ed0f8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install seurat-scripts via conda (e.g., from bioconda) +RUN conda install -c bioconda seurat-scripts -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY seurat-scripts_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/seurat-scripts_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/seurat-scripts_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_server.py new file mode 100644 index 0000000000000000000000000000000000000000..2c6221182d6a912d7ba4af42e7318be71d38263e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_server.py @@ -0,0 +1,320 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Union +import os + +def run_command(command: List[str]): + """Helper to execute subprocess and handle errors""" + try: + result = subprocess.run(command, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(command), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(command), + "stdout": e.stdout, + "stderr": e.stderr, + "status": "error", + "error_message": str(e) + } + +@mcp.tool() +def seurat_read_10x( + data_dir: str, + output_object_file: str, + sample_name: str = "seurat_project", + min_cells: int = 3, + min_features: int = 200 +): + """ + Read 10X Genomics data and create a Seurat object. + + :param data_dir: Path to the directory containing 10X data (matrix.mtx, genes.tsv, barcodes.tsv). + :param output_object_file: Path to save the resulting Seurat object (.rds). + :param sample_name: Project name for the Seurat object. + :param min_cells: Include features detected in at least this many cells. + :param min_features: Include cells where at least this many features are detected. + """ + input_path = Path(data_dir) + if not input_path.is_dir(): + raise ValueError(f"Data directory does not exist: {data_dir}") + + cmd = [ + "seurat-read-10x.R", + "--data-dir", data_dir, + "--output-object-file", output_object_file, + "--project-name", sample_name, + "--min-cells", str(min_cells), + "--min-features", str(min_features) + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_filter_cells( + input_object_file: str, + output_object_file: str, + subset_names: str, + low_thresholds: str, + high_thresholds: str +): + """ + Filter cells based on QC metrics (e.g., nFeature_RNA, nCount_RNA, percent.mt). + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save filtered Seurat object (.rds). + :param subset_names: Comma-separated list of metadata columns to filter on (e.g., "nFeature_RNA,percent.mt"). + :param low_thresholds: Comma-separated list of lower bounds (e.g., "200,0"). + :param high_thresholds: Comma-separated list of upper bounds (e.g., "2500,5"). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-filter-cells.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--subset-names", subset_names, + "--low-thresholds", low_thresholds, + "--high-thresholds", high_thresholds + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_normalize_data( + input_object_file: str, + output_object_file: str, + normalization_method: str = "LogNormalize", + scale_factor: int = 10000 +): + """ + Normalize the gene expression data. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save normalized Seurat object (.rds). + :param normalization_method: Method for normalization (LogNormalize, CLR, or RC). + :param scale_factor: Scale factor for normalization. + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-normalize-data.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--normalization-method", normalization_method, + "--scale-factor", str(scale_factor) + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_find_variable_features( + input_object_file: str, + output_object_file: str, + selection_method: str = "vst", + n_features: int = 2000 +): + """ + Identify highly variable features for downstream analysis. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save Seurat object with variable features (.rds). + :param selection_method: Method to choose variable features (vst, mean.var.plot, or dispersion). + :param n_features: Number of features to select as variable. + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-find-variable-features.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--selection-method", selection_method, + "--n-features", str(n_features) + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_scale_data( + input_object_file: str, + output_object_file: str, + vars_to_regress: Optional[str] = None, + do_center: bool = True, + do_scale: bool = True +): + """ + Scale and center the data. Optionally regress out sources of variation. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save scaled Seurat object (.rds). + :param vars_to_regress: Comma-separated variables to regress out (e.g., "nCount_RNA,percent.mt"). + :param do_center: Whether to center the data. + :param do_scale: Whether to scale the data. + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-scale-data.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--do-center", str(do_center).upper(), + "--do-scale", str(do_scale).upper() + ] + + if vars_to_regress: + cmd.extend(["--vars-to-regress", vars_to_regress]) + + return run_command(cmd) + +@mcp.tool() +def seurat_run_pca( + input_object_file: str, + output_object_file: str, + npcs: int = 50, + features: Optional[str] = None +): + """ + Run Principal Component Analysis (PCA). + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save Seurat object with PCA (.rds). + :param npcs: Number of PCs to compute. + :param features: Comma-separated list of features to use for PCA (defaults to variable features). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-run-pca.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--npcs", str(npcs) + ] + + if features: + cmd.extend(["--features", features]) + + return run_command(cmd) + +@mcp.tool() +def seurat_find_neighbors( + input_object_file: str, + output_object_file: str, + dims: str = "1:20", + reduction: str = "pca" +): + """ + Compute the Shared Nearest Neighbor (SNN) graph. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save Seurat object with SNN graph (.rds). + :param dims: Dimensions of reduction to use as input (e.g., "1:20"). + :param reduction: Which reduction to use (e.g., "pca"). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-find-neighbors.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--dims", dims, + "--reduction", reduction + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_find_clusters( + input_object_file: str, + output_object_file: str, + resolution: float = 0.5, + algorithm: int = 1 +): + """ + Cluster cells using the Louvain or other algorithms. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save Seurat object with clusters (.rds). + :param resolution: Value of the resolution parameter (higher values = more clusters). + :param algorithm: Algorithm for modularity optimization (1 = Louvain; 2 = Louvain with multilevel refinement; 3 = SLM; 4 = Leiden). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-find-clusters.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--resolution", str(resolution), + "--algorithm", str(algorithm) + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_run_umap( + input_object_file: str, + output_object_file: str, + dims: str = "1:20", + reduction: str = "pca" +): + """ + Run Uniform Manifold Approximation and Projection (UMAP) for visualization. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_object_file: Path to save Seurat object with UMAP (.rds). + :param dims: Dimensions of reduction to use as input (e.g., "1:20"). + :param reduction: Which reduction to use (e.g., "pca"). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-run-umap.R", + "--input-object-file", input_object_file, + "--output-object-file", output_object_file, + "--dims", dims, + "--reduction", reduction + ] + + return run_command(cmd) + +@mcp.tool() +def seurat_find_markers( + input_object_file: str, + output_text_file: str, + min_pct: float = 0.1, + logfc_threshold: float = 0.25, + test_use: str = "wilcox" +): + """ + Find differentially expressed features (markers) for all clusters. + + :param input_object_file: Path to input Seurat object (.rds). + :param output_text_file: Path to save the markers table (TSV/CSV). + :param min_pct: Only test genes that are detected in a minimum fraction of cells in either of the two populations. + :param logfc_threshold: Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups. + :param test_use: Denotes which test to use (e.g., wilcox, MAST, DESeq2). + """ + if not Path(input_object_file).exists(): + raise FileNotFoundError(f"Input file not found: {input_object_file}") + + cmd = [ + "seurat-find-markers.R", + "--input-object-file", input_object_file, + "--output-text-file", output_text_file, + "--min-pct", str(min_pct), + "--logfc-threshold", str(logfc_threshold), + "--test-use", test_use + ] + + return run_command(cmd) \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..1e75fa72b5375d2ba4aa4342b44c35867fae914a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/app/seurat-scripts_server.py') +SERVER_NAME = 'biosci_seurat_scripts' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..ed75cf1ec1ee0553f9ff714d32562473577e60cf --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-seurat-scripts: + build: . + image: mcp-seurat-scripts:latest + container_name: mcp-seurat-scripts + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=seurat-scripts + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e0aaae18e5ef24136d839a0d8210e0c11560b4a0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - seurat-scripts + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_seurat-scripts/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c5594778177713c011b411fa0e4f36f33556cafb --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install snp2cell via conda (e.g., from bioconda) +RUN conda install -c bioconda snp2cell -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY snp2cell_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/snp2cell_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/snp2cell_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0c6603d50cf87050d929e771176120cf33246fec --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_server.py @@ -0,0 +1,534 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import Optional, List + +# Mock decorator for standalone execution +class mcp: + @staticmethod + def tool(func): + return func + +@mcp.tool +def create_object( + network_file: Path, + s2c_object_file: Path, + network_format: str = "sif", +) -> dict: + """ + Create an initial SNP2CELL object holding a network. + + This can be used as an input for other sub-commands. + + Args: + network_file: Path to the network file. + s2c_object_file: Path to save the SNP2CELL object. + network_format: Format of the network file. + """ + # Input validation + if not network_file.is_file(): + raise FileNotFoundError(f"Network file not found: {network_file}") + + if network_format not in ["sif", "edgelist"]: + raise ValueError(f"Invalid network format: {network_format}. Must be 'sif' or 'edgelist'.") + + # Command construction + cmd = [ + "snp2cell", + "create-object", + "--network-format", + network_format, + str(network_file), + str(s2c_object_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell create-object failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def create_gene2pos_mapping( + s2c_object_file: Path, + gene2pos_mapping_file: Path, + mart: str = "human", +) -> dict: + """ + Query pybiomart to obtain genomic locations for genes in the network + in the s2c object and save them to a csv file. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + gene2pos_mapping_file: Path to save the gene to position mapping. + mart: Which mart to use. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + + if mart not in ["human", "mouse"]: + raise ValueError(f"Invalid mart: {mart}. Must be 'human' or 'mouse'.") + + # Command construction + cmd = [ + "snp2cell", + "create-gene2pos-mapping", + "--mart", + mart, + str(s2c_object_file), + str(gene2pos_mapping_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(gene2pos_mapping_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell create-gene2pos-mapping failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def export_locations( + s2c_object_file: Path, + locations_file: Path, +) -> dict: + """ + Save the genomic locations of network nodes in the s2c object to a tsv file. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + locations_file: Path to save the locations file. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + + # Command construction + cmd = [ + "snp2cell", + "export-locations", + str(s2c_object_file), + str(locations_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(locations_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell export-locations failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def score_snp( + s2c_object_file: Path, + gwas_summary_stats_file: Path, + gene2pos_mapping_file: Path, + score_name: str = "snp_score", + chrom_col: str = "CHR", + pos_col: str = "POS", + snp_col: str = "SNP", + pval_col: str = "P", + z_col: Optional[str] = None, + or_col: Optional[str] = None, + beta_col: Optional[str] = None, + a1_col: Optional[str] = None, + a2_col: Optional[str] = None, + window_size: int = 250000, + n_permutations: int = 1000, + random_seed: int = 42, + n_jobs: int = 1, +) -> dict: + """ + Add fGWAS scores for network nodes based on GWAS summary statistics. + Then propagate the scores across the network and calculate statistics + based on random permutations. All calculated information will be saved + in the s2c object. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + gwas_summary_stats_file: Path to the GWAS summary statistics file. + gene2pos_mapping_file: Path to the gene to position mapping file. + score_name: Name of the score. + chrom_col: Name of the chromosome column. + pos_col: Name of the position column. + snp_col: Name of the SNP ID column. + pval_col: Name of the p-value column. + z_col: Name of the z-score column. + or_col: Name of the odds ratio column. + beta_col: Name of the beta column. + a1_col: Name of the A1 allele column. + a2_col: Name of the A2 allele column. + window_size: Window size for fGWAS. + n_permutations: Number of permutations for statistics. + random_seed: Random seed for permutations. + n_jobs: Number of jobs to use for parallel processing. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + if not gwas_summary_stats_file.is_file(): + raise FileNotFoundError(f"GWAS summary stats file not found: {gwas_summary_stats_file}") + if not gene2pos_mapping_file.is_file(): + raise FileNotFoundError(f"Gene to position mapping file not found: {gene2pos_mapping_file}") + + # Command construction + cmd = [ + "snp2cell", "score-snp", + "--score-name", score_name, + "--chrom-col", chrom_col, + "--pos-col", pos_col, + "--snp-col", snp_col, + "--pval-col", pval_col, + "--window-size", str(window_size), + "--n-permutations", str(n_permutations), + "--random-seed", str(random_seed), + "--n-jobs", str(n_jobs), + ] + if z_col: + cmd.extend(["--z-col", z_col]) + if or_col: + cmd.extend(["--or-col", or_col]) + if beta_col: + cmd.extend(["--beta-col", beta_col]) + if a1_col: + cmd.extend(["--a1-col", a1_col]) + if a2_col: + cmd.extend(["--a2-col", a2_col]) + + cmd.extend([ + str(s2c_object_file), + str(gwas_summary_stats_file), + str(gene2pos_mapping_file), + ]) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell score-snp failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def add_score( + s2c_object_file: Path, + scores_file: Path, + score_name: str = "score", + n_permutations: int = 1000, + random_seed: int = 42, + n_jobs: int = 1, +) -> dict: + """ + Add scores for network nodes to the s2c object and propagate the scores + across the network. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + scores_file: Path to the scores file. + score_name: Name of the score. + n_permutations: Number of permutations for statistics. + random_seed: Random seed for permutations. + n_jobs: Number of jobs to use for parallel processing. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + if not scores_file.is_file(): + raise FileNotFoundError(f"Scores file not found: {scores_file}") + + # Command construction + cmd = [ + "snp2cell", "add-score", + "--score-name", score_name, + "--n-permutations", str(n_permutations), + "--random-seed", str(random_seed), + "--n-jobs", str(n_jobs), + str(s2c_object_file), + str(scores_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell add-score failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def contrast_scores( + s2c_object_file: Path, + score_name1: str, + score_name2: str, + new_score_name: str = "contrast_score", + n_permutations: int = 1000, + random_seed: int = 42, + n_jobs: int = 1, +) -> dict: + """ + Add a new score that is a contrast of two scores, propagate it across + the network and calculate statistics based on random permutations. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + score_name1: Name of the first score. + score_name2: Name of the second score. + new_score_name: Name of the new score. + n_permutations: Number of permutations for statistics. + random_seed: Random seed for permutations. + n_jobs: Number of jobs to use for parallel processing. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + + # Command construction + cmd = [ + "snp2cell", "contrast-scores", + "--score-name1", score_name1, + "--score-name2", score_name2, + "--new-score-name", new_score_name, + "--n-permutations", str(n_permutations), + "--random-seed", str(random_seed), + "--n-jobs", str(n_jobs), + str(s2c_object_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell contrast-scores failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def score_de( + s2c_object_file: Path, + anndata_file: Path, + obs_column: str, + group1: str, + group2: str, + de_score_name: str = "de_score", + snp_score_name: str = "snp_score", + combined_score_name: str = "combined_score", + n_permutations: int = 1000, + random_seed: int = 42, + n_jobs: int = 1, +) -> dict: + """ + Add an anndata object, find differentially expressed genes, propagate + scores, combine with SNP scores, and compute statistics. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + anndata_file: Path to the anndata object file. + obs_column: Name of the column in obs to group by. + group1: Name of the first group. + group2: Name of the second group. + de_score_name: Name of the DE score. + snp_score_name: Name of the SNP score. + combined_score_name: Name of the combined score. + n_permutations: Number of permutations for statistics. + random_seed: Random seed for permutations. + n_jobs: Number of jobs to use for parallel processing. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + if not anndata_file.is_file(): + raise FileNotFoundError(f"AnnData file not found: {anndata_file}") + + # Command construction + cmd = [ + "snp2cell", "score-de", + "--obs-column", obs_column, + "--group1", group1, + "--group2", group2, + "--de-score-name", de_score_name, + "--snp-score-name", snp_score_name, + "--combined-score-name", combined_score_name, + "--n-permutations", str(n_permutations), + "--random-seed", str(random_seed), + "--n-jobs", str(n_jobs), + str(s2c_object_file), + str(anndata_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell score-de failed with exit code {e.returncode}", + "output_files": [], + } + +@mcp.tool +def combine_scores( + s2c_object_file: Path, + snp_score_name: str = "snp_score", + de_score_name: str = "de_score", + combined_score_name: str = "combined_score", + n_permutations: int = 1000, + random_seed: int = 42, + n_jobs: int = 1, +) -> dict: + """ + Combine existing SNP and DE scores in the s2c object and compute statistics. + + Args: + s2c_object_file: Path to the SNP2CELL object file. + snp_score_name: Name of the SNP score. + de_score_name: Name of the DE score. + combined_score_name: Name of the combined score. + n_permutations: Number of permutations for statistics. + random_seed: Random seed for permutations. + n_jobs: Number of jobs to use for parallel processing. + """ + # Input validation + if not s2c_object_file.is_file(): + raise FileNotFoundError(f"SNP2CELL object file not found: {s2c_object_file}") + + # Command construction + cmd = [ + "snp2cell", "combine-scores", + "--snp-score-name", snp_score_name, + "--de-score-name", de_score_name, + "--combined-score-name", combined_score_name, + "--n-permutations", str(n_permutations), + "--random-seed", str(random_seed), + "--n-jobs", str(n_jobs), + str(s2c_object_file), + ] + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(s2c_object_file)], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"snp2cell combine-scores failed with exit code {e.returncode}", + "output_files": [], + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..efbbd066991c98f72b3af10515cf1e9b8e2674fe --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/app/snp2cell_server.py') +SERVER_NAME = 'biosci_snp2cell' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..1936c8bd0f809510927c8cf2341fb0bf93faf468 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-snp2cell: + build: . + image: mcp-snp2cell:latest + container_name: mcp-snp2cell + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=snp2cell + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6555b3e60bede732ccb6a586e83bca8068584bbd --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - snp2cell + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_help_txt/mcp_snp2cell/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.json b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.json new file mode 100644 index 0000000000000000000000000000000000000000..76fe9fa1eb060089a5166b36f7c042f88be9c333 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.json @@ -0,0 +1,1775 @@ +[ + { + "tool_name": "anansescanpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/anansescanpy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "aria2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/aria2.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bcbio-nextgen", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bcbio-nextgen.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bcbio-nextgen/app/bcbio-nextgen_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bin2cell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bin2cell.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bin2cell/app/bin2cell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconda-repodata-patches", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconda-repodata-patches.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconda-repodata-patches/app/bioconda-repodata-patches_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster/app/bioconductor-alabaster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster.sfe", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.sfe.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster.sfe/app/bioconductor-alabaster.sfe_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster.spatial", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.spatial.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster.spatial/app/bioconductor-alabaster.spatial_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-apl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-apl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-apl/app/bioconductor-apl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-benchdamic", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-benchdamic.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-benchdamic/app/bioconductor-benchdamic_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-blase", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-blase.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-blase/app/bioconductor-blase_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-bulksignalr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-bulksignalr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-bulksignalr/app/bioconductor-bulksignalr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cardspa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cardspa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cardspa/app/bioconductor-cardspa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-catscradle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-catscradle.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-cdi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cdi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cdi/app/bioconductor-cdi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellhashr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellhashr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellhashr/app/bioconductor-cellhashr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellid", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellid.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellid/app/bioconductor-cellid_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellmigration", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellmigration.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellmigration/app/bioconductor-cellmigration_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-clusterfoldsimilarity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-clusterfoldsimilarity.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-concordexr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-concordexr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-concordexr/app/bioconductor-concordexr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cotan", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cotan.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cotan/app/bioconductor-cotan_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-csoa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-csoa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-csoa/app/bioconductor-csoa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ctsv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ctsv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ctsv/app/bioconductor-ctsv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-curatedatlasqueryr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-curatedatlasqueryr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-curatedatlasqueryr/app/bioconductor-curatedatlasqueryr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-decontx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-decontx.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-decontx/app/bioconductor-decontx_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-deconvobuddies", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-deconvobuddies.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-deconvobuddies/app/bioconductor-deconvobuddies_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-despace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-despace.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-despace/app/bioconductor-despace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dino", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dino.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dino/app/bioconductor-dino_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-escher", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-escher.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-escher/app/bioconductor-escher_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-experimentsubset", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-experimentsubset.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-experimentsubset/app/bioconductor-experimentsubset_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-geomxtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-geomxtools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-geomxtools/app/bioconductor-geomxtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ggsc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ggsc.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ggsc/app/bioconductor-ggsc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ggspavis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ggspavis.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ggspavis/app/bioconductor-ggspavis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-hcatonsildata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-hcatonsildata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-hcatonsildata/app/bioconductor-hcatonsildata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-hoodscanr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-hoodscanr.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-imcdatasets", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-imcdatasets.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-imcdatasets/app/bioconductor-imcdatasets_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-imcrtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-imcrtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-imcrtools/app/bioconductor-imcrtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-irisfgm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-irisfgm.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-irisfgm/app/bioconductor-irisfgm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-lisaclust", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-lisaclust.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-lisaclust/app/bioconductor-lisaclust_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mastr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mastr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mastr/app/bioconductor-mastr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-merfishdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-merfishdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-merfishdata/app/bioconductor-merfishdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-moleculeexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-moleculeexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-moleculeexperiment/app/bioconductor-moleculeexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mousegastrulationdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mousegastrulationdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mousegastrulationdata/app/bioconductor-mousegastrulationdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-nnsvg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-nnsvg.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-nnsvg/app/bioconductor-nnsvg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-partcnv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-partcnv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-partcnv/app/bioconductor-partcnv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-pipecomp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-pipecomp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-pipecomp/app/bioconductor-pipecomp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-reactomegsa.data", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-reactomegsa.data.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-reactomegsa.data/app/bioconductor-reactomegsa.data_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-regionalst", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-regionalst.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-regionalst/app/bioconductor-regionalst_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scalign", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scalign.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scalign/app/bioconductor-scalign_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scannotatr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scannotatr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scannotatr/app/bioconductor-scannotatr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scarray.sat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scarray.sat.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scarray.sat/app/bioconductor-scarray.sat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scbubbletree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scbubbletree.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scbubbletree/app/bioconductor-scbubbletree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scclassifr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scclassifr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scclassifr/app/bioconductor-scclassifr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scdotplot", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scdotplot.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scdotplot/app/bioconductor-scdotplot_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scfeatures", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scfeatures.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scfeatures/app/bioconductor-scfeatures_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scider", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scider.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scider/app/bioconductor-scider_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scqtltools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scqtltools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scqtltools/app/bioconductor-scqtltools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scrnaseqapp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scrnaseqapp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scrnaseqapp/app/bioconductor-scrnaseqapp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sctreeviz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sctreeviz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-sctreeviz/app/bioconductor-sctreeviz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scvir", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scvir.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scvir/app/bioconductor-scvir_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-seraster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-seraster.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-seraster/app/bioconductor-seraster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-signifinder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-signifinder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-signifinder/app/bioconductor-signifinder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-singlecelltk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-singlecelltk.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-smoppix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-smoppix.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-smoppix/app/bioconductor-smoppix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sosta", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sosta.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-spacetrooper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spacetrooper.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spacetrooper/app/bioconductor-spacetrooper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spanorm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spanorm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spanorm/app/bioconductor-spanorm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spari", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spari.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spari/app/bioconductor-spari_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spasim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spasim.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spasim/app/bioconductor-spasim_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialdatasets", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialdatasets.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialdatasets/app/bioconductor-spatialdatasets_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialde", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialde.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialde/app/bioconductor-spatialde_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialdmelxsim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialdmelxsim.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialdmelxsim/app/bioconductor-spatialdmelxsim_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialfeatureexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialfeatureexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialfeatureexperiment/app/bioconductor-spatialfeatureexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatiallibd", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatiallibd.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatiallibd/app/bioconductor-spatiallibd_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialomicsoverlay", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialomicsoverlay.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialomicsoverlay/app/bioconductor-spatialomicsoverlay_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialsimgp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialsimgp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialsimgp/app/bioconductor-spatialsimgp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-speckle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-speckle.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-spiat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spiat.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spiat/app/bioconductor-spiat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spicyr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spicyr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spicyr/app/bioconductor-spicyr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spoon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spoon.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spoon/app/bioconductor-spoon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spotclean", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spotclean.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spotclean/app/bioconductor-spotclean_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spotsweeper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spotsweeper.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spotsweeper/app/bioconductor-spotsweeper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-standr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-standr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-standr/app/bioconductor-standr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-statial", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-statial.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=2): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-stexampledata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stexampledata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stexampledata/app/bioconductor-stexampledata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-stjoincount", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stjoincount.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stjoincount/app/bioconductor-stjoincount_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-stpipe", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stpipe.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stpipe/app/bioconductor-stpipe_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-subcellularspatialdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-subcellularspatialdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-subcellularspatialdata/app/bioconductor-subcellularspatialdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-svp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-svp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-svp/app/bioconductor-svp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-synergyfinder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-synergyfinder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-synergyfinder/app/bioconductor-synergyfinder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tenxvisiumdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tenxvisiumdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tenxvisiumdata/app/bioconductor-tenxvisiumdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tidyomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tidyomics.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tidyomics/app/bioconductor-tidyomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tidyspatialexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tidyspatialexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tidyspatialexperiment/app/bioconductor-tidyspatialexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tpsvg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tpsvg.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tpsvg/app/bioconductor-tpsvg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-vectrapolarisdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-vectrapolarisdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-vectrapolarisdata/app/bioconductor-vectrapolarisdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-visiumio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-visiumio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-visiumio/app/bioconductor-visiumio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-voyager", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-voyager.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-voyager/app/bioconductor-voyager_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-weberdivechalcdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-weberdivechalcdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-weberdivechalcdata/app/bioconductor-weberdivechalcdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xeniumio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xeniumio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xeniumio/app/bioconductor-xeniumio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xenlite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xenlite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xenlite/app/bioconductor-xenlite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bwa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bwa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bwa/app/bwa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cascade-reg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cascade-reg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cascade-reg/app/cascade-reg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cell2cell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cell2cell.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cell2cell/app/cell2cell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellitac", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellitac.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellitac/app/cellitac_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellqc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellqc/app/cellqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellsnake", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellsnake.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellsnake/app/cellsnake_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "celltypist-so", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/celltypist-so.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_celltypist-so/app/celltypist-so_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "checkatlas", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/checkatlas.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_checkatlas/app/checkatlas_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "comebin", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/comebin.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_comebin/app/comebin_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cosg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cosg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cosg/app/cosg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cospar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cospar.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cospar/app/cospar_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dca", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dca.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dca/app/dca_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "doubletdetection", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/doubletdetection.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_doubletdetection/app/doubletdetection_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dropkick", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dropkick.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dropkick/app/dropkick_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "easy_vitessce", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/easy_vitessce.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "echidna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/echidna.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_echidna/app/echidna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "episcanpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/episcanpy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_episcanpy/app/episcanpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "flagx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/flagx.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_flagx/app/flagx_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gene-trajectory-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gene-trajectory-python.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gene-trajectory-python/app/gene-trajectory-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "genecircuitry", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genecircuitry.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "htslib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/htslib.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "kb-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kb-python.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kb-python/app/kb-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "khipu-metabolomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/khipu-metabolomics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_khipu-metabolomics/app/khipu-metabolomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "last", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/last.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_last/app/last_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "liana", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/liana.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "mameshiba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mameshiba.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mameshiba/app/mameshiba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "markerrepo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/markerrepo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_markerrepo/app/markerrepo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mobivision-m", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mobivision-m.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "msproteomicstools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/msproteomicstools.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "multiqc-xenium-extra", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/multiqc-xenium-extra.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_multiqc-xenium-extra/app/multiqc-xenium-extra_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ngs-smap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ngs-smap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ngs-smap/app/ngs-smap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "novae", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/novae.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_novae/app/novae_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "openms-thirdparty", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/openms-thirdparty.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_openms-thirdparty/app/openms-thirdparty_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "opticlust", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/opticlust.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "ourotools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ourotools.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "palantir", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/palantir.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_palantir/app/palantir_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "paste-bio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/paste-bio.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_paste-bio/app/paste-bio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pcdl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pcdl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pcdl/app/pcdl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "peakqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/peakqc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_peakqc/app/peakqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "peptides", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/peptides.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_peptides/app/peptides_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "piaso", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/piaso.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_piaso/app/piaso_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pixelator", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pixelator.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pixelator/app/pixelator_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "proteomiqon-peptidedb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/proteomiqon-peptidedb.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyrovelocity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyrovelocity.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "qcatch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/qcatch.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_qcatch/app/qcatch_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-archr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-archr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-archr/app/r-archr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-azimuth", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-azimuth.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-azimuth/app/r-azimuth_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-beyondcell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-beyondcell.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-beyondcell/app/r-beyondcell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-cdseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-cdseq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-cdseq/app/r-cdseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-dwls", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-dwls.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-dwls/app/r-dwls_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-epitrace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-epitrace.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-epitrace/app/r-epitrace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-flanders", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-flanders.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-flanders/app/r-flanders_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-mams", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-mams.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-mams/app/r-mams_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-redeemr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-redeemr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-redeemr/app/r-redeemr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-sceasy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-sceasy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-sceasy/app/r-sceasy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-scopfunctions", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-scopfunctions.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-scopfunctions/app/r-scopfunctions_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-seurat-data", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-seurat-data.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "r-seurat-disk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-seurat-disk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-seurat-disk/app/r-seurat-disk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sage-proteomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sage-proteomics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sage-proteomics/app/sage-proteomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "samap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samap/app/samap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "samtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samtools/app/samtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sc-musketeers", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sc-musketeers.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sc-musketeers/app/sc-musketeers_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scaden", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scaden.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scaden/app/scaden_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scanpy-cli", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scanpy-cli.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scanpy-cli/app/scanpy-cli_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scanpy-scripts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scanpy-scripts.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scanpy-scripts/app/scanpy-scripts_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sccellfie", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sccellfie.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sccellfie/app/sccellfie_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scepia", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scepia.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scepia/app/scepia_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scglue", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scglue.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scglue/app/scglue_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scib.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scib/app/scib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scirpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scirpy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scirpy/app/scirpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scmidas", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scmidas.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scmidas/app/scmidas_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scrnasim-toolz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scrnasim-toolz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scrnasim-toolz/app/scrnasim-toolz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scspectra", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scspectra.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scspectra/app/scspectra_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scstem", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scstem.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scstem/app/scstem_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sctriangulate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sctriangulate.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sctriangulate/app/sctriangulate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvi.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvi/app/scvi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvi-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvi-tools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvi-tools/app/scvi-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvis.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvis/app/scvis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvis_galaxy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvis_galaxy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvis_galaxy/app/scvis_galaxy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scxmatch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scxmatch.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scxmatch/app/scxmatch_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sdeper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sdeper.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sdeper/app/sdeper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seacells", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seacells.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seacells/app/seacells_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "shiba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/shiba.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_shiba/app/shiba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "simo-omics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/simo-omics.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_simo-omics/app/simo-omics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sincei", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sincei.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sincei/app/sincei_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sopa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sopa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sopa/app/sopa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spagrn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spagrn.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spagrn/app/spagrn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spapros", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spapros.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spapros/app/spapros_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spatialleiden", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spatialleiden.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spatialleiden/app/spatialleiden_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "switchtfi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/switchtfi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_switchtfi/app/switchtfi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "talon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/talon.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_talon/app/talon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tirank", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tirank.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tirank/app/tirank_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vitessce-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vitessce-python.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vitessce-python/app/vitessce-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vpt", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vpt.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vpt/app/vpt_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "wasp2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/wasp2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_wasp2/app/wasp2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "xclone", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/xclone.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_xclone/app/xclone_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "zol", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/zol.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_zol/app/zol_server.py", + "dockerfile_ready": true + } +] \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_0_of_4.json b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_0_of_4.json new file mode 100644 index 0000000000000000000000000000000000000000..f782ff1ae07203acee0c89d84013b0e70e800ea6 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_0_of_4.json @@ -0,0 +1,2108 @@ +[ + { + "tool_name": "abnumber", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/abnumber.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "alfred", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/alfred.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "aria2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/aria2.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "arvados-cwl-runner", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/arvados-cwl-runner.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "auspice", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/auspice.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bcbio-nextgen", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bcbio-nextgen.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bcbio-nextgen/app/bcbio-nextgen_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "biobambam", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/biobambam.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_biobambam/app/biobambam_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-affy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-affy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-affy/app/bioconductor-affy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster.spatial", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.spatial.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster.spatial/app/bioconductor-alabaster.spatial_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-apl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-apl.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-apl/app/bioconductor-apl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-biocbaseutils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-biocbaseutils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-biocbaseutils/app/bioconductor-biocbaseutils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-biovizbase", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-biovizbase.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-biovizbase/app/bioconductor-biovizbase_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-bulksignalr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-bulksignalr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-bulksignalr/app/bioconductor-bulksignalr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellhashr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellhashr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellhashr/app/bioconductor-cellhashr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-clusterprofiler", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-clusterprofiler.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-clusterprofiler/app/bioconductor-clusterprofiler_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cotan", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cotan.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cotan/app/bioconductor-cotan_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dada2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dada2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dada2/app/bioconductor-dada2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-decontx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-decontx.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-decontx/app/bioconductor-decontx_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-deseq2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-deseq2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-deseq2/app/bioconductor-deseq2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dirichletmultinomial", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dirichletmultinomial.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dirichletmultinomial/app/bioconductor-dirichletmultinomial_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-edger", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-edger.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-edger/app/bioconductor-edger_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-experimentsubset", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-experimentsubset.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-experimentsubset/app/bioconductor-experimentsubset_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genomeinfodb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genomeinfodb.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genomeinfodb/app/bioconductor-genomeinfodb_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genomicranges", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genomicranges.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genomicranges/app/bioconductor-genomicranges_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ggtree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ggtree.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ggtree/app/bioconductor-ggtree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-graph", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-graph.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-graph/app/bioconductor-graph_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-humanhippocampus2024", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-humanhippocampus2024.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-humanhippocampus2024/app/bioconductor-humanhippocampus2024_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-interactivedisplaybase", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-interactivedisplaybase.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-interactivedisplaybase/app/bioconductor-interactivedisplaybase_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-keggrest", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-keggrest.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-keggrest/app/bioconductor-keggrest_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-matrixgenerics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-matrixgenerics.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-matrixgenerics/app/bioconductor-matrixgenerics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-moleculeexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-moleculeexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-moleculeexperiment/app/bioconductor-moleculeexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-multtest", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-multtest.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-multtest/app/bioconductor-multtest_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-orfhunter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-orfhunter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-orfhunter/app/bioconductor-orfhunter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-partcnv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-partcnv.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-partcnv/app/bioconductor-partcnv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-preprocesscore", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-preprocesscore.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-preprocesscore/app/bioconductor-preprocesscore_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-reactomegsa.data", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-reactomegsa.data.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-reactomegsa.data/app/bioconductor-reactomegsa.data_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rhdf5filters", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rhdf5filters.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rhdf5filters/app/bioconductor-rhdf5filters_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rsubread", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rsubread.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rsubread/app/bioconductor-rsubread_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scaledmatrix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scaledmatrix.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scaledmatrix/app/bioconductor-scaledmatrix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scater", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scater.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scater/app/bioconductor-scater_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scfeatures", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scfeatures.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scfeatures/app/bioconductor-scfeatures_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scrnaseqapp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scrnaseqapp.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scrnaseqapp/app/bioconductor-scrnaseqapp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-seraster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-seraster.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-seraster/app/bioconductor-seraster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-singlecelltk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-singlecelltk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-singlecelltk/app/bioconductor-singlecelltk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spacetrooper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spacetrooper.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spacetrooper/app/bioconductor-spacetrooper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sparsearray", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sparsearray.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-sparsearray/app/bioconductor-sparsearray_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialde", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialde.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialde/app/bioconductor-spatialde_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialfeatureexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialfeatureexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialfeatureexperiment/app/bioconductor-spatialfeatureexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-speckle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-speckle.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-speckle/app/bioconductor-speckle_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spotclean", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spotclean.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spotclean/app/bioconductor-spotclean_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-stexampledata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stexampledata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stexampledata/app/bioconductor-stexampledata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-summarizedexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-summarizedexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-summarizedexperiment/app/bioconductor-summarizedexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tenxxeniumdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tenxxeniumdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tenxxeniumdata/app/bioconductor-tenxxeniumdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-treeio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-treeio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-treeio/app/bioconductor-treeio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-vectrapolarisdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-vectrapolarisdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-vectrapolarisdata/app/bioconductor-vectrapolarisdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-weberdivechalcdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-weberdivechalcdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-weberdivechalcdata/app/bioconductor-weberdivechalcdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xvector", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xvector.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xvector/app/bioconductor-xvector_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "blast", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/blast.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_blast/app/blast_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bpipe", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bpipe.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bpipe/app/bpipe_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "c-ares", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/c-ares.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_c-ares/app/c-ares_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cell2cell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cell2cell.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cell2cell/app/cell2cell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "celltypist-so", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/celltypist-so.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_celltypist-so/app/celltypist-so_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "circos", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/circos.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_circos/app/circos_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cnvkit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cnvkit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cnvkit/app/cnvkit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cooler", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cooler.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cooler/app/cooler_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cospar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cospar.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cospar/app/cospar_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cromwell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cromwell.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cromwell/app/cromwell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cytoscape", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cytoscape.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cytoscape/app/cytoscape_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "deblur", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/deblur.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_deblur/app/deblur_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dendropy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dendropy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dendropy/app/dendropy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dropkick", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dropkick.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dropkick/app/dropkick_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "echidna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/echidna.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_echidna/app/echidna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "entrez-direct", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/entrez-direct.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_entrez-direct/app/entrez-direct_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "f5c", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/f5c.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_f5c/app/f5c_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fastdtw", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fastdtw.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fastdtw/app/fastdtw_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fermi2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fermi2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fermi2/app/fermi2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "flye", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/flye.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_flye/app/flye_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fwdpy11", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fwdpy11.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fwdpy11/app/fwdpy11_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gatk4-spark", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gatk4-spark.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gatk4-spark/app/gatk4-spark_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gene-trajectory-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gene-trajectory-python.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gene-trajectory-python/app/gene-trajectory-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "genoboo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genoboo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_genoboo/app/genoboo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gffread", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gffread.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gffread/app/gffread_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "glimmerhmm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/glimmerhmm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_glimmerhmm/app/glimmerhmm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gofasta", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gofasta.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gofasta/app/gofasta_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gseapy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gseapy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gseapy/app/gseapy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hicexplorer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hicexplorer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_hicexplorer/app/hicexplorer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "htseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/htseq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_htseq/app/htseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hyphy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hyphy.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "infernal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/infernal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_infernal/app/infernal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "iow", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/iow.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_iow/app/iow_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "itsxpress", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/itsxpress.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_itsxpress/app/itsxpress_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "jbrowse2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/jbrowse2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_jbrowse2/app/jbrowse2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "k8", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/k8.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_k8/app/k8_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kb-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kb-python.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kb-python/app/kb-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kmer-jellyfish", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kmer-jellyfish.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kmer-jellyfish/app/kmer-jellyfish_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "lastz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/lastz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_lastz/app/lastz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "libdeflate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/libdeflate.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_libdeflate/app/libdeflate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mafft", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mafft.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mafft/app/mafft_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "markerrepo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/markerrepo.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_markerrepo/app/markerrepo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "medaka", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/medaka.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_medaka/app/medaka_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "metagenome-atlas", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/metagenome-atlas.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_metagenome-atlas/app/metagenome-atlas_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "minced", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/minced.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_minced/app/minced_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mitos", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mitos.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mitos/app/mitos_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mobivision-m", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mobivision-m.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mobivision-m/app/mobivision-m_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "msisensor-pro", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/msisensor-pro.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_msisensor-pro/app/msisensor-pro_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "multiqc-bcbio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/multiqc-bcbio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_multiqc-bcbio/app/multiqc-bcbio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "muscle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/muscle.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_muscle/app/muscle_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nanoget", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nanoget.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nanoget/app/nanoget_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ncbi-amrfinderplus", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncbi-amrfinderplus.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "ncbi-vdb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncbi-vdb.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ncbi-vdb/app/ncbi-vdb_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nextflow", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nextflow.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nextflow/app/nextflow_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ngs-smap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ngs-smap.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ngs-smap/app/ngs-smap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ont-fast5-api", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ont-fast5-api.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ont-fast5-api/app/ont-fast5-api_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ourotools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ourotools.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pandaseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pandaseq.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "parallel", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/parallel.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_parallel/app/parallel_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pbmm2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pbmm2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pbmm2/app/pbmm2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-aceperl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-aceperl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-aceperl/app/perl-aceperl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-alien-libxml2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-alien-libxml2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-alien-libxml2/app/perl-alien-libxml2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-archive-tar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-archive-tar.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-archive-tar/app/perl-archive-tar_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-asn1-entrezgene", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-asn1-entrezgene.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-asn1-entrezgene/app/perl-bio-asn1-entrezgene_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-phylo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-phylo.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-bio-tools-run-alignment-clustalw", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-tools-run-alignment-clustalw.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-tools-run-alignment-clustalw/app/perl-bio-tools-run-alignment-clustalw_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bioperl-run", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bioperl-run.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-capture-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-capture-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-capture-tiny/app/perl-capture-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-class-inspector", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-class-inspector.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-class-inspector/app/perl-class-inspector_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-clone", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-clone.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-clone/app/perl-clone_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-config-general", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-config-general.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-config-general/app/perl-config-general_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-cpan-meta", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-cpan-meta.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-data-optlist", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-data-optlist.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-data-optlist/app/perl-data-optlist_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-dbd-mysql", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-dbd-mysql.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-dbd-mysql/app/perl-dbd-mysql_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-devel-overloadinfo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-devel-overloadinfo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-devel-overloadinfo/app/perl-devel-overloadinfo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-digest-perl-md5", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-digest-perl-md5.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-digest-perl-md5/app/perl-digest-perl-md5_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-email-date-format", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-email-date-format.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-email-date-format/app/perl-email-date-format_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-eval-closure", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-eval-closure.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-extutils-cbuilder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-extutils-cbuilder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-extutils-cbuilder/app/perl-extutils-cbuilder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-ffi-checklib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ffi-checklib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-ffi-checklib/app/perl-ffi-checklib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-sort", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-sort.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-sort/app/perl-file-sort_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-font-afm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-font-afm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-font-afm/app/perl-font-afm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-graph", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-graph.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-graph/app/perl-graph_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-formatter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-formatter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-formatter/app/perl-html-formatter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-tidy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-tidy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-tidy/app/perl-html-tidy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-http-daemon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-http-daemon.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-http-daemon/app/perl-http-daemon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-image-info", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-image-info.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-image-info/app/perl-image-info_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-html", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-html.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-html/app/perl-io-html_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-stringy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-stringy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-stringy/app/perl-io-stringy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-ipc-run", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ipc-run.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-json-pp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-json-pp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-json-pp/app/perl-json-pp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-libxml-perl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-libxml-perl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-libxml-perl/app/perl-libxml-perl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-lwp-mediatypes", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-lwp-mediatypes.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-lwp-mediatypes/app/perl-lwp-mediatypes_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-bezier", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-bezier.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-bezier/app/perl-math-bezier_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-round", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-round.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-round/app/perl-math-round_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mime-base64", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mime-base64.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-mldbm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mldbm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mldbm/app/perl-mldbm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-load", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-load.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-load/app/perl-module-load_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-runtime-conflicts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-runtime-conflicts.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-runtime-conflicts/app/perl-module-runtime-conflicts_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mro-compat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mro-compat.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mro-compat/app/perl-mro-compat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-number-format", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-number-format.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-number-format/app/perl-number-format_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-package-stash-xs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-package-stash-xs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-package-stash-xs/app/perl-package-stash-xs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-params-validate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-params-validate.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-params-validate/app/perl-params-validate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-pathtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-pathtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-pathtools/app/perl-pathtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-pod-usage", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-pod-usage.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-pod-usage/app/perl-pod-usage_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-role-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-role-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-role-tiny/app/perl-role-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sereal-encoder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sereal-encoder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sereal-encoder/app/perl-sereal-encoder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-soap-lite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-soap-lite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-soap-lite/app/perl-soap-lite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-spreadsheet-writeexcel", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-spreadsheet-writeexcel.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-spreadsheet-writeexcel/app/perl-spreadsheet-writeexcel_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-exporter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-exporter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-exporter/app/perl-sub-exporter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-name", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-name.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-name/app/perl-sub-name_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-svg-graph", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-svg-graph.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-svg-graph/app/perl-svg-graph_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test/app/perl-test_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-fatal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-fatal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-fatal/app/perl-test-fatal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-most", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-most.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h51m15.887251046s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-text-csv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-text-csv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-text-csv/app/perl-text-csv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-threaded", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-threaded.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-threaded/app/perl-threaded_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-timedate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-timedate.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h45m42.039969527s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-types-serialiser", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-types-serialiser.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h42m40.957250164s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-version", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-version.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-version/app/perl-version_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-filter-buffertext", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-filter-buffertext.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-filter-buffertext/app/perl-xml-filter-buffertext_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-parser", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-parser.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-parser/app/perl-xml-parser_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-sax-expat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-sax-expat.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-sax-expat/app/perl-xml-sax-expat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-writer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-writer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-writer/app/perl-xml-writer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-yaml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-yaml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-yaml/app/perl-yaml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "picard-slim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/picard-slim.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h27m15.572366879s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "plink", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/plink.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h24m14.732505327s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "prank", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/prank.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_prank/app/prank_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "prokka", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/prokka.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_prokka/app/prokka_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "proteomiqon-peptidespectrummatching", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/proteomiqon-peptidespectrummatching.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_proteomiqon-peptidespectrummatching/app/proteomiqon-peptidespectrummatching_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pybigwig", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pybigwig.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pybigwig/app/pybigwig_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyhmmer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyhmmer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyhmmer/app/pyhmmer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyrovelocity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyrovelocity.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h13m42.171564832s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pytabix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pytabix.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pytabix/app/pytabix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyvcf3", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyvcf3.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyvcf3/app/pyvcf3_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "quast", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/quast.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h9m17.423485061s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "r-azimuth", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-azimuth.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-azimuth/app/r-azimuth_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-dwls", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-dwls.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-dwls/app/r-dwls_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-mams", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-mams.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-mams/app/r-mams_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-sceasy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-sceasy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-sceasy/app/r-sceasy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "racon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/racon.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h6m16.136744437s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "rgi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rgi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rgi/app/rgi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rsa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rsa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rsa/app/rsa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rtg-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rtg-tools.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h5m22.933769627s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "samap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samap.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samap/app/samap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "samtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samtools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samtools/app/samtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scanpy-scripts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scanpy-scripts.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scanpy-scripts/app/scanpy-scripts_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scib.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scib/app/scib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scspectra", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scspectra.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scspectra/app/scspectra_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvi-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvi-tools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvi-tools/app/scvi-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sdeper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sdeper.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sdeper/app/sdeper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sentieon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sentieon.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sentieon/app/sentieon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seqfu", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seqfu.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seqfu/app/seqfu_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "shiba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/shiba.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_shiba/app/shiba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sincei", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sincei.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sincei/app/sincei_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake-interface-executor-plugins", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-interface-executor-plugins.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake-interface-executor-plugins/app/snakemake-interface-executor-plugins_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake-minimal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-minimal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake-minimal/app/snakemake-minimal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snippy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snippy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snippy/app/snippy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sorted_nearest", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sorted_nearest.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "regenerate failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h55m13.943597057s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "spagrn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spagrn.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spagrn/app/spagrn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "stacks", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/stacks.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_stacks/app/stacks_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "stringtie", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/stringtie.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_stringtie/app/stringtie_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "t_coffee", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/t_coffee.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_t_coffee/app/t_coffee_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "taxonkit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/taxonkit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_taxonkit/app/taxonkit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tirank", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tirank.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tirank/app/tirank_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "transdecoder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/transdecoder.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h53m24.923764837s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "trimadap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trimadap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_trimadap/app/trimadap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "trnascan-se", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trnascan-se.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_trnascan-se/app/trnascan-se_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-fatotwobit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-fatotwobit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-fatotwobit/app/ucsc-fatotwobit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-twobitinfo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-twobitinfo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-twobitinfo/app/ucsc-twobitinfo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "umis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/umis.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_umis/app/umis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "upimapi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/upimapi.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h51m50.323066157s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "vardict-java", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vardict-java.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vardict-java/app/vardict-java_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vcfpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vcfpy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vcfpy/app/vcfpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vitessce-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vitessce-python.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vitessce-python/app/vitessce-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "wasp2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/wasp2.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_wasp2/app/wasp2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "xopen", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/xopen.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h46m55.753926583s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + } +] \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_1_of_4.json b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_1_of_4.json new file mode 100644 index 0000000000000000000000000000000000000000..eca51e888e0e640dec59b661461046afe65e17cd --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_1_of_4.json @@ -0,0 +1,2108 @@ +[ + { + "tool_name": "abricate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/abricate.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "anansescanpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/anansescanpy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ariba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ariba.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "arvados-python-client", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/arvados-python-client.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bactopia", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bactopia.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bactopia/app/bactopia_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bedops", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bedops.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bedops/app/bedops_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioblend", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioblend.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioblend/app/bioblend_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-affyio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-affyio.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-ancombc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ancombc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ancombc/app/bioconductor-ancombc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-awaggregator", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-awaggregator.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-awaggregator/app/bioconductor-awaggregator_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-biocfilecache", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-biocfilecache.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-biocfilecache/app/bioconductor-biocfilecache_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-blase", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-blase.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-blase/app/bioconductor-blase_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cardspa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cardspa.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cardspa/app/bioconductor-cardspa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellid", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellid.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellid/app/bioconductor-cellid_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-clustsignal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-clustsignal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-clustsignal/app/bioconductor-clustsignal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-csoa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-csoa.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-csoa/app/bioconductor-csoa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-data-packages", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-data-packages.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-data-packages/app/bioconductor-data-packages_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-deconvobuddies", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-deconvobuddies.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-deconvobuddies/app/bioconductor-deconvobuddies_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-despace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-despace.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-despace/app/bioconductor-despace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dnacopy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dnacopy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dnacopy/app/bioconductor-dnacopy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ensembldb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ensembldb.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ensembldb/app/bioconductor-ensembldb_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-fgsea", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-fgsea.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-fgsea/app/bioconductor-fgsea_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genomeinfodbdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genomeinfodbdata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genomeinfodbdata/app/bioconductor-genomeinfodbdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-geomxtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-geomxtools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-geomxtools/app/bioconductor-geomxtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-glmgampoi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-glmgampoi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-glmgampoi/app/bioconductor-glmgampoi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-hcatonsildata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-hcatonsildata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-hcatonsildata/app/bioconductor-hcatonsildata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-imcdatasets", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-imcdatasets.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-imcdatasets/app/bioconductor-imcdatasets_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-iranges", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-iranges.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-iranges/app/bioconductor-iranges_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-limma", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-limma.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-limma/app/bioconductor-limma_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-merfishdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-merfishdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-merfishdata/app/bioconductor-merfishdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mousegastrulationdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mousegastrulationdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mousegastrulationdata/app/bioconductor-mousegastrulationdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mzr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mzr.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-org.ce.eg.db", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-org.ce.eg.db.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-org.ce.eg.db/app/bioconductor-org.ce.eg.db_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-phyloseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-phyloseq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-phyloseq/app/bioconductor-phyloseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-protgenerics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-protgenerics.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-protgenerics/app/bioconductor-protgenerics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-regionalst", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-regionalst.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-regionalst/app/bioconductor-regionalst_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rhdf5lib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rhdf5lib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rhdf5lib/app/bioconductor-rhdf5lib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rtracklayer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rtracklayer.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-scalign", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scalign.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scalign/app/bioconductor-scalign_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scbubbletree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scbubbletree.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scbubbletree/app/bioconductor-scbubbletree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scider", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scider.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scider/app/bioconductor-scider_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sctreeviz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sctreeviz.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-sctreeviz/app/bioconductor-sctreeviz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-shortread", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-shortread.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-shortread/app/bioconductor-shortread_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-smoothclust", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-smoothclust.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-smoothclust/app/bioconductor-smoothclust_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spacexr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spacexr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spacexr/app/bioconductor-spacexr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sparsematrixstats", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sparsematrixstats.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-sparsematrixstats/app/bioconductor-sparsematrixstats_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialdmelxsim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialdmelxsim.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialdmelxsim/app/bioconductor-spatialdmelxsim_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatiallibd", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatiallibd.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatiallibd/app/bioconductor-spatiallibd_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spiat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spiat.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spiat/app/bioconductor-spiat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spotsweeper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spotsweeper.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spotsweeper/app/bioconductor-spotsweeper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-stjoincount", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stjoincount.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stjoincount/app/bioconductor-stjoincount_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-svp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-svp.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-svp/app/bioconductor-svp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tidyomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tidyomics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tidyomics/app/bioconductor-tidyomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-treesummarizedexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-treesummarizedexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-treesummarizedexperiment/app/bioconductor-treesummarizedexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-visiumio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-visiumio.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-visiumio/app/bioconductor-visiumio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xcms", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xcms.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xcms/app/bioconductor-xcms_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-zlibbioc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-zlibbioc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-zlibbioc/app/bioconductor-zlibbioc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "blast-legacy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/blast-legacy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_blast-legacy/app/blast-legacy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "busco", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/busco.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_busco/app/busco_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cascade-reg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cascade-reg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cascade-reg/app/cascade-reg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellitac", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellitac.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellitac/app/cellitac_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "checkatlas", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/checkatlas.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_checkatlas/app/checkatlas_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "clustalo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/clustalo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_clustalo/app/clustalo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "comebin", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/comebin.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_comebin/app/comebin_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cooltools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cooltools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cooltools/app/cooltools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "crispresso2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/crispresso2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_crispresso2/app/crispresso2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "csvtk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/csvtk.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "cyvcf2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cyvcf2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cyvcf2/app/cyvcf2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "deeptools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/deeptools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_deeptools/app/deeptools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "diamond", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/diamond.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "dsh-bio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dsh-bio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dsh-bio/app/dsh-bio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "emboss", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/emboss.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_emboss/app/emboss_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "epic", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/epic.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_epic/app/epic_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "famsa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/famsa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_famsa/app/famsa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fastp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fastp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fastp/app/fastp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fgbio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fgbio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fgbio/app/fgbio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "foldseek", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/foldseek.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=3): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "galaxy-lib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/galaxy-lib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_galaxy-lib/app/galaxy-lib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gdk-pixbuf", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gdk-pixbuf.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gdk-pixbuf/app/gdk-pixbuf_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "genecircuitry", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genecircuitry.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_genecircuitry/app/genecircuitry_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "genomad", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genomad.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "gffutils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gffutils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gffutils/app/gffutils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gmap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gmap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gmap/app/gmap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "goleft", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/goleft.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_goleft/app/goleft_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gtdbtk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gtdbtk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gtdbtk/app/gtdbtk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hifiasm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hifiasm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_hifiasm/app/hifiasm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "htslib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/htslib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_htslib/app/htslib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "igv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/igv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_igv/app/igv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "insilicoseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/insilicoseq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_insilicoseq/app/insilicoseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ipyrad", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ipyrad.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ipyrad/app/ipyrad_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ivar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ivar.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ivar/app/ivar_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "jcvi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/jcvi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_jcvi/app/jcvi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kaiju", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kaiju.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kaiju/app/kaiju_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "khipu-metabolomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/khipu-metabolomics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_khipu-metabolomics/app/khipu-metabolomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kraken2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kraken2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kraken2/app/kraken2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "liana", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/liana.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "libsequence", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/libsequence.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_libsequence/app/libsequence_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mageck", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mageck.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mageck/app/mageck_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mash", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mash.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mash/app/mash_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "megahit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/megahit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_megahit/app/megahit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "metaphlan", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/metaphlan.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_metaphlan/app/metaphlan_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "miniasm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/miniasm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_miniasm/app/miniasm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mlst", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mlst.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "moments", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/moments.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_moments/app/moments_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "msproteomicstools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/msproteomicstools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_msproteomicstools/app/msproteomicstools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "multiqc-xenium-extra", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/multiqc-xenium-extra.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_multiqc-xenium-extra/app/multiqc-xenium-extra_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mysql-connector-c", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mysql-connector-c.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mysql-connector-c/app/mysql-connector-c_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nanomath", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nanomath.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nanomath/app/nanomath_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ncbi-datasets-pylib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncbi-datasets-pylib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ncbi-datasets-pylib/app/ncbi-datasets-pylib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ncls", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncls.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ncls/app/ncls_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nf-core", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nf-core.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nf-core/app/nf-core_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ngs-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ngs-tools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ngs-tools/app/ngs-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "openms-thirdparty", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/openms-thirdparty.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_openms-thirdparty/app/openms-thirdparty_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pairix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pairix.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pairix/app/pairix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pango-designation", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pango-designation.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pango-designation/app/pango-designation_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "parasail-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/parasail-python.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_parasail-python/app/parasail-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pcdl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pcdl.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pcdl/app/pcdl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-algorithm-diff", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-algorithm-diff.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-algorithm-diff/app/perl-algorithm-diff_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-apache-test", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-apache-test.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-apache-test/app/perl-apache-test_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-array-compare", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-array-compare.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-array-compare/app/perl-array-compare_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-coordinate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-coordinate.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-coordinate/app/perl-bio-coordinate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-samtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-samtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-samtools/app/perl-bio-samtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-tools-run-alignment-tcoffee", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-tools-run-alignment-tcoffee.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-tools-run-alignment-tcoffee/app/perl-bio-tools-run-alignment-tcoffee_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-business-isbn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-business-isbn.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-business-isbn/app/perl-business-isbn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-carp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-carp.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-class-load", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-class-load.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-common-sense", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-common-sense.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-common-sense/app/perl-common-sense_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-constant", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-constant.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-constant/app/perl-constant_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-cpan-meta-requirements", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-cpan-meta-requirements.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-cpan-meta-requirements/app/perl-cpan-meta-requirements_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-data-stag", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-data-stag.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-data-stag/app/perl-data-stag_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-dbd-sqlite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-dbd-sqlite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-dbd-sqlite/app/perl-dbd-sqlite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-devel-stacktrace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-devel-stacktrace.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-devel-stacktrace/app/perl-devel-stacktrace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-digest-sha1", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-digest-sha1.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-digest-sha1/app/perl-digest-sha1_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-encode", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-encode.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-encode/app/perl-encode_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-exception-class", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-exception-class.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-exception-class/app/perl-exception-class_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-extutils-makemaker", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-extutils-makemaker.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-extutils-makemaker/app/perl-extutils-makemaker_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-listing", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-listing.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-listing/app/perl-file-listing_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-spec", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-spec.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-spec/app/perl-file-spec_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-font-ttf", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-font-ttf.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-font-ttf/app/perl-font-ttf_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-graphviz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-graphviz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-graphviz/app/perl-graphviz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-parser", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-parser.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-parser/app/perl-html-parser_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-tree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-tree.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-tree/app/perl-html-tree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-http-date", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-http-date.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-http-date/app/perl-http-date_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-image-size", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-image-size.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-image-size/app/perl-image-size_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-sessiondata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-sessiondata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-sessiondata/app/perl-io-sessiondata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-tty", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-tty.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-tty/app/perl-io-tty_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-ipc-sharelite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ipc-sharelite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-ipc-sharelite/app/perl-ipc-sharelite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-json-xs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-json-xs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-json-xs/app/perl-json-xs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-list-moreutils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-list-moreutils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-list-moreutils/app/perl-list-moreutils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-lwp-protocol-https", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-lwp-protocol-https.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-lwp-protocol-https/app/perl-lwp-protocol-https_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-cdf", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-cdf.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-cdf/app/perl-math-cdf_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-spline", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-spline.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-spline/app/perl-math-spline_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mime-lite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mime-lite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mime-lite/app/perl-mime-lite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-build", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-build.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-build/app/perl-module-build_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-load-conditional", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-load-conditional.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-load-conditional/app/perl-module-load-conditional_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-moo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-moo.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-moo/app/perl-moo_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-net-http", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-net-http.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-net-http/app/perl-net-http_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-ole-storage_lite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ole-storage_lite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-ole-storage_lite/app/perl-ole-storage_lite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-parallel-forkmanager", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-parallel-forkmanager.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-parallel-forkmanager/app/perl-parallel-forkmanager_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-parent", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-parent.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-parent/app/perl-parent_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-pdf-api2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-pdf-api2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-pdf-api2/app/perl-pdf-api2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-postscript", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-postscript.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-postscript/app/perl-postscript_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-scalar-list-utils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-scalar-list-utils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-scalar-list-utils/app/perl-scalar-list-utils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-set-intervaltree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-set-intervaltree.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-set-intervaltree/app/perl-set-intervaltree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-socket", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-socket.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-socket/app/perl-socket_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-statistics-basic", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-statistics-basic.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-statistics-basic/app/perl-statistics-basic_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-exporter-progressive", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-exporter-progressive.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-exporter-progressive/app/perl-sub-exporter-progressive_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-quote", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-quote.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-quote/app/perl-sub-quote_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-task-weaken", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-task-weaken.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-task-weaken/app/perl-task-weaken_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-deep", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-deep.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-deep/app/perl-test-deep_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-harness", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-harness.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-harness/app/perl-test-harness_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-requiresinternet", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-requiresinternet.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-requiresinternet/app/perl-test-requiresinternet_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-text-diff", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-text-diff.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h32m20.726872387s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-tie-ixhash", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-tie-ixhash.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-tie-ixhash/app/perl-tie-ixhash_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-tree-dag_node", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-tree-dag_node.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-tree-dag_node/app/perl-tree-dag_node_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-unicode-map", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-unicode-map.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-unicode-map/app/perl-unicode-map_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-www-robotrules", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-www-robotrules.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-www-robotrules/app/perl-www-robotrules_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-libxml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-libxml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-libxml/app/perl-xml-libxml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-regexp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-regexp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-regexp/app/perl-xml-regexp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-sax-writer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-sax-writer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-sax-writer/app/perl-xml-sax-writer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-xpath", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-xpath.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-xpath/app/perl-xml-xpath_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "phyml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/phyml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_phyml/app/phyml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pilon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pilon.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h23m11.860035304s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "poa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/poa.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h23m10.543479243s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "primer3", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/primer3.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_primer3/app/primer3_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "prophyle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/prophyle.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_prophyle/app/prophyle_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pubchempy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pubchempy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pubchempy/app/pubchempy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pybiolib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pybiolib.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h21m45.688394101s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pyranges", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyranges.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyranges/app/pyranges_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pysam", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pysam.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pysam/app/pysam_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyteomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyteomics.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyteomics/app/pyteomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "qcatch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/qcatch.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_qcatch/app/qcatch_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-abdiv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-abdiv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-abdiv/app/r-abdiv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-basejump", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-basejump.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-basejump/app/r-basejump_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-epitrace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-epitrace.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-epitrace/app/r-epitrace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-redeemr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-redeemr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-redeemr/app/r-redeemr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-scopfunctions", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-scopfunctions.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-scopfunctions/app/r-scopfunctions_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "raxml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/raxml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_raxml/app/raxml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rnastructure", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rnastructure.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rnastructure/app/rnastructure_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rscape", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rscape.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rscape/app/rscape_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rust-bio-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rust-bio-tools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rust-bio-tools/app/rust-bio-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sambamba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sambamba.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sambamba/app/sambamba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sc-musketeers", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sc-musketeers.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sc-musketeers/app/sc-musketeers_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sccellfie", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sccellfie.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sccellfie/app/sccellfie_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scirpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scirpy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scirpy/app/scirpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scstem", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scstem.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scstem/app/scstem_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvis.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvis/app/scvis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seacells", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seacells.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seacells/app/seacells_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sepp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sepp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sepp/app/sepp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seqkit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seqkit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seqkit/app/seqkit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "simo-omics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/simo-omics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_simo-omics/app/simo-omics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "slow5tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/slow5tools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_slow5tools/app/slow5tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake-interface-logger-plugins", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-interface-logger-plugins.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h6m24.322818481s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "snakemake-wrapper-utils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-wrapper-utils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake-wrapper-utils/app/snakemake-wrapper-utils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snpeff", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snpeff.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snpeff/app/snpeff_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sortmerna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sortmerna.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sortmerna/app/sortmerna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spapros", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spapros.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spapros/app/spapros_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "star", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/star.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_star/app/star_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "subread", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/subread.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_subread/app/subread_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tabix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tabix.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tabix/app/tabix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tb-profiler", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tb-profiler.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tb-profiler/app/tb-profiler_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tmalign", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tmalign.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tmalign/app/tmalign_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "treetime", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/treetime.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_treetime/app/treetime_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "trimal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trimal.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h1m31.140015018s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "ucsc-bedgraphtobigwig", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-bedgraphtobigwig.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h1m30.200220377s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "ucsc-gtftogenepred", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-gtftogenepred.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-gtftogenepred/app/ucsc-gtftogenepred_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-twobittofa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-twobittofa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-twobittofa/app/ucsc-twobittofa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "unicycler", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/unicycler.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_unicycler/app/unicycler_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "urllib3", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/urllib3.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_urllib3/app/urllib3_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "varlociraptor", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/varlociraptor.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h59m1.993030901s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "vcftools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vcftools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vcftools/app/vcftools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vpt", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vpt.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vpt/app/vpt_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "whatshap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/whatshap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_whatshap/app/whatshap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "yacrd", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/yacrd.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_yacrd/app/yacrd_server.py", + "dockerfile_ready": true + } +] \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_2_of_4.json b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_2_of_4.json new file mode 100644 index 0000000000000000000000000000000000000000..8aaae94dc2029bcee885707bc7f29732f75e804b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_2_of_4.json @@ -0,0 +1,2108 @@ +[ + { + "tool_name": "abundancebin", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/abundancebin.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "anarci", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/anarci.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "arriba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/arriba.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "atropos", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/atropos.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "barrnap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/barrnap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_barrnap/app/barrnap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bin2cell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bin2cell.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bin2cell/app/bin2cell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconda-repodata-patches", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconda-repodata-patches.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconda-repodata-patches/app/bioconda-repodata-patches_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster/app/bioconductor-alabaster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-annotationfilter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-annotationfilter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-annotationfilter/app/bioconductor-annotationfilter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-banksy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-banksy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-banksy/app/bioconductor-banksy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-biocio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-biocio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-biocio/app/bioconductor-biocio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-bluster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-bluster.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-bluster/app/bioconductor-bluster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-catscradle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-catscradle.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-catscradle/app/bioconductor-catscradle_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cellmigration", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cellmigration.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cellmigration/app/bioconductor-cellmigration_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-complexheatmap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-complexheatmap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-complexheatmap/app/bioconductor-complexheatmap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ctsv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ctsv.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ctsv/app/bioconductor-ctsv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-decipher", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-decipher.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-decipher/app/bioconductor-decipher_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-delayedarray", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-delayedarray.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-diffbind", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-diffbind.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-diffbind/app/bioconductor-diffbind_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dose", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dose.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dose/app/bioconductor-dose_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-erma", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-erma.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-erma/app/bioconductor-erma_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genefilter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genefilter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genefilter/app/bioconductor-genefilter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genomicalignments", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genomicalignments.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genomicalignments/app/bioconductor-genomicalignments_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ggsc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ggsc.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ggsc/app/bioconductor-ggsc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-go.db", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-go.db.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-go.db/app/bioconductor-go.db_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-hdf5array", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-hdf5array.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-hdf5array/app/bioconductor-hdf5array_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-imcrtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-imcrtools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-imcrtools/app/bioconductor-imcrtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-irisfgm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-irisfgm.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-irisfgm/app/bioconductor-irisfgm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-lisaclust", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-lisaclust.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-lisaclust/app/bioconductor-lisaclust_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-metapod", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-metapod.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-metapod/app/bioconductor-metapod_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mspurity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mspurity.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mspurity/app/bioconductor-mspurity_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-nnsvg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-nnsvg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-nnsvg/app/bioconductor-nnsvg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-org.hs.eg.db", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-org.hs.eg.db.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-org.hs.eg.db/app/bioconductor-org.hs.eg.db_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-pipecomp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-pipecomp.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-pipecomp/app/bioconductor-pipecomp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-qvalue", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-qvalue.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-qvalue/app/bioconductor-qvalue_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rgraphviz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rgraphviz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rgraphviz/app/bioconductor-rgraphviz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rhtslib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rhtslib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rhtslib/app/bioconductor-rhtslib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-s4arrays", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-s4arrays.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-s4arrays/app/bioconductor-s4arrays_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scannotatr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scannotatr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scannotatr/app/bioconductor-scannotatr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scclassifr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scclassifr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scclassifr/app/bioconductor-scclassifr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scqtltools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scqtltools.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scqtltools/app/bioconductor-scqtltools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scuttle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scuttle.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scuttle/app/bioconductor-scuttle_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-signifinder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-signifinder.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-signifinder/app/bioconductor-signifinder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-smoppix", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-smoppix.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-smoppix/app/bioconductor-smoppix_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spanorm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spanorm.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spanorm/app/bioconductor-spanorm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spasim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spasim.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spasim/app/bioconductor-spasim_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialexperimentio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialexperimentio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialexperimentio/app/bioconductor-spatialexperimentio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialomicsoverlay", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialomicsoverlay.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialomicsoverlay/app/bioconductor-spatialomicsoverlay_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spicyr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spicyr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spicyr/app/bioconductor-spicyr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-standr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-standr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-standr/app/bioconductor-standr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-stpipe", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-stpipe.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-stpipe/app/bioconductor-stpipe_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-synergyfinder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-synergyfinder.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-synergyfinder/app/bioconductor-synergyfinder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tidyspatialexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tidyspatialexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tidyspatialexperiment/app/bioconductor-tidyspatialexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tximport", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tximport.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tximport/app/bioconductor-tximport_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-visiumstitched", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-visiumstitched.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-visiumstitched/app/bioconductor-visiumstitched_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xeniumio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xeniumio.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xeniumio/app/bioconductor-xeniumio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "biom-format", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/biom-format.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_biom-format/app/biom-format_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bowtie", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bowtie.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bowtie/app/bowtie_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bwa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bwa.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bwa/app/bwa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cd-hit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cd-hit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cd-hit/app/cd-hit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellqc.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellqc/app/cellqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "checkm-genome", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/checkm-genome.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_checkm-genome/app/checkm-genome_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "clustalw", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/clustalw.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_clustalw/app/clustalw_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "comet-ms", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/comet-ms.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_comet-ms/app/comet-ms_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "coreutils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/coreutils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_coreutils/app/coreutils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "crispritz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/crispritz.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_crispritz/app/crispritz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cutadapt", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cutadapt.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cutadapt/app/cutadapt_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dca", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dca.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dca/app/dca_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "deeptoolsintervals", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/deeptoolsintervals.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_deeptoolsintervals/app/deeptoolsintervals_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dnaio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dnaio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dnaio/app/dnaio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "dxpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/dxpy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_dxpy/app/dxpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ena-webin-cli", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ena-webin-cli.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ena-webin-cli/app/ena-webin-cli_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "episcanpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/episcanpy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_episcanpy/app/episcanpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fast5", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fast5.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fast5/app/fast5_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fastqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fastqc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fastqc/app/fastqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "filechunkio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/filechunkio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_filechunkio/app/filechunkio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "freebayes", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/freebayes.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_freebayes/app/freebayes_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gatk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gatk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gatk/app/gatk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gecode", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gecode.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gecode/app/gecode_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "geneimpacts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/geneimpacts.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_geneimpacts/app/geneimpacts_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "genomepy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genomepy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_genomepy/app/genomepy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ghostscript", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ghostscript.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ghostscript/app/ghostscript_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gneiss", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gneiss.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gneiss/app/gneiss_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gridss", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gridss.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "harpy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/harpy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_harpy/app/harpy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hisat2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hisat2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_hisat2/app/hisat2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "humann", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/humann.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "igv-reports", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/igv-reports.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_igv-reports/app/igv-reports_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "intarna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/intarna.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_intarna/app/intarna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ipython-cluster-helper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ipython-cluster-helper.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ipython-cluster-helper/app/ipython-cluster-helper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "jalview", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/jalview.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_jalview/app/jalview_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "jellyfish", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/jellyfish.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_jellyfish/app/jellyfish_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kalign2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kalign2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kalign2/app/kalign2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kma", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kma.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "krona", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/krona.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_krona/app/krona_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "libcifpp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/libcifpp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_libcifpp/app/libcifpp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "locarna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/locarna.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_locarna/app/locarna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mameshiba", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mameshiba.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mameshiba/app/mameshiba_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "maxquant", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/maxquant.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_maxquant/app/maxquant_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "meme", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/meme.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_meme/app/meme_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "metaphlan2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/metaphlan2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_metaphlan2/app/metaphlan2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "minimap2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/minimap2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_minimap2/app/minimap2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mmseqs2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mmseqs2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mmseqs2/app/mmseqs2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mosdepth", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mosdepth.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mosdepth/app/mosdepth_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "msstitch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/msstitch.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_msstitch/app/msstitch_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mummer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mummer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mummer/app/mummer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mztosqlite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mztosqlite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mztosqlite/app/mztosqlite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nanoplot", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nanoplot.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "ncbi-genome-download", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncbi-genome-download.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ncbi-genome-download/app/ncbi-genome-download_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nextalign", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nextalign.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nextalign/app/nextalign_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nglview", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nglview.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nglview/app/nglview_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "novae", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/novae.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_novae/app/novae_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "opticlust", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/opticlust.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_opticlust/app/opticlust_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "palantir", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/palantir.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_palantir/app/palantir_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pangolearn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pangolearn.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pangolearn/app/pangolearn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pasta", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pasta.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pasta/app/pasta_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "peakqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/peakqc.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_peakqc/app/peakqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-algorithm-munkres", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-algorithm-munkres.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-app-cpanminus", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-app-cpanminus.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-app-cpanminus/app/perl-app-cpanminus_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-autoloader", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-autoloader.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-autoloader/app/perl-autoloader_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-db-hts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-db-hts.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-db-hts/app/perl-bio-db-hts_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-searchio-hmmer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-searchio-hmmer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-searchio-hmmer/app/perl-bio-searchio-hmmer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bioperl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bioperl.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-business-isbn-data", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-business-isbn-data.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-business-isbn-data/app/perl-business-isbn-data_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-cgi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-cgi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-cgi/app/perl-cgi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-class-load-xs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-class-load-xs.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-compress-raw-bzip2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-compress-raw-bzip2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-compress-raw-bzip2/app/perl-compress-raw-bzip2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-convert-binary-c", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-convert-binary-c.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-convert-binary-c/app/perl-convert-binary-c_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-crypt-rc4", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-crypt-rc4.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-crypt-rc4/app/perl-crypt-rc4_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-date-format", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-date-format.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-date-format/app/perl-date-format_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-dbi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-dbi.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-dbi/app/perl-dbi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-digest-hmac", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-digest-hmac.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-digest-hmac/app/perl-digest-hmac_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-dist-checkconflicts", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-dist-checkconflicts.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-encode-locale", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-encode-locale.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-encode-locale/app/perl-encode-locale_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-exporter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-exporter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-exporter/app/perl-exporter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-extutils-manifest", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-extutils-manifest.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-extutils-manifest/app/perl-extutils-manifest_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-path", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-path.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-path/app/perl-file-path_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-temp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-temp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-temp/app/perl-file-temp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-gd", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-gd.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-gd/app/perl-gd_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-element-extended", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-element-extended.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-element-extended/app/perl-html-element-extended_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-tableextract", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-tableextract.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-tableextract/app/perl-html-tableextract_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-treebuilder-xpath", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-treebuilder-xpath.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-treebuilder-xpath/app/perl-html-treebuilder-xpath_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-http-message", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-http-message.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-http-message/app/perl-http-message_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-importer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-importer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-importer/app/perl-importer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-socket-ssl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-socket-ssl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-socket-ssl/app/perl-io-socket-ssl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-zlib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-zlib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-zlib/app/perl-io-zlib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-jcode", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-jcode.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-jcode/app/perl-jcode_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-lib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-lib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-lib/app/perl-lib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-list-moreutils-xs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-list-moreutils-xs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-list-moreutils-xs/app/perl-list-moreutils-xs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-lwp-simple", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-lwp-simple.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-math-derivative", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-derivative.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-derivative/app/perl-math-derivative_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-vecstat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-vecstat.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-vecstat/app/perl-math-vecstat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mime-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mime-tools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mime-tools/app/perl-mime-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-corelist", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-corelist.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-corelist/app/perl-module-corelist_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-metadata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-metadata.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-metadata/app/perl-module-metadata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-moose", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-moose.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-moose/app/perl-moose_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-net-ssleay", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-net-ssleay.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-net-ssleay/app/perl-net-ssleay_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-package-deprecationmanager", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-package-deprecationmanager.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-package-deprecationmanager/app/perl-package-deprecationmanager_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-params-check", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-params-check.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-params-check/app/perl-params-check_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-parse-recdescent", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-parse-recdescent.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-parse-recdescent/app/perl-parse-recdescent_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-perlio-gzip", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-perlio-gzip.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-perlio-gzip/app/perl-perlio-gzip_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-readonly", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-readonly.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-readonly/app/perl-readonly_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sereal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sereal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sereal/app/perl-sereal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-set-intspan", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-set-intspan.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-sort-naturally", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sort-naturally.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sort-naturally/app/perl-sort-naturally_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-statistics-descriptive", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-statistics-descriptive.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-statistics-descriptive/app/perl-statistics-descriptive_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-identify", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-identify.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-identify/app/perl-sub-identify_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-uplevel", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-uplevel.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-uplevel/app/perl-sub-uplevel_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-template-toolkit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-template-toolkit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-template-toolkit/app/perl-template-toolkit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-differences", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-differences.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-differences/app/perl-test-differences_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-leaktrace", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-leaktrace.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-leaktrace/app/perl-test-leaktrace_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-warn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-warn.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-warn/app/perl-test-warn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-text-format", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-text-format.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-text-format/app/perl-text-format_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-time-hires", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-time-hires.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-time-hires/app/perl-time-hires_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-try-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-try-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-try-tiny/app/perl-try-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-uri", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-uri.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-uri/app/perl-uri_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-dom", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-dom.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-dom/app/perl-xml-dom_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-libxslt", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-libxslt.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-libxslt/app/perl-xml-libxslt_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-sax", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-sax.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-sax/app/perl-xml-sax_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-simple", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-simple.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-simple/app/perl-xml-simple_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-xpathengine", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-xpathengine.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-xpathengine/app/perl-xml-xpathengine_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "piaso", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/piaso.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_piaso/app/piaso_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pixelator", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pixelator.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pixelator/app/pixelator_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "portcullis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/portcullis.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_portcullis/app/portcullis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "primer3-py", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/primer3-py.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h38m15.21563304s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "proteinortho", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/proteinortho.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_proteinortho/app/proteinortho_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "py2bit", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/py2bit.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_py2bit/app/py2bit_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyfaidx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyfaidx.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h37m23.552212461s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pyrle", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyrle.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h34m22.492452284s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pysftp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pysftp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pysftp/app/pysftp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "python-edlib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/python-edlib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_python-edlib/app/python-edlib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "qiime", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/qiime.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "regenerate failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h32m46.544993021s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "r-acidbase", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-acidbase.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-acidbase/app/r-acidbase_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-beyondcell", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-beyondcell.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-beyondcell/app/r-beyondcell_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-flanders", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-flanders.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-flanders/app/r-flanders_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-restfulr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-restfulr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-restfulr/app/r-restfulr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-seurat-data", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-seurat-data.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-seurat-data/app/r-seurat-data_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "recognizer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/recognizer.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h28m26.883569646s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "rnftools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rnftools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rnftools/app/rnftools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rsem", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rsem.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rsem/app/rsem_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sage-proteomics", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sage-proteomics.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sage-proteomics/app/sage-proteomics_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "samblaster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samblaster.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samblaster/app/samblaster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scaden", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scaden.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scaden/app/scaden_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scepia", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scepia.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scepia/app/scepia_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scmidas", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scmidas.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scmidas/app/scmidas_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sctriangulate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sctriangulate.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sctriangulate/app/sctriangulate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvis_galaxy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvis_galaxy.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvis_galaxy/app/scvis_galaxy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "searchgui", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/searchgui.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_searchgui/app/searchgui_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seq2science", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seq2science.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seq2science/app/seq2science_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seqtk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seqtk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seqtk/app/seqtk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "simplejson", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/simplejson.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_simplejson/app/simplejson_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake/app/snakemake_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake-interface-report-plugins", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-interface-report-plugins.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake-interface-report-plugins/app/snakemake-interface-report-plugins_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakesv", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakesv.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakesv/app/snakesv_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snpsift", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snpsift.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snpsift/app/snpsift_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sourmash", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sourmash.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sourmash/app/sourmash_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spatialleiden", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spatialleiden.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spatialleiden/app/spatialleiden_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "star-fusion", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/star-fusion.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_star-fusion/app/star-fusion_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "switchtfi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/switchtfi.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_switchtfi/app/switchtfi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tabixpp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tabixpp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tabixpp/app/tabixpp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "thapbi-pict", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/thapbi-pict.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h7m25.710777538s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "tobias", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tobias.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h7m24.223552226s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValue | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "trf", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trf.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h4m23.05712762s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue\" | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "trimmomatic", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trimmomatic.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_trimmomatic/app/trimmomatic_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-bedtobigbed", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-bedtobigbed.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-bedtobigbed/app/ucsc-bedtobigbed_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-liftover", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-liftover.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-liftover/app/ucsc-liftover_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-wigtobigwig", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-wigtobigwig.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h59m41.246802677s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "unifrac", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/unifrac.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_unifrac/app/unifrac_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "usher", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/usher.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_usher/app/usher_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "varscan", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/varscan.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h55m52.143428344s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "vcontact2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vcontact2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vcontact2/app/vcontact2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vsearch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vsearch.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h49m24.630538949s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "womtool", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/womtool.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_womtool/app/womtool_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "zdb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/zdb.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_zdb/app/zdb_server.py", + "dockerfile_ready": true + } +] \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_3_of_4.json b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_3_of_4.json new file mode 100644 index 0000000000000000000000000000000000000000..12e1762d5272731e467beaa8641f0938620aceb9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/conversion_report.shard_3_of_4.json @@ -0,0 +1,2108 @@ +[ + { + "tool_name": "adapterremoval", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/adapterremoval.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "aragorn", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/aragorn.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "art", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/art.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "augur", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/augur.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bcbio-gff", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bcbio-gff.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bcbio-gff/app/bcbio-gff_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioawk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioawk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioawk/app/bioawk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconda-utils", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconda-utils.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconda-utils/app/bioconda-utils_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-alabaster.sfe", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-alabaster.sfe.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-alabaster.sfe/app/bioconductor-alabaster.sfe_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-annotationhub", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-annotationhub.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=2): Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-benchdamic", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-benchdamic.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-benchdamic/app/bioconductor-benchdamic_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-biomformat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-biomformat.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-biomformat/app/bioconductor-biomformat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-bsgenome", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-bsgenome.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-bsgenome/app/bioconductor-bsgenome_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-cdi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-cdi.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-cdi/app/bioconductor-cdi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-clusterfoldsimilarity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-clusterfoldsimilarity.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-clusterfoldsimilarity/app/bioconductor-clusterfoldsimilarity_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-concordexr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-concordexr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-concordexr/app/bioconductor-concordexr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-curatedatlasqueryr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-curatedatlasqueryr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-curatedatlasqueryr/app/bioconductor-curatedatlasqueryr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-decontam", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-decontam.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-decontam/app/bioconductor-decontam_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-delayedmatrixstats", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-delayedmatrixstats.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-delayedmatrixstats/app/bioconductor-delayedmatrixstats_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-dino", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-dino.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-dino/app/bioconductor-dino_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ebseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ebseq.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "bioconductor-escher", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-escher.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-escher/app/bioconductor-escher_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-geneplotter", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-geneplotter.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-geneplotter/app/bioconductor-geneplotter_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-genomicfeatures", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-genomicfeatures.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-genomicfeatures/app/bioconductor-genomicfeatures_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-ggspavis", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-ggspavis.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-ggspavis/app/bioconductor-ggspavis_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-gosemsim", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-gosemsim.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-gosemsim/app/bioconductor-gosemsim_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-hoodscanr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-hoodscanr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-hoodscanr/app/bioconductor-hoodscanr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-impute", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-impute.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-impute/app/bioconductor-impute_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-jazzpanda", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-jazzpanda.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-jazzpanda/app/bioconductor-jazzpanda_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mastr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mastr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mastr/app/bioconductor-mastr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-mia", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-mia.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-mia/app/bioconductor-mia_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-multiassayexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-multiassayexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-multiassayexperiment/app/bioconductor-multiassayexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-noiseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-noiseq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-noiseq/app/bioconductor-noiseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-org.mm.eg.db", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-org.mm.eg.db.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-org.mm.eg.db/app/bioconductor-org.mm.eg.db_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-poem", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-poem.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-poem/app/bioconductor-poem_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rbgl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rbgl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rbgl/app/bioconductor-rbgl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rhdf5", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rhdf5.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rhdf5/app/bioconductor-rhdf5_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-rsamtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-rsamtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-rsamtools/app/bioconductor-rsamtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-s4vectors", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-s4vectors.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-s4vectors/app/bioconductor-s4vectors_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scarray.sat", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scarray.sat.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scarray.sat/app/bioconductor-scarray.sat_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scdotplot", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scdotplot.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scdotplot/app/bioconductor-scdotplot_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scran", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scran.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scran/app/bioconductor-scran_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-scvir", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-scvir.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-scvir/app/bioconductor-scvir_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-singlecellexperiment", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-singlecellexperiment.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-singlecellexperiment/app/bioconductor-singlecellexperiment_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-sosta", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-sosta.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-sosta/app/bioconductor-sosta_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spari", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spari.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spari/app/bioconductor-spari_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialdatasets", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialdatasets.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialdatasets/app/bioconductor-spatialdatasets_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialfda", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialfda.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialfda/app/bioconductor-spatialfda_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spatialsimgp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spatialsimgp.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spatialsimgp/app/bioconductor-spatialsimgp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-spoon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-spoon.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-spoon/app/bioconductor-spoon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-statial", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-statial.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-statial/app/bioconductor-statial_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-subcellularspatialdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-subcellularspatialdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-subcellularspatialdata/app/bioconductor-subcellularspatialdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tenxvisiumdata", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tenxvisiumdata.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tenxvisiumdata/app/bioconductor-tenxvisiumdata_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-tpsvg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-tpsvg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-tpsvg/app/bioconductor-tpsvg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-variantannotation", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-variantannotation.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-variantannotation/app/bioconductor-variantannotation_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-voyager", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-voyager.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-voyager/app/bioconductor-voyager_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bioconductor-xenlite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bioconductor-xenlite.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bioconductor-xenlite/app/bioconductor-xenlite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "biopython", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/biopython.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_biopython/app/biopython_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bowtie2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bowtie2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bowtie2/app/bowtie2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "bx-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/bx-python.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_bx-python/app/bx-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cdbtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cdbtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cdbtools/app/cdbtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cellsnake", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cellsnake.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cellsnake/app/cellsnake_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "circexplorer2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/circexplorer2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_circexplorer2/app/circexplorer2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cmappy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cmappy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cmappy/app/cmappy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "constellations", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/constellations.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_constellations/app/constellations_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cosg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cosg.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cosg/app/cosg_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "crisprme", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/crisprme.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_crisprme/app/crisprme_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "cwltool", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/cwltool.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_cwltool/app/cwltool_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ddocent", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ddocent.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ddocent/app/ddocent_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "delly", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/delly.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_delly/app/delly_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "doubletdetection", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/doubletdetection.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_doubletdetection/app/doubletdetection_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "easy_vitessce", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/easy_vitessce.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_easy_vitessce/app/easy_vitessce_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ensembl-vep", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ensembl-vep.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ensembl-vep/app/ensembl-vep_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "eva-sub-cli", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/eva-sub-cli.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_eva-sub-cli/app/eva-sub-cli_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fastani", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fastani.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fastani/app/fastani_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "fasttree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/fasttree.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_fasttree/app/fasttree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "flagx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/flagx.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_flagx/app/flagx_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ftputil", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ftputil.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ftputil/app/ftputil_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gatk4", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gatk4.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gatk4/app/gatk4_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gemini", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gemini.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "genenotebook", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genenotebook.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "genometools-genometools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/genometools-genometools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_genometools-genometools/app/genometools-genometools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gimmemotifs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gimmemotifs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gimmemotifs/app/gimmemotifs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gnuplot", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gnuplot.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gnuplot/app/gnuplot_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "gromacs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/gromacs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_gromacs/app/gromacs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hhsuite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hhsuite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_hhsuite/app/hhsuite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "hmmer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/hmmer.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_hmmer/app/hmmer_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "humann2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/humann2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_humann2/app/humann2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "illumina-interop", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/illumina-interop.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_illumina-interop/app/illumina-interop_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "involucro", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/involucro.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_involucro/app/involucro_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "iqtree", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/iqtree.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_iqtree/app/iqtree_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "java-jdk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/java-jdk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_java-jdk/app/java-jdk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "jq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/jq.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_jq/app/jq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kallisto", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kallisto.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kallisto/app/kallisto_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "kmc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/kmc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_kmc/app/kmc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "last", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/last.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_last/app/last_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "libdb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/libdb.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "macs2", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/macs2.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_macs2/app/macs2_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mappy", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mappy.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mappy/app/mappy_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mcl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mcl.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "mentalist", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mentalist.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mentalist/app/mentalist_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mikado", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mikado.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mikado/app/mikado_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "minvar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/minvar.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_minvar/app/minvar_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mmtf-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mmtf-python.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mmtf-python/app/mmtf-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "mothur", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/mothur.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_mothur/app/mothur_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "multiqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/multiqc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_multiqc/app/multiqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "munkres", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/munkres.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_munkres/app/munkres_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nanocomp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nanocomp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nanocomp/app/nanocomp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nanopolish", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nanopolish.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nanopolish/app/nanopolish_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ncbi-ngs-sdk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ncbi-ngs-sdk.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ncbi-ngs-sdk/app/ncbi-ngs-sdk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "nextclade", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/nextclade.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_nextclade/app/nextclade_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ngmlr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ngmlr.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ngmlr/app/ngmlr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "novoalign", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/novoalign.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_novoalign/app/novoalign_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "orthofinder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/orthofinder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_orthofinder/app/orthofinder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "paml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/paml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_paml/app/paml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pangolin", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pangolin.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "refine failed (retry=1): Gemini request failed across all models. gemini-2.5-pro: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "paste-bio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/paste-bio.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_paste-bio/app/paste-bio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "peptides", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/peptides.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_peptides/app/peptides_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-alien-build", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-alien-build.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-appconfig", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-appconfig.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-appconfig/app/perl-appconfig_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-base", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-base.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-base/app/perl-base_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-featureio", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-featureio.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-featureio/app/perl-bio-featureio_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bio-tools-phylo-paml", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bio-tools-phylo-paml.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bio-tools-phylo-paml/app/perl-bio-tools-phylo-paml_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-bioperl-core", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-bioperl-core.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-bioperl-core/app/perl-bioperl-core_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-cache-cache", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-cache-cache.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-cache-cache/app/perl-cache-cache_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-class-data-inheritable", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-class-data-inheritable.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-class-data-inheritable/app/perl-class-data-inheritable_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-class-method-modifiers", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-class-method-modifiers.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-class-method-modifiers/app/perl-class-method-modifiers_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-compress-raw-zlib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-compress-raw-zlib.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-compress-raw-zlib/app/perl-compress-raw-zlib_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-convert-binhex", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-convert-binhex.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-convert-binhex/app/perl-convert-binhex_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-data-dumper", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-data-dumper.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-data-dumper/app/perl-data-dumper_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-db-file", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-db-file.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-db-file/app/perl-db-file_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-devel-globaldestruction", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-devel-globaldestruction.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-digest-md5", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-digest-md5.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-digest-md5/app/perl-digest-md5_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-dynaloader", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-dynaloader.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-error", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-error.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-error/app/perl-error_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-exporter-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-exporter-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-exporter-tiny/app/perl-exporter-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-extutils-parsexs", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-extutils-parsexs.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-extutils-parsexs/app/perl-extutils-parsexs_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-slurp-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-slurp-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-slurp-tiny/app/perl-file-slurp-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-file-which", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-file-which.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-file-which/app/perl-file-which_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-getopt-long", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-getopt-long.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-getopt-long/app/perl-getopt-long_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-entities-numbered", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-entities-numbered.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-entities-numbered/app/perl-html-entities-numbered_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-html-tagset", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-html-tagset.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-html-tagset/app/perl-html-tagset_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-http-cookies", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-http-cookies.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-http-cookies/app/perl-http-cookies_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-http-negotiate", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-http-negotiate.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-http-negotiate/app/perl-http-negotiate_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-compress", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-compress.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-compress/app/perl-io-compress_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-io-string", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-io-string.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-io-string/app/perl-io-string_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-ipc-cmd", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ipc-cmd.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-ipc-cmd/app/perl-ipc-cmd_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-json", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-json.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-json/app/perl-json_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-libwww-perl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-libwww-perl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-libwww-perl/app/perl-libwww-perl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-locale-maketext-simple", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-locale-maketext-simple.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-locale-maketext-simple/app/perl-locale-maketext-simple_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mailtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mailtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mailtools/app/perl-mailtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-math-random", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-math-random.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-math-random/app/perl-math-random_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mce", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mce.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mce/app/perl-mce_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mime-types", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mime-types.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-mime-types/app/perl-mime-types_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-implementation", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-implementation.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-implementation/app/perl-module-implementation_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-module-runtime", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-module-runtime.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-module-runtime/app/perl-module-runtime_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-mozilla-ca", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-mozilla-ca.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h51m35.507712077s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-ntlm", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-ntlm.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-ntlm/app/perl-ntlm_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-package-stash", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-package-stash.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-package-stash/app/perl-package-stash_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-params-util", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-params-util.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-params-util/app/perl-params-util_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-path-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-path-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-path-tiny/app/perl-path-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-pod-escapes", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-pod-escapes.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-pod-escapes/app/perl-pod-escapes_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-regexp-common", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-regexp-common.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-regexp-common/app/perl-regexp-common_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sereal-decoder", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sereal-decoder.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sereal-decoder/app/perl-sereal-decoder_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-set-scalar", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-set-scalar.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h37m47.390002612s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-spreadsheet-parseexcel", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-spreadsheet-parseexcel.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-spreadsheet-parseexcel/app/perl-spreadsheet-parseexcel_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-storable", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-storable.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-storable/app/perl-storable_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-sub-install", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-sub-install.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-sub-install/app/perl-sub-install_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-svg", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-svg.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h34m36.453030836s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-term-table", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-term-table.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-term-table/app/perl-term-table_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-exception", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-exception.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-exception/app/perl-test-exception_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test-more", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test-more.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test-more/app/perl-test-more_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-test2-suite", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-test2-suite.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-test2-suite/app/perl-test2-suite_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-text-parsewords", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-text-parsewords.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h33m9.709708464s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-time-local", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-time-local.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-time-local/app/perl-time-local_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-type-tiny", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-type-tiny.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-type-tiny/app/perl-type-tiny_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-url-encode", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-url-encode.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-url-encode/app/perl-url-encode_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-dom-xpath", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-dom-xpath.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h31m39.277195145s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "perl-xml-namespacesupport", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-namespacesupport.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-namespacesupport/app/perl-xml-namespacesupport_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-sax-base", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-sax-base.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-sax-base/app/perl-xml-sax-base_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xml-twig", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xml-twig.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xml-twig/app/perl-xml-twig_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "perl-xsloader", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/perl-xsloader.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_perl-xsloader/app/perl-xsloader_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "picard", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/picard.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h29m37.050845345s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "planemo", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/planemo.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h26m35.864337402s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "pplacer", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pplacer.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h20m35.476439951s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "prodigal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/prodigal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_prodigal/app/prodigal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "proteomiqon-peptidedb", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/proteomiqon-peptidedb.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_proteomiqon-peptidedb/app/proteomiqon-peptidedb_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pybedtools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pybedtools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pybedtools/app/pybedtools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyfastx", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyfastx.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyfastx/app/pyfastx_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyrodigal", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyrodigal.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyrodigal/app/pyrodigal_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyspoa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyspoa.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_pyspoa/app/pyspoa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "pyvcf", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/pyvcf.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h14m45.164592141s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "qualimap", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/qualimap.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_qualimap/app/qualimap_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-archr", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-archr.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-archr/app/r-archr_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-cdseq", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-cdseq.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-cdseq/app/r-cdseq_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-goalie", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-goalie.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-goalie/app/r-goalie_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "r-saige", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-saige.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h13m15.575664185s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "r-seurat-disk", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/r-seurat-disk.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_r-seurat-disk/app/r-seurat-disk_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "repeatmasker", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/repeatmasker.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_repeatmasker/app/repeatmasker_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "rpsbproc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rpsbproc.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h9m27.688191477s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "rseqc", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/rseqc.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_rseqc/app/rseqc_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "salmon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/salmon.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h8m42.829184629s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValue | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "samsift", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/samsift.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_samsift/app/samsift_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scanpy-cli", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scanpy-cli.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scanpy-cli/app/scanpy-cli_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scglue", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scglue.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scglue/app/scglue_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scrnasim-toolz", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scrnasim-toolz.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scrnasim-toolz/app/scrnasim-toolz_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scvi", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scvi.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scvi/app/scvi_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "scxmatch", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/scxmatch.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_scxmatch/app/scxmatch_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "segemehl", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/segemehl.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_segemehl/app/segemehl_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "seqcluster", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/seqcluster.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_seqcluster/app/seqcluster_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sevenbridges-python", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sevenbridges-python.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sevenbridges-python/app/sevenbridges-python_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sina", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sina.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sina/app/sina_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snakemake-interface-common", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-interface-common.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h2m14.679779784s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "snakemake-interface-storage-plugins", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snakemake-interface-storage-plugins.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_snakemake-interface-storage-plugins/app/snakemake-interface-storage-plugins_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "snap-aligner", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/snap-aligner.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 9h1m8.974756204s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue\" | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "sopa", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sopa.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sopa/app/sopa_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "spades", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/spades.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_spades/app/spades_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "sra-tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/sra-tools.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_sra-tools/app/sra-tools_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "stream", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/stream.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_stream/app/stream_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "t-coffee", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/t-coffee.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_t-coffee/app/t-coffee_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "talon", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/talon.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_talon/app/talon_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "tidyp", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/tidyp.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_tidyp/app/tidyp_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "toil", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/toil.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h57m55.421701659s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "trim-galore", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trim-galore.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_trim-galore/app/trim-galore_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "trinity", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/trinity.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_trinity/app/trinity_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-cell-browser", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-cell-browser.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-cell-browser/app/ucsc-cell-browser_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "ucsc-nibfrag", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/ucsc-nibfrag.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ucsc-nibfrag/app/ucsc-nibfrag_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "umi_tools", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/umi_tools.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h52m17.414350332s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "unifrac-binaries", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/unifrac-binaries.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h49m16.751535117s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"model\": \"gemini-2.5-pro\",\n \"location\": \"global\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "vardict", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vardict.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h46m15.57070175s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValue | gemini-3-flash-preview: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n | gemini-2.5-flash: HTTP 400 - {\n \"error\": {\n \"code\": 400,\n \"message\": \"User location is not supported for the API use.\",\n \"status\": \"FAILED_PRECONDITION\"\n }\n}\n", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "vcflib", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vcflib.manual_bundle.txt", + "run_help_command": false, + "status": "failed", + "error": "autogenerate_mcp_tool failed: Gemini request failed across all models. gemini-2.5-pro: HTTP 429 - {\n \"error\": {\n \"code\": 429,\n \"message\": \"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/rate-limit. \\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_requests_per_model_per_day, limit: 1000, model: gemini-2.5-pro\\nPlease retry in 8h46m14.389921185s.\",\n \"status\": \"RESOURCE_EXHAUSTED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.Help\",\n \"links\": [\n {\n \"description\": \"Learn more about Gemini API quotas\",\n \"url\": \"https://ai.google.dev/gemini-api/docs/rate-limits\"\n }\n ]\n },\n {\n \"@type\": \"type.googleapis.com/google.rpc.QuotaFailure\",\n \"violations\": [\n {\n \"quotaMetric\": \"generativelanguage.googleapis.com/generate_requests_per_model_per_day\",\n \"quotaId\": \"GenerateRequestsPerDayPerProjectPerModel\",\n \"quotaDimensions\": {\n \"location\": \"global\",\n \"model\": \"gemini-2.5-pro\"\n },\n \"quotaValu | gemini-3-flash-preview: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180) | gemini-2.5-flash: exception HTTPSConnectionPool(host='generativelanguage.googleapis.com', port=443): Read timed out. (read timeout=180)", + "output_file": "", + "dockerfile_ready": false + }, + { + "tool_name": "viennarna", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/viennarna.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_viennarna/app/viennarna_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "vt", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/vt.manual_bundle.txt", + "run_help_command": false, + "status": "success", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_vt/app/vt_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "xclone", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/xclone.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_xclone/app/xclone_server.py", + "dockerfile_ready": true + }, + { + "tool_name": "zol", + "manual": "/225040511/project/BioScientist/agent_system/toolbase/output/help_docs/manual_bundle_txt/zol.manual_bundle.txt", + "run_help_command": false, + "status": "skipped_existing", + "error": "", + "output_file": "/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_zol/app/zol_server.py", + "dockerfile_ready": true + } +] \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cd01f9cbec8f3bce79ad6a844511be3cc039a84e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install abnumber via conda (e.g., from bioconda) +RUN conda install -c bioconda abnumber -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/abnumber_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/abnumber_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/abnumber_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_server.py new file mode 100644 index 0000000000000000000000000000000000000000..48037b6a07a9bac7441cc7b93a0f7c31c07893bc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_server.py @@ -0,0 +1,116 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Literal + +# from mcp import tool + +@mcp.tool() +def abnumber( + input_file: Path, + outfile: Optional[Path] = None, + scheme: Literal['imgt', 'kabat', 'chothia', 'contact', 'aho', 'martin'] = 'imgt', + chain_type: Literal['H', 'K', 'L'] = 'H', + header: bool = False, + regions: bool = False, + seq: bool = False, + scheme_out: bool = False, + chain_out: bool = False, + species_out: bool = False, + gene_out: bool = False, + score_out: bool = False, + bitscore_out: bool = False, + evalue_out: bool = False, +): + """ + Number antibody sequences from a FASTA file using ANARCI. + + This tool is a command-line wrapper for the AbNumber Python library, which + uses ANARCI for antibody numbering. It takes a FASTA file as input and + produces a table with numbered sequences and other annotations. + + Args: + input_file: FASTA file with sequences to number. + outfile: Output file path. If not provided, output is sent to stdout. + scheme: Numbering scheme to use. + chain_type: Chain type to assign if not determined by ANARCI. + header: Print a header in the output table. + regions: Print CDR/FR regions instead of the numbered sequence. + seq: Print the original sequence in the output. + scheme_out: Print the numbering scheme in the output. + chain_out: Print the chain type in the output. + species_out: Print the species in the output. + gene_out: Print the V/J genes in the output. + score_out: Print the ANARCI score in the output. + bitscore_out: Print the ANARCI bitscore in the output. + evalue_out: Print the ANARCI E-value in the output. + """ + # Input validation + if not input_file.is_file(): + raise FileNotFoundError(f"Input file not found: {input_file}") + + # Command construction + cmd = ["abnumber", str(input_file)] + + # Add optional arguments + cmd.extend(["--scheme", scheme]) + cmd.extend(["--chain_type", chain_type]) + + if outfile: + cmd.extend(["--outfile", str(outfile)]) + + # Add boolean flags + if header: + cmd.append("--header") + if regions: + cmd.append("--regions") + if seq: + cmd.append("--seq") + if scheme_out: + cmd.append("--scheme-out") + if chain_out: + cmd.append("--chain-out") + if species_out: + cmd.append("--species-out") + if gene_out: + cmd.append("--gene-out") + if score_out: + cmd.append("--score-out") + if bitscore_out: + cmd.append("--bitscore-out") + if evalue_out: + cmd.append("--evalue-out") + + command_executed = " ".join(cmd) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'abnumber' command not found. Ensure the tool is installed and in your system's PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # Structured result return + output_files = [str(outfile)] if outfile else [] + + return { + "command_executed": command_executed, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..68ff8ce0a11b386454b1646238748032ddbaa0e9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/abnumber_server.py') +SERVER_NAME = 'biosci_abnumber' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..1c1cf2410c6d106a8cd16726e9612543f16ce182 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-abnumber: + build: . + image: mcp-abnumber:latest + container_name: mcp-abnumber + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=abnumber + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8910394aedb7cbba55a73abc6369cebc6354099f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - abnumber + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abnumber/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bc78456a5998f49a3ff5fd8ada97792743f205b2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install abricate via conda (e.g., from bioconda) +RUN conda install -c bioconda abricate -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/abricate_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/abricate_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/abricate_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_server.py new file mode 100644 index 0000000000000000000000000000000000000000..89134cd79505e2215ab2a24e1426990d92a0da9d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_server.py @@ -0,0 +1,399 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional, Dict, Any + +# Note: The @mcp.tool decorator is commented out as the mcp library is not available here. +# In a real MCP environment, you would uncomment these lines. + +# @mcp.tool() +def run_abricate( + input_files: List[Path], + fofn: Optional[Path] = None, + output_file: Optional[Path] = None, + db: str = "ncbi", + datadir: Optional[Path] = None, + threads: int = 8, + minid: float = 75.0, + mincov: float = 75.0, + nuc: bool = False, + csv: bool = False, + noheader: bool = False, + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Runs Abricate to screen contigs for antimicrobial resistance or virulence genes. + + Args: + input_files: List of input contig files (e.g., FASTA, GenBank). + fofn: File containing a list of input file names. Mutually exclusive with input_files. + output_file: Output file path. If not provided, results are sent to stdout. + db: Database to use. Defaults to 'ncbi'. + Known databases: ncbi, card, argannot, resfinder, megares, ecoh, + plasmidfinder, vfdb, ecoli_vf, victors, bacmet. + datadir: Path to the database directory. + threads: Number of BLAST threads to use. + minid: Minimum percentage identity to report. + mincov: Minimum percentage coverage to report. + nuc: Force nucleotide database. + csv: Output in CSV format instead of TSV. + noheader: Do not print the header line in the output. + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # Input validation + if not input_files and not fofn: + raise ValueError("Either 'input_files' or 'fofn' must be provided.") + if input_files and fofn: + raise ValueError("'input_files' and 'fofn' are mutually exclusive.") + + if input_files: + for f in input_files: + if not f.is_file(): + raise FileNotFoundError(f"Input file not found: {f}") + if fofn and not fofn.is_file(): + raise FileNotFoundError(f"FOFN file not found: {fofn}") + + if not (0.0 <= minid <= 100.0): + raise ValueError("'minid' must be between 0.0 and 100.0.") + if not (0.0 <= mincov <= 100.0): + raise ValueError("'mincov' must be between 0.0 and 100.0.") + if threads <= 0: + raise ValueError("'threads' must be a positive integer.") + + cmd = ["abricate"] + + # Add options + cmd.extend(["--db", db]) + cmd.extend(["--threads", str(threads)]) + cmd.extend(["--minid", str(minid)]) + cmd.extend(["--mincov", str(mincov)]) + + if datadir: + cmd.extend(["--datadir", str(datadir)]) + if output_file: + cmd.extend(["--output", str(output_file)]) + if fofn: + cmd.extend(["--fofn", str(fofn)]) + + # Add boolean flags + if nuc: + cmd.append("--nuc") + if csv: + cmd.append("--csv") + if noheader: + cmd.append("--noheader") + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + # Add positional input files + if input_files: + cmd.extend([str(f) for f in input_files]) + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files_list = [str(output_file)] if output_file else [] + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Abricate failed with exit code {e.returncode}", + "output_files": [], + } + + +# @mcp.tool() +def list_databases( + datadir: Optional[Path] = None, + csv: bool = False, + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Lists the available Abricate databases. + + Args: + datadir: Path to the database directory. + csv: Output in CSV format instead of TSV. + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["abricate", "--list"] + + if datadir: + cmd.extend(["--datadir", str(datadir)]) + if csv: + cmd.append("--csv") + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Abricate --list failed with exit code {e.returncode}", + "output_files": [], + } + + +# @mcp.tool() +def summarize_reports( + report_files: List[Path], + output_file: Optional[Path] = None, + use_identity: bool = False, + noheader: bool = False, + csv: bool = False, + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Creates a summary report (presence/absence matrix) from multiple Abricate reports. + + Args: + report_files: List of input Abricate report files (.tab or .csv). + output_file: Output summary file path. If not provided, results are sent to stdout. + use_identity: Use %IDENTITY instead of %COVERAGE for the matrix values. + noheader: Do not print the header line in the output. + csv: Expect CSV input and produce CSV output. + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + if not report_files: + raise ValueError("At least one report file must be provided.") + for f in report_files: + if not f.is_file(): + raise FileNotFoundError(f"Report file not found: {f}") + + cmd = ["abricate", "--summary"] + + if output_file: + cmd.extend(["--output", str(output_file)]) + if use_identity: + cmd.append("--identity") + if noheader: + cmd.append("--noheader") + if csv: + cmd.append("--csv") + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + cmd.extend([str(f) for f in report_files]) + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files_list = [str(output_file)] if output_file else [] + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": output_files_list, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Abricate --summary failed with exit code {e.returncode}", + "output_files": [], + } + + +# @mcp.tool() +def setup_databases( + datadir: Optional[Path] = None, + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Sets up (downloads and formats) all the bundled Abricate databases. + + Args: + datadir: Path to the database directory. + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["abricate", "--setupdb"] + + if datadir: + cmd.extend(["--datadir", str(datadir)]) + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Abricate --setupdb failed with exit code {e.returncode}", + "output_files": [], + } + + +# @mcp.tool() +def check_dependencies( + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Checks if all of Abricate's dependencies are installed and accessible. + + Args: + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["abricate", "--check"] + + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"Abricate --check failed with exit code {e.returncode}", + "output_files": [], + } + + +# @mcp.tool() +def get_database( + db: str, + datadir: Optional[Path] = None, + force: bool = False, + quiet: bool = False, + debug: bool = False, +) -> Dict[str, Any]: + """ + Downloads or updates a specific Abricate database using abricate-get_db. + + Args: + db: Name of the database to download/update. + datadir: Path to the database directory. + force: Force download even if the database already exists. + quiet: Suppress progress messages on stderr. + debug: Print debug information. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + if not db: + raise ValueError("'db' parameter cannot be empty.") + + cmd = ["abricate-get_db"] + + cmd.extend(["--db", db]) + + if datadir: + cmd.extend(["--datadir", str(datadir)]) + if force: + cmd.append("--force") + if quiet: + cmd.append("--quiet") + if debug: + cmd.append("--debug") + + try: + process = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": process.stdout, + "stderr": process.stderr, + "output_files": [], + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"abricate-get_db failed with exit code {e.returncode}", + "output_files": [], + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..8711dfee821b715ed905c82d60a3d30939783f14 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/abricate_server.py') +SERVER_NAME = 'biosci_abricate' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..25d08563f248d4ab61d3ba9b635b6b247e146585 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-abricate: + build: . + image: mcp-abricate:latest + container_name: mcp-abricate + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=abricate + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f0f68a700d628cf83ac3fc3fc16dfa480ea43461 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - abricate + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abricate/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bef882fc9d87ab2e0ff61be73df1c30027f57489 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install abundancebin via conda (e.g., from bioconda) +RUN conda install -c bioconda abundancebin -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/abundancebin_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/abundancebin_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/abundancebin_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_server.py new file mode 100644 index 0000000000000000000000000000000000000000..db005e78c0b54f4f26e71ea9a203981367b36b0c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_server.py @@ -0,0 +1,134 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import Optional, List + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be imported from the MCP library. +def tool(*args, **kwargs): + def decorator(f): + return f + return decorator + +mcp = type("mcp", (), {"tool": tool}) + + +@mcp.tool() +def abundancebin( + input_file: Path, + kmer_len: int = 20, + output: Optional[Path] = None, + exclude: Optional[int] = None, + exclude_max: Optional[int] = None, + output_fasta: bool = False, + bin_num: Optional[int] = None, + recursive_classification: bool = False, +): + """ + Bins sequences based on k-mer composition and abundance. + + This tool can either classify sequences into a predefined number of bins + or use a recursive classification approach. + + Args: + input_file: Path to the input filename. + kmer_len: Composition length (k-mer size). Defaults to 20. + output: Path to the output file. Defaults to inputfile.log. + exclude: Exclude sequences with a count below this value. + exclude_max: Exclude sequences with a count above this value. + output_fasta: If set, output results in FASTA format. + bin_num: The number of bins to classify sequences into. + recursive_classification: If set, undergo recursive classification. + Cannot be used with bin_num. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # --- Input Validation --- + if not input_file.is_file(): + raise FileNotFoundError(f"Input file not found: {input_file}") + + if kmer_len <= 0: + raise ValueError("kmer_len must be a positive integer.") + + if exclude is not None and exclude < 0: + raise ValueError("The 'exclude' count must be a non-negative integer.") + + if exclude_max is not None and exclude_max < 0: + raise ValueError("The 'exclude_max' count must be a non-negative integer.") + + if bin_num is not None and bin_num <= 0: + raise ValueError("The 'bin_num' must be a positive integer.") + + if bin_num is not None and recursive_classification: + raise ValueError( + "Cannot specify both 'bin_num' and 'recursive_classification'. " + "Please choose one method for classification." + ) + + # --- Command Construction --- + cmd = ["abundancebin"] + + cmd.extend(["-input", str(input_file)]) + + # Handle default output file path + if output: + output_path = output + else: + output_path = input_file.with_suffix('.log') + + cmd.extend(["-output", str(output_path)]) + + cmd.extend(["-kmer_len", str(kmer_len)]) + + if exclude is not None: + cmd.extend(["-exclude", str(exclude)]) + + if exclude_max is not None: + cmd.extend(["-exclude_max", str(exclude_max)]) + + if output_fasta: + cmd.append("-OUTPUT_FASTA") + + if bin_num is not None: + cmd.extend(["-bin_num", str(bin_num)]) + + if recursive_classification: + cmd.append("-RECURSIVE_CLASSIFICATION") + + command_executed = " ".join(cmd) + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + stdout = result.stdout + stderr = result.stderr + except FileNotFoundError: + return { + "command_executed": command_executed, + "stdout": "", + "stderr": "Error: 'abundancebin' command not found. Make sure it is installed and in your PATH.", + "output_files": [] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": command_executed, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [] + } + + # --- Structured Result Return --- + output_files = [str(output_path)] if output_path.exists() else [] + + return { + "command_executed": command_executed, + "stdout": stdout, + "stderr": stderr, + "output_files": output_files + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..025ddd800f4e711f69e41e76e41f16d4f7adb0b4 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/abundancebin_server.py') +SERVER_NAME = 'biosci_abundancebin' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..c3e728f0802fb0284f48f87c588f826b60f324c2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-abundancebin: + build: . + image: mcp-abundancebin:latest + container_name: mcp-abundancebin + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=abundancebin + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fb3f2d4c33b5cfc882a79148b0d58be0b05b89bc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - abundancebin + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abundancebin/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0cf551459d3b438e84031a5bff03697c1e228449 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install abyss via conda (e.g., from bioconda) +RUN conda install -c bioconda abyss -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY abyss_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/abyss_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/abyss_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_server.py new file mode 100644 index 0000000000000000000000000000000000000000..7165bb9db891497a58a0608d06bd24cda310db5e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_server.py @@ -0,0 +1,390 @@ +import subprocess +import logging +import shlex +from pathlib import Path +from typing import List, Optional, Dict + +# It is assumed that the mcp.tool decorator is available in the execution environment. +# Since we cannot import it, we will define a dummy decorator to make the code runnable standalone. +class mcp: + def tool(func): + return func + +@mcp.tool +def abyss_pe( + name: str, + k: int, + output_dir: Path, + input_files: Optional[List[Path]] = None, + paired_end_libs: Optional[Dict[str, List[Path]]] = None, + mate_pair_libs: Optional[Dict[str, List[Path]]] = None, + single_end_files: Optional[List[Path]] = None, + long_read_files: Optional[List[Path]] = None, + transcriptome_libs: Optional[Dict[str, List[Path]]] = None, + colour_space_fasta: Optional[Path] = None, + bloom_size: Optional[str] = None, + bloom_hashes: Optional[int] = None, + kmer_cleaning_threshold: Optional[int] = None, + processes: int = 1, + threads: int = 1, + min_mean_kmer_coverage: Optional[float] = None, + max_bubble_error_rate: Optional[float] = None, + min_erosion_kmer_coverage: Optional[int] = None, + min_erosion_kmer_coverage_pe: Optional[int] = None, + min_alignment_length: Optional[int] = None, + min_pairs_to_merge_contig: Optional[int] = None, + min_pairs_to_merge_bubble: Optional[int] = None, + min_pairs_to_scaffold: Optional[int] = None, + min_alignment_identity: Optional[float] = None, + min_base_quality: Optional[int] = None, + trim_quality: Optional[int] = None, + min_unitig_size_for_scaffold: Optional[int] = None, + min_contig_size_for_scaffold: Optional[int] = None, + min_tip_length: Optional[int] = None, + verbose: bool = False, + chastity: bool = False, + trim_masked: bool = False, + standard_quality: bool = False, + illumina_quality: bool = False, + no_scaffold: bool = False, + no_bubbles: bool = False, + no_merge: bool = False, + no_cleanup: bool = False, + coverage_hist_file: Optional[Path] = None, + aligner: Optional[str] = None, + graph_format: Optional[str] = None, + path_cov_hist_file: Optional[Path] = None, +): + """ + Run the ABySS paired-end (or single-end) de novo sequence assembler pipeline. + + This tool assembles short reads into contigs and scaffolds. It supports various + types of sequencing data, including paired-end, single-end, and mate-pair libraries. + + Args: + name: The base name for output files (e.g., 'ecoli_assembly'). + k: The k-mer size for assembly. Must be an odd integer. + output_dir: The directory where all output and intermediate files will be stored. + input_files: A list of input read files (FASTA/FASTQ, can be gzipped). Used for the 'in' parameter. + paired_end_libs: A dictionary defining paired-end libraries. Key is the library name, value is a list of file paths. + mate_pair_libs: A dictionary defining mate-pair libraries. + single_end_files: A list of single-end read files. + long_read_files: A list of long read files (e.g., PacBio, Nanopore). + transcriptome_libs: A dictionary defining paired-end transcriptome libraries. + colour_space_fasta: Path to a colour-space FASTA file. + bloom_size: Bloom filter size. Use suffixes K, M, G (e.g., '10G'). + bloom_hashes: The number of hash functions for the Bloom filter. + kmer_cleaning_threshold: K-mer cleaning threshold for `abyss-filter`. + processes: Number of processes to use for the parallel MPI job (ABYSS-P). + threads: Number of threads to use for tools that support it (e.g., abyss-map). + min_mean_kmer_coverage: Minimum mean k-mer coverage of a unitig. + max_bubble_error_rate: Maximum error rate of a bubble. + min_erosion_kmer_coverage: Minimum erosion k-mer coverage. + min_erosion_kmer_coverage_pe: Minimum erosion k-mer coverage for paired-end reads. + min_alignment_length: Minimum alignment length of a read. + min_pairs_to_merge_contig: Minimum number of pairs to merge a contig. + min_pairs_to_merge_bubble: Minimum number of pairs to merge a bubble. + min_pairs_to_scaffold: Minimum number of pairs to build a scaffold. + min_alignment_identity: Minimum identity of a read alignment (0.0-1.0). + min_base_quality: Minimum base quality. + trim_quality: Trim bases from the ends of reads if their quality is less than this threshold. + min_unitig_size_for_scaffold: Minimum unitig size to build a scaffold. + min_contig_size_for_scaffold: Minimum contig size to build a scaffold. + min_tip_length: Minimum tip length to be trimmed. + verbose: Run in verbose mode. + chastity: Discard reads that fail the chastity filter. + trim_masked: Trim masked bases (N) from the ends of reads. + standard_quality: Use standard quality scores (ASCII+33). + illumina_quality: Use Illumina quality scores (ASCII+64). + no_scaffold: Do not scaffold. + no_bubbles: Do not run BubbleTree to pop bubbles. + no_merge: Do not merge contigs. + no_cleanup: Do not remove intermediate files. + coverage_hist_file: Path to output the coverage histogram. + aligner: Aligner to use. One of ['map', 'bwa', 'kaligner']. + graph_format: Output graph format. One of ['dot', 'adj', 'both']. + path_cov_hist_file: Path to output the path coverage histogram. + + Returns: + A dictionary containing the executed command, stdout, stderr, and a list of major output files. + """ + # --- Input Validation --- + if k % 2 == 0: + raise ValueError("k-mer size (k) must be an odd integer.") + if not name: + raise ValueError("'name' parameter cannot be empty.") + if not any([input_files, paired_end_libs, mate_pair_libs, single_end_files]): + raise ValueError("At least one set of input reads must be provided.") + if standard_quality and illumina_quality: + raise ValueError("Cannot set both --standard-quality and --illumina-quality.") + if aligner and aligner not in ['map', 'bwa', 'kaligner']: + raise ValueError("Invalid aligner. Must be one of ['map', 'bwa', 'kaligner'].") + if graph_format and graph_format not in ['dot', 'adj', 'both']: + raise ValueError("Invalid graph format. Must be one of ['dot', 'adj', 'both'].") + + # --- File and Directory Handling --- + output_dir.mkdir(parents=True, exist_ok=True) + + def validate_files(files: Optional[List[Path]]): + if files: + for f in files: + if not f.exists(): + raise FileNotFoundError(f"Input file not found: {f}") + + def validate_lib_files(libs: Optional[Dict[str, List[Path]]]): + if libs: + for lib_name, files in libs.items(): + validate_files(files) + + validate_files(input_files) + validate_files(single_end_files) + validate_files(long_read_files) + validate_lib_files(paired_end_libs) + validate_lib_files(mate_pair_libs) + validate_lib_files(transcriptome_libs) + if colour_space_fasta and not colour_space_fasta.exists(): + raise FileNotFoundError(f"Input file not found: {colour_space_fasta}") + + # --- Command Construction --- + cmd = ["abyss-pe", f"k={k}", f"name={name}", f"np={processes}", f"j={threads}"] + + all_lib_names = [] + + def add_library_args(libs: Optional[Dict[str, List[Path]]], prefix: str): + if libs: + lib_names = list(libs.keys()) + all_lib_names.extend(lib_names) + cmd.append(f"{prefix}='{' '.join(lib_names)}'") + for lib_name, files in libs.items(): + file_str = ' '.join(map(str, files)) + cmd.append(f"{lib_name}='{file_str}'") + + add_library_args(paired_end_libs, "pe") + add_library_args(mate_pair_libs, "mp") + add_library_args(transcriptome_libs, "ts") + + if all_lib_names: + cmd.append(f"lib='{' '.join(all_lib_names)}'") + + if input_files: + cmd.append(f"in='{' '.join(map(str, input_files))}'") + if single_end_files: + cmd.append(f"se='{' '.join(map(str, single_end_files))}'") + if long_read_files: + cmd.append(f"long='{' '.join(map(str, long_read_files))}'") + if colour_space_fasta: + cmd.append(f"cs={shlex.quote(str(colour_space_fasta))}") + + # Optional parameters + if bloom_size: cmd.append(f"B={bloom_size}") + if bloom_hashes: cmd.append(f"H={bloom_hashes}") + if kmer_cleaning_threshold: cmd.append(f"kc={kmer_cleaning_threshold}") + if min_mean_kmer_coverage: cmd.append(f"c={min_mean_kmer_coverage}") + if max_bubble_error_rate: cmd.append(f"d={max_bubble_error_rate}") + if min_erosion_kmer_coverage: cmd.append(f"e={min_erosion_kmer_coverage}") + if min_erosion_kmer_coverage_pe: cmd.append(f"E={min_erosion_kmer_coverage_pe}") + if min_alignment_length: cmd.append(f"l={min_alignment_length}") + if min_pairs_to_merge_contig: cmd.append(f"m={min_pairs_to_merge_contig}") + if min_pairs_to_merge_bubble: cmd.append(f"n={min_pairs_to_merge_bubble}") + if min_pairs_to_scaffold: cmd.append(f"N={min_pairs_to_scaffold}") + if min_alignment_identity: cmd.append(f"p={min_alignment_identity}") + if min_base_quality: cmd.append(f"q={min_base_quality}") + if trim_quality: cmd.append(f"Q={trim_quality}") + if min_unitig_size_for_scaffold: cmd.append(f"s={min_unitig_size_for_scaffold}") + if min_contig_size_for_scaffold: cmd.append(f"S={min_contig_size_for_scaffold}") + if min_tip_length: cmd.append(f"t={min_tip_length}") + if aligner: cmd.append(f"aligner={aligner}") + if graph_format: cmd.append(f"graph={graph_format}") + if coverage_hist_file: cmd.append(f"--coverage-hist={shlex.quote(str(coverage_hist_file))}") + if path_cov_hist_file: cmd.append(f"--path-cov-hist={shlex.quote(str(path_cov_hist_file))}") + + # Boolean flags + if verbose: cmd.append("v=-v") + if chastity: cmd.append("--chastity") + if trim_masked: cmd.append("--trim-masked") + if standard_quality: cmd.append("--standard-quality") + if illumina_quality: cmd.append("--illumina-quality") + if no_scaffold: cmd.append("--no-scaffold") + if no_bubbles: cmd.append("--no-bubbles") + if no_merge: cmd.append("--no-merge") + if no_cleanup: cmd.append("--no-cleanup") + + # --- Subprocess Execution --- + command_str = " ".join(cmd) + logging.info(f"Executing command: {command_str}") + try: + result = subprocess.run( + command_str, + shell=True, # abyss-pe uses shell features for file globbing and quoting + cwd=output_dir, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + logging.error(f"ABySS-PE failed with exit code {e.returncode}") + logging.error(f"Stdout: {e.stdout}") + logging.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": [], + "error": "ABySS-PE execution failed." + } + + # --- Structured Result Return --- + output_files = { + "scaffolds": output_dir / f"{name}-scaffolds.fa", + "contigs": output_dir / f"{name}-contigs.fa", + "unitigs": output_dir / f"{name}-unitigs.fa", + "adj": output_dir / f"{name}-graph.adj", + "dot": output_dir / f"{name}-graph.dot", + "coverage": output_dir / f"{name}-coverage.hist", + "stats": output_dir / f"{name}-stats.tab", + } + + existing_files = { + key: str(path.resolve()) for key, path in output_files.items() if path.exists() + } + + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": existing_files, + } + + +@mcp.tool +def abyss_fac(fasta_file: Path): + """ + Computes assembly contiguity statistics (e.g., N50) for a FASTA file. + + This tool reads a FASTA file and prints a table of statistics, + including the number of sequences, total size, N50, and L50. + + Args: + fasta_file: Path to the input FASTA file containing contigs or scaffolds. + + Returns: + A dictionary containing the executed command, stdout (which holds the stats), and stderr. + """ + # --- Input Validation --- + if not fasta_file.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {fasta_file}") + + # --- Command Construction --- + cmd = ["abyss-fac", str(fasta_file)] + command_str = " ".join(cmd) + logging.info(f"Executing command: {command_str}") + + # --- Subprocess Execution --- + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + logging.error(f"abyss-fac failed with exit code {e.returncode}") + logging.error(f"Stdout: {e.stdout}") + logging.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "error": "abyss-fac execution failed." + } + + # --- Structured Result Return --- + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +@mcp.tool +def abyss_map( + query_files: List[Path], + target_file: Path, + output_sam: Path, + threads: int = 1, + min_align_len: int = 40, + min_identity: float = 0.95, + verbose: bool = False, +): + """ + Map reads to a reference sequence and output alignments in SAM format. + + This tool is a simple read mapper included with ABySS. + + Args: + query_files: A list of one or more FASTA/FASTQ files containing reads to map. + target_file: The FASTA file containing the reference sequences (e.g., contigs). + output_sam: The path to write the output SAM file. + threads: Number of threads to use. + min_align_len: Minimum alignment length. + min_identity: Minimum alignment identity (0.0 to 1.0). + verbose: Enable verbose logging to stderr. + + Returns: + A dictionary containing the executed command, stdout, stderr, and the path to the output SAM file. + """ + # --- Input Validation --- + for f in query_files: + if not f.exists(): + raise FileNotFoundError(f"Query file not found: {f}") + if not target_file.exists(): + raise FileNotFoundError(f"Target file not found: {target_file}") + if not (0.0 <= min_identity <= 1.0): + raise ValueError("min_identity must be between 0.0 and 1.0.") + if threads < 1: + raise ValueError("threads must be a positive integer.") + + # --- Command Construction --- + cmd = ["abyss-map"] + if verbose: + cmd.append("-v") + cmd.extend(["-j", str(threads)]) + cmd.extend(["-l", str(min_align_len)]) + cmd.extend(["-p", str(min_identity)]) + cmd.extend([str(f) for f in query_files]) + cmd.append(str(target_file)) + + command_str = " ".join(shlex.quote(c) for c in cmd) + logging.info(f"Executing command: {command_str} > {output_sam}") + + # --- Subprocess Execution --- + try: + with open(output_sam, "w") as f_out: + result = subprocess.run( + cmd, + stdout=f_out, + stderr=subprocess.PIPE, + text=True, + check=True, + ) + except subprocess.CalledProcessError as e: + logging.error(f"abyss-map failed with exit code {e.returncode}") + logging.error(f"Stderr: {e.stderr}") + return { + "command_executed": command_str, + "stdout": "", # Stdout was redirected + "stderr": e.stderr, + "output_files": {}, + "error": "abyss-map execution failed." + } + except Exception as e: + logging.error(f"An unexpected error occurred: {e}") + raise + + # --- Structured Result Return --- + return { + "command_executed": command_str, + "stdout": f"SAM output written to {output_sam}", + "stderr": result.stderr, + "output_files": {"sam_file": str(output_sam.resolve())}, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e1c7636f6b190598407e85d2f9c00a3b4922007d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/app/abyss_server.py') +SERVER_NAME = 'biosci_abyss' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..0b776c095129c6c459841083e9ee41eaad24d392 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-abyss: + build: . + image: mcp-abyss:latest + container_name: mcp-abyss + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=abyss + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fe6f92d9673028828b344143f444099fe8da3d64 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - abyss + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_abyss/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2c883e38ab66792aeaa80e098fa4bd33c6ee003f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install adapterremoval via conda (e.g., from bioconda) +RUN conda install -c bioconda adapterremoval -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/adapterremoval_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/adapterremoval_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/adapterremoval_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5df06c25388e7cd09746b7aaa948a0110b1ff62f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_server.py @@ -0,0 +1,283 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +@mcp.tool() +def adapter_removal( + file1: str, + file2: Optional[str] = None, + adapter1: str = "AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC", + adapter2: str = "AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT", + adapter_list: Optional[str] = None, + basename: str = "adapterremoval_output", + trimns: bool = False, + trimqualities: bool = False, + minquality: int = 2, + minlength: int = 15, + maxlength: int = 0, + collapse: bool = False, + collapse_deterministic: bool = False, + mismatchrate: float = 0.333, + minadapteroverlap: int = 0, + gzip: bool = False, + bzip2: bool = False, + threads: int = 1, + interleaved: bool = False, + interleaved_output: bool = False, + qualitybase: int = 33, + qualitymax: int = 41, + mate_separator: str = "/", + trim_low_complexity: bool = False, +): + """ + Perform adapter trimming, quality trimming, and optional merging of paired-end reads using AdapterRemoval v2. + + Args: + file1: Path to the first input FASTQ file (or interleaved file). + file2: Path to the second input FASTQ file (optional). + adapter1: Sequence of the first adapter. + adapter2: Sequence of the second adapter. + adapter_list: Path to a file containing a list of adapters (one per line). + basename: Prefix for all output files. + trimns: If True, trim ambiguous bases (N) from the 5' and 3' ends. + trimqualities: If True, trim low-quality bases from the 5' and 3' ends. + minquality: Minimum quality score for trimming (default 2). + minlength: Minimum read length after trimming (default 15). + maxlength: Maximum read length; reads longer than this are discarded (0 = disabled). + collapse: If True, merge overlapping paired-end reads into a single consensus sequence. + collapse_deterministic: If True, use deterministic merging for overlapping reads. + mismatchrate: Maximum allowed fraction of mismatches in the overlapping region (default 0.333). + minadapteroverlap: Minimum overlap between read and adapter (default 0). + gzip: If True, compress output files using gzip. + bzip2: If True, compress output files using bzip2. + threads: Number of threads to use. + interleaved: If True, input file1 is treated as an interleaved paired-end file. + interleaved_output: If True, output paired-end reads in a single interleaved file. + qualitybase: Phred quality score offset (33 or 64). + qualitymax: Maximum Phred quality score (default 41). + mate_separator: Character separating mate number in read names (default '/'). + trim_low_complexity: If True, trim low complexity (e.g. poly-A) sequences. + """ + # Input validation + f1_path = Path(file1) + if not f1_path.exists(): + raise FileNotFoundError(f"Input file1 not found: {file1}") + + cmd = ["AdapterRemoval", "--file1", str(f1_path)] + + if file2: + f2_path = Path(file2) + if not f2_path.exists(): + raise FileNotFoundError(f"Input file2 not found: {file2}") + cmd.extend(["--file2", str(f2_path)]) + + if adapter_list: + alist_path = Path(adapter_list) + if not alist_path.exists(): + raise FileNotFoundError(f"Adapter list file not found: {adapter_list}") + cmd.extend(["--adapter-list", str(alist_path)]) + else: + cmd.extend(["--adapter1", adapter1, "--adapter2", adapter2]) + + # Parameters + cmd.extend(["--basename", basename]) + cmd.extend(["--minquality", str(minquality)]) + cmd.extend(["--minlength", str(minlength)]) + cmd.extend(["--mismatchrate", str(mismatchrate)]) + cmd.extend(["--minadapteroverlap", str(minadapteroverlap)]) + cmd.extend(["--threads", str(threads)]) + cmd.extend(["--qualitybase", str(qualitybase)]) + cmd.extend(["--qualitymax", str(qualitymax)]) + cmd.extend(["--mate-separator", mate_separator]) + + if trimns: cmd.append("--trimns") + if trimqualities: cmd.append("--trimqualities") + if collapse: cmd.append("--collapse") + if collapse_deterministic: cmd.append("--collapse-deterministic") + if gzip: cmd.append("--gzip") + if bzip2: cmd.append("--bzip2") + if interleaved: cmd.append("--interleaved") + if interleaved_output: cmd.append("--interleaved-output") + if trim_low_complexity: cmd.append("--trim-low-complexity") + if maxlength > 0: + cmd.extend(["--maxlength", str(maxlength)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + + # Identify potential output files based on basename and flags + ext = ".gz" if gzip else (".bz2" if bzip2 else "") + output_files = [f"{basename}.settings"] + + # Standard outputs + if file2 or interleaved: + output_files.extend([ + f"{basename}.pair1.truncated{ext}", + f"{basename}.pair2.truncated{ext}", + f"{basename}.singleton.truncated{ext}" + ]) + if collapse or collapse_deterministic: + output_files.extend([ + f"{basename}.collapsed{ext}", + f"{basename}.collapsed.truncated{ext}" + ]) + else: + output_files.append(f"{basename}.truncated{ext}") + + # Filter for files that actually exist + existing_outputs = [f for f in output_files if Path(f).exists()] + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": existing_outputs + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def adapter_removal_identify_adapters( + file1: str, + file2: str, + threads: int = 1, + interleaved: bool = False, + qualitybase: int = 33, +): + """ + Attempt to identify adapter sequences by looking for consensus overlaps in paired-end reads. + + Args: + file1: Path to the first input FASTQ file. + file2: Path to the second input FASTQ file. + threads: Number of threads to use. + interleaved: If True, input file1 is treated as an interleaved paired-end file. + qualitybase: Phred quality score offset (33 or 64). + """ + f1_path = Path(file1) + f2_path = Path(file2) + + if not f1_path.exists(): + raise FileNotFoundError(f"Input file1 not found: {file1}") + if not f2_path.exists() and not interleaved: + raise FileNotFoundError(f"Input file2 not found: {file2}") + + cmd = [ + "AdapterRemoval", + "--identify-adapters", + "--file1", str(f1_path), + "--threads", str(threads), + "--qualitybase", str(qualitybase) + ] + + if not interleaved: + cmd.extend(["--file2", str(f2_path)]) + else: + cmd.append("--interleaved") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "identified_adapters": result.stdout # Usually printed to stdout + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def adapter_removal_demultiplex( + barcode_list: str, + file1: str, + file2: Optional[str] = None, + basename: str = "demux_output", + barcode_mm: int = 1, + barcode_mm_r1: Optional[int] = None, + barcode_mm_r2: Optional[int] = None, + gzip: bool = False, + threads: int = 1, + interleaved: bool = False, +): + """ + Demultiplex reads based on a list of barcodes using AdapterRemoval v2. + + Args: + barcode_list: Path to a file containing barcodes (Format: Name Barcode1 Barcode2). + file1: Path to the first input FASTQ file. + file2: Path to the second input FASTQ file (optional). + basename: Prefix for all output files. + barcode_mm: Max number of mismatches allowed in barcodes (default 1). + barcode_mm_r1: Max mismatches for barcode 1 (overrides barcode_mm). + barcode_mm_r2: Max mismatches for barcode 2 (overrides barcode_mm). + gzip: If True, compress output files using gzip. + threads: Number of threads to use. + interleaved: If True, input file1 is treated as an interleaved paired-end file. + """ + blist_path = Path(barcode_list) + f1_path = Path(file1) + + if not blist_path.exists(): + raise FileNotFoundError(f"Barcode list file not found: {barcode_list}") + if not f1_path.exists(): + raise FileNotFoundError(f"Input file1 not found: {file1}") + + cmd = [ + "AdapterRemoval", + "--barcode-list", str(blist_path), + "--file1", str(f1_path), + "--basename", basename, + "--threads", str(threads) + ] + + if file2: + f2_path = Path(file2) + if not f2_path.exists(): + raise FileNotFoundError(f"Input file2 not found: {file2}") + cmd.extend(["--file2", str(f2_path)]) + + if interleaved: + cmd.append("--interleaved") + + if gzip: + cmd.append("--gzip") + + if barcode_mm_r1 is not None: + cmd.extend(["--barcode-mm-r1", str(barcode_mm_r1)]) + if barcode_mm_r2 is not None: + cmd.extend(["--barcode-mm-r2", str(barcode_mm_r2)]) + if barcode_mm_r1 is None and barcode_mm_r2 is None: + cmd.extend(["--barcode-mm", str(barcode_mm)]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + + # Demultiplexing creates many files based on the barcode names in the list + # We'll return the settings file and a note about the outputs + ext = ".gz" if gzip else "" + settings_file = f"{basename}.settings" + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "settings_file": settings_file if Path(settings_file).exists() else "Not found", + "info": "Demultiplexed files are created with the prefix specified in the barcode list." + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d74168de07182ea4f7318413caf3ae623dd157c5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/adapterremoval_server.py') +SERVER_NAME = 'biosci_adapterremoval' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..a2f7cf04f93a95b930d3b0522c19f44eff82fe41 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-adapterremoval: + build: . + image: mcp-adapterremoval:latest + container_name: mcp-adapterremoval + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=adapterremoval + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4adb36b1602292c3b24d3bf18e90edd5a4714a42 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - adapterremoval + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_adapterremoval/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..20d194cb4175101adf571f9f71916e32fed1024f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install alfred via conda (e.g., from bioconda) +RUN conda install -c bioconda alfred -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/alfred_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/alfred_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/alfred_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e53fc4082eb69d9ac6e0028fab6838c5134fee1d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_server.py @@ -0,0 +1,630 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Literal, Optional + +# MCP-related decorators are assumed to be available in the environment. +# +# For local testing, you can create a dummy decorator: +# +# def mcp_tool_dummy(*args, **kwargs): +# def decorator(func): +# return func +# return decorator +# +# mcp = type("mcp", (), {"tool": mcp_tool_dummy}) + + +@mcp.tool() +def alfred_stats( + in_bam: Path, + ref: Path, + outfile: Optional[Path] = None, + bed: Optional[Path] = None, + threads: int = 1, + minmapq: int = 0, + flag: int = 0, + fflag: int = 1540, + coverage: Optional[Path] = None, + dist: Optional[Path] = None, + sampleid: Optional[str] = None, + libid: Optional[str] = None, + readgroup: Optional[str] = None, + uncompressed: bool = False, +): + """ + Compute alignment summary statistics for a BAM file. + + Args: + in_bam: Input BAM file. + ref: Reference FASTA file. + outfile: Output file for alignment metrics (e.g., metrics.tsv.gz). Defaults to stdout. + bed: BED file with regions of interest. + threads: Number of threads to use. + minmapq: Minimum mapping quality for reads to be considered. + flag: Required SAM flag. + fflag: Filtering SAM flag (reads with these flags will be ignored). + coverage: Output file for coverage statistics (e.g., cov.txt.gz). + dist: Output file for insert size distribution (e.g., dist.txt.gz). + sampleid: Sample ID to be used in the output. + libid: Library ID to be used in the output. + readgroup: Read-group ID to be used in the output. + uncompressed: Write uncompressed output files. + """ + if not in_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {in_bam}") + if not ref.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref}") + if bed and not bed.exists(): + raise FileNotFoundError(f"BED file not found: {bed}") + if threads < 1: + raise ValueError("Number of threads must be at least 1.") + + cmd = ["alfred", "stats", "-r", str(ref)] + output_files = [] + + if outfile: + cmd.extend(["-o", str(outfile)]) + output_files.append(str(outfile)) + if bed: + cmd.extend(["-b", str(bed)]) + if threads > 1: + cmd.extend(["-p", str(threads)]) + if minmapq != 0: + cmd.extend(["-m", str(minmapq)]) + if flag != 0: + cmd.extend(["-f", str(flag)]) + if fflag != 1540: + cmd.extend(["-F", str(fflag)]) + if coverage: + cmd.extend(["-c", str(coverage)]) + output_files.append(str(coverage)) + if dist: + cmd.extend(["-d", str(dist)]) + output_files.append(str(dist)) + if sampleid: + cmd.extend(["-s", sampleid]) + if libid: + cmd.extend(["-l", libid]) + if readgroup: + cmd.extend(["-g", readgroup]) + if uncompressed: + cmd.append("-u") + + cmd.append(str(in_bam)) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred stats failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_count( + in_bam: Path, + ref: Path, + bed: Optional[Path] = None, + gtf: Optional[Path] = None, + outfile: Optional[Path] = None, + threads: int = 1, + minmapq: int = 0, + flag: int = 0, + fflag: int = 1540, + sampleid: Optional[str] = None, + libid: Optional[str] = None, + readgroup: Optional[str] = None, + uncompressed: bool = False, + feature: str = "exon", + id_attribute: str = "gene_id", + stranded: Literal[0, 1, 2] = 0, + antisense: bool = False, +): + """ + Count reads in genomic features from a BAM file. + + Args: + in_bam: Input BAM file. + ref: Reference FASTA file. + bed: BED file with features. Provide either 'bed' or 'gtf'. + gtf: GTF file with features. Provide either 'bed' or 'gtf'. + outfile: Output file for feature counts (e.g., counts.tsv.gz). Defaults to stdout. + threads: Number of threads to use. + minmapq: Minimum mapping quality. + flag: Required SAM flag. + fflag: Filtering SAM flag. + sampleid: Sample ID. + libid: Library ID. + readgroup: Read-group ID. + uncompressed: Write uncompressed output. + feature: GTF feature to count (e.g., 'exon'). + id_attribute: GTF identifier to aggregate by (e.g., 'gene_id'). + stranded: Strandedness (0: unstranded, 1: forward, 2: reverse). + antisense: Count antisense reads. + """ + if not in_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {in_bam}") + if not ref.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref}") + if bed and gtf: + raise ValueError("Parameters 'bed' and 'gtf' are mutually exclusive.") + if not bed and not gtf: + raise ValueError("Either 'bed' or 'gtf' must be provided.") + if bed and not bed.exists(): + raise FileNotFoundError(f"BED file not found: {bed}") + if gtf and not gtf.exists(): + raise FileNotFoundError(f"GTF file not found: {gtf}") + if threads < 1: + raise ValueError("Number of threads must be at least 1.") + + cmd = ["alfred", "count", "-r", str(ref)] + output_files = [] + + if bed: + cmd.extend(["-b", str(bed)]) + if gtf: + cmd.extend(["-j", str(gtf)]) + if outfile: + cmd.extend(["-o", str(outfile)]) + output_files.append(str(outfile)) + if threads > 1: + cmd.extend(["-p", str(threads)]) + if minmapq != 0: + cmd.extend(["-m", str(minmapq)]) + if flag != 0: + cmd.extend(["-f", str(flag)]) + if fflag != 1540: + cmd.extend(["-F", str(fflag)]) + if sampleid: + cmd.extend(["-s", sampleid]) + if libid: + cmd.extend(["-l", libid]) + if readgroup: + cmd.extend(["-g", readgroup]) + if uncompressed: + cmd.append("-u") + if feature != "exon": + cmd.extend(["-e", feature]) + if id_attribute != "gene_id": + cmd.extend(["-i", id_attribute]) + if stranded != 0: + cmd.extend(["-a", str(stranded)]) + if antisense: + cmd.append("-z") + + cmd.append(str(in_bam)) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred count failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_annotate( + in_vcf: Path, + in_bam: Path, + outfile: Path, + ref: Path, + bed: Optional[Path] = None, + gtf: Optional[Path] = None, + threads: int = 1, + minmapq: int = 0, + flag: int = 0, + fflag: int = 1540, + feature: str = "exon", + id_attribute: str = "gene_id", + annotation_type: Literal["INFO", "FORMAT"] = "FORMAT", + field: str = "FE", +): + """ + Annotate variants in a VCF/BCF file with feature overlaps from a BAM file. + + Args: + in_vcf: Input VCF/BCF file. + in_bam: Input BAM file. + outfile: Output VCF/BCF file. + ref: Reference FASTA file. + bed: BED file with features. Provide either 'bed' or 'gtf'. + gtf: GTF file with features. Provide either 'bed' or 'gtf'. + threads: Number of threads to use. + minmapq: Minimum mapping quality. + flag: Required SAM flag. + fflag: Filtering SAM flag. + feature: GTF feature to count (e.g., 'exon'). + id_attribute: GTF identifier to aggregate by (e.g., 'gene_id'). + annotation_type: Annotation type ('INFO' or 'FORMAT'). + field: Annotation field name. + """ + if not in_vcf.exists(): + raise FileNotFoundError(f"Input VCF/BCF file not found: {in_vcf}") + if not in_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {in_bam}") + if not ref.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref}") + if bed and gtf: + raise ValueError("Parameters 'bed' and 'gtf' are mutually exclusive.") + if not bed and not gtf: + raise ValueError("Either 'bed' or 'gtf' must be provided.") + if bed and not bed.exists(): + raise FileNotFoundError(f"BED file not found: {bed}") + if gtf and not gtf.exists(): + raise FileNotFoundError(f"GTF file not found: {gtf}") + if threads < 1: + raise ValueError("Number of threads must be at least 1.") + + cmd = ["alfred", "annotate", "-o", str(outfile), "-r", str(ref)] + output_files = [str(outfile)] + + if bed: + cmd.extend(["-b", str(bed)]) + if gtf: + cmd.extend(["-j", str(gtf)]) + if threads > 1: + cmd.extend(["-p", str(threads)]) + if minmapq != 0: + cmd.extend(["-m", str(minmapq)]) + if flag != 0: + cmd.extend(["-f", str(flag)]) + if fflag != 1540: + cmd.extend(["-F", str(fflag)]) + if feature != "exon": + cmd.extend(["-e", feature]) + if id_attribute != "gene_id": + cmd.extend(["-i", id_attribute]) + if annotation_type != "FORMAT": + cmd.extend(["-t", annotation_type]) + if field != "FE": + cmd.extend(["-a", field]) + + cmd.extend([str(in_vcf), str(in_bam)]) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred annotate failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_qc( + input_bams: List[Path], + outfile: Path, + ref: Path, + bed: Optional[Path] = None, + gtf: Optional[Path] = None, + threads: int = 1, + minmapq: int = 0, + flag: int = 0, + fflag: int = 1540, + contigs: Optional[str] = None, + feature: str = "exon", + id_attribute: str = "gene_id", + stranded: Literal[0, 1, 2] = 0, + antisense: bool = False, + uncompressed: bool = False, + sites: Optional[Path] = None, + genome: Optional[Path] = None, +): + """ + Generate a multi-sample QC report from one or more BAM files. + + Args: + input_bams: List of input BAM files. + outfile: Output file for QC metrics (e.g., out.qc.json.gz). + ref: Reference FASTA file. + bed: BED file with regions of interest. + gtf: GTF file with features. + threads: Number of threads to use. + minmapq: Minimum mapping quality. + flag: Required SAM flag. + fflag: Filtering SAM flag. + contigs: Comma-separated list of contigs to include. + feature: GTF feature to count (e.g., 'exon'). + id_attribute: GTF identifier to aggregate by (e.g., 'gene_id'). + stranded: Strandedness (0: unstranded, 1: forward, 2: reverse). + antisense: Count antisense reads. + uncompressed: Write uncompressed output. + sites: VCF/BCF file with sites of interest. + genome: Genome accessibility file. + """ + if not input_bams: + raise ValueError("At least one input BAM file is required.") + for bam in input_bams: + if not bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {bam}") + if not ref.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref}") + if bed and not bed.exists(): + raise FileNotFoundError(f"BED file not found: {bed}") + if gtf and not gtf.exists(): + raise FileNotFoundError(f"GTF file not found: {gtf}") + if sites and not sites.exists(): + raise FileNotFoundError(f"Sites VCF/BCF file not found: {sites}") + if genome and not genome.exists(): + raise FileNotFoundError(f"Genome accessibility file not found: {genome}") + if threads < 1: + raise ValueError("Number of threads must be at least 1.") + + cmd = ["alfred", "qc", "-o", str(outfile), "-r", str(ref)] + output_files = [str(outfile)] + + if bed: + cmd.extend(["-b", str(bed)]) + if gtf: + cmd.extend(["-j", str(gtf)]) + if threads > 1: + cmd.extend(["-p", str(threads)]) + if minmapq != 0: + cmd.extend(["-m", str(minmapq)]) + if flag != 0: + cmd.extend(["-f", str(flag)]) + if fflag != 1540: + cmd.extend(["-F", str(fflag)]) + if contigs: + cmd.extend(["-c", contigs]) + if feature != "exon": + cmd.extend(["-e", feature]) + if id_attribute != "gene_id": + cmd.extend(["-i", id_attribute]) + if stranded != 0: + cmd.extend(["-a", str(stranded)]) + if antisense: + cmd.append("-z") + if uncompressed: + cmd.append("-u") + if sites: + cmd.extend(["-s", str(sites)]) + if genome: + cmd.extend(["-g", str(genome)]) + + cmd.extend([str(bam) for bam in input_bams]) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred qc failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_merge( + input_qc_files: List[Path], outfile: Path, uncompressed: bool = False +): + """ + Merge multiple alfred QC files. + + Args: + input_qc_files: List of input QC JSON files (e.g., *.qc.json.gz). + outfile: Output file for merged QC metrics (e.g., out.qc.json.gz). + uncompressed: Write uncompressed output. + """ + if not input_qc_files: + raise ValueError("At least one input QC file is required.") + for qc_file in input_qc_files: + if not qc_file.exists(): + raise FileNotFoundError(f"Input QC file not found: {qc_file}") + + cmd = ["alfred", "merge", "-o", str(outfile)] + output_files = [str(outfile)] + + if uncompressed: + cmd.append("-u") + + cmd.extend([str(f) for f in input_qc_files]) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred merge failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_track( + in_bam: Path, + ref: Path, + outfile: Optional[Path] = None, + bed: Optional[Path] = None, + threads: int = 1, + minmapq: int = 0, + flag: int = 0, + fflag: int = 1540, + step: int = 1000, + window: int = 1000, + uncompressed: bool = False, +): + """ + Create a bedGraph track from a BAM file. + + Args: + in_bam: Input BAM file. + ref: Reference FASTA file. + outfile: Output bedGraph file (e.g., track.bedGraph.gz). Defaults to stdout. + bed: BED file with regions of interest. + threads: Number of threads to use. + minmapq: Minimum mapping quality. + flag: Required SAM flag. + fflag: Filtering SAM flag. + step: Step size for coverage computation. + window: Window size for coverage computation. + uncompressed: Write uncompressed output. + """ + if not in_bam.exists(): + raise FileNotFoundError(f"Input BAM file not found: {in_bam}") + if not ref.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref}") + if bed and not bed.exists(): + raise FileNotFoundError(f"BED file not found: {bed}") + if threads < 1: + raise ValueError("Number of threads must be at least 1.") + if step <= 0 or window <= 0: + raise ValueError("Step and window sizes must be positive.") + + cmd = ["alfred", "track", "-r", str(ref)] + output_files = [] + + if outfile: + cmd.extend(["-o", str(outfile)]) + output_files.append(str(outfile)) + if bed: + cmd.extend(["-b", str(bed)]) + if threads > 1: + cmd.extend(["-p", str(threads)]) + if minmapq != 0: + cmd.extend(["-m", str(minmapq)]) + if flag != 0: + cmd.extend(["-f", str(flag)]) + if fflag != 1540: + cmd.extend(["-F", str(fflag)]) + if step != 1000: + cmd.extend(["-s", str(step)]) + if window != 1000: + cmd.extend(["-w", str(window)]) + if uncompressed: + cmd.append("-u") + + cmd.append(str(in_bam)) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred track failed", + "return_code": e.returncode, + } + + +@mcp.tool() +def alfred_motif( + ref_fa: Path, + motif: str, + outfile: Optional[Path] = None, + mincount: int = 1, + uncompressed: bool = False, +): + """ + Search for motifs in a FASTA file. + + Args: + ref_fa: Reference FASTA file. + motif: Motif to search for. + outfile: Output BED file (e.g., motif.bed.gz). Defaults to stdout. + mincount: Minimum number of motif repeats. + uncompressed: Write uncompressed output. + """ + if not ref_fa.exists(): + raise FileNotFoundError(f"Reference FASTA file not found: {ref_fa}") + if not motif: + raise ValueError("Motif string cannot be empty.") + if mincount < 1: + raise ValueError("Minimum count must be at least 1.") + + cmd = ["alfred", "motif", "-m", motif] + output_files = [] + + if outfile: + cmd.extend(["-o", str(outfile)]) + output_files.append(str(outfile)) + if mincount != 1: + cmd.extend(["-c", str(mincount)]) + if uncompressed: + cmd.append("-u") + + cmd.append(str(ref_fa)) + + try: + result = subprocess.run( + cmd, check=True, capture_output=True, text=True, encoding="utf-8" + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Alfred motif failed", + "return_code": e.returncode, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..33b3e46b4cb2fb4beee60e1ac47328ee9ba04dde --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/alfred_server.py') +SERVER_NAME = 'biosci_alfred' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..10d69f54e7306f9e7fa797206b59852f4e9b20d2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-alfred: + build: . + image: mcp-alfred:latest + container_name: mcp-alfred + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=alfred + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0a0a1452ee7957bb2da9cf2f21e5378114b9dd64 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - alfred + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_alfred/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a683380b60d1d2751d12a889581a344ed8fa4cff --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install anansescanpy via conda (e.g., from bioconda) +RUN conda install -c bioconda anansescanpy -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY anansescanpy_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/anansescanpy_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/anansescanpy_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py new file mode 100644 index 0000000000000000000000000000000000000000..130a9a0383bc706c1c64ba4abcd54f38ccb3c097 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py @@ -0,0 +1,270 @@ +import subprocess +from pathlib import Path +from typing import Optional +import shlex +import textwrap + +@mcp.tool() +def export_scanpy( + adata_path: str, + cluster_id: str, + output_dir: str = "scANANSE", + rna_type: str = "raw", + min_cells: int = 50, + is_multiome: bool = False, +): + """ + Export Scanpy AnnData object to files compatible with ANANSE. + This function prepares the gene expression and (optionally) accessibility data + for each cluster defined in the AnnData object. + + Args: + adata_path: Path to the input AnnData file (.h5ad). + cluster_id: The column in adata.obs containing cluster/cell-type labels. + output_dir: Directory where the exported files will be saved. + rna_type: Type of RNA data ('raw' or 'recount'). + min_cells: Minimum number of cells per cluster to be included in the export. + is_multiome: Set to True if the AnnData object contains both RNA and ATAC data. + """ + # Input validation + p_adata = Path(adata_path) + if not p_adata.exists(): + return {"error": f"Input file {adata_path} not found."} + + if rna_type not in ["raw", "recount"]: + return {"error": "rna_type must be either 'raw' or 'recount'."} + + if min_cells < 0: + return {"error": "min_cells must be a non-negative integer."} + + # Construct Python script to execute the library function + # We use a subprocess to ensure we can capture output and handle the environment + py_script = textwrap.dedent(f""" + import scanpy as sc + import anansescanpy as aspy + import os + + try: + adata = sc.read_h5ad('{adata_path}') + aspy.export_scanpy( + adata, + cluster_id='{cluster_id}', + rna_type='{rna_type}', + min_cells={min_cells}, + output_dir='{output_dir}', + is_multiome={is_multiome} + ) + print("Export successful") + except Exception as e: + print(f"Error: {{str(e)}}") + exit(1) + """) + + try: + result = subprocess.run( + ["python3", "-c", py_script], + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": f"anansescanpy.export_scanpy on {adata_path}", + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir + } + except subprocess.CalledProcessError as e: + return { + "error": "Failed to export Scanpy object", + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def import_scanpy( + adata_path: str, + ananse_dir: str, + cluster_id: str, + output_path: str, +): + """ + Import ANANSE results (influence scores, GRN) back into a Scanpy AnnData object. + + Args: + adata_path: Path to the original AnnData file (.h5ad). + ananse_dir: Directory containing the ANANSE output files. + cluster_id: The column in adata.obs that was used for the ANANSE analysis. + output_path: Path where the updated AnnData file will be saved. + """ + p_adata = Path(adata_path) + p_ananse = Path(ananse_dir) + + if not p_adata.exists(): + return {"error": f"Input AnnData file {adata_path} not found."} + if not p_ananse.is_dir(): + return {"error": f"ANANSE directory {ananse_dir} not found."} + + py_script = textwrap.dedent(f""" + import scanpy as sc + import anansescanpy as aspy + + try: + adata = sc.read_h5ad('{adata_path}') + adata = aspy.import_scanpy( + adata, + cluster_id='{cluster_id}', + ananse_dir='{ananse_dir}' + ) + adata.write_h5ad('{output_path}') + print("Import successful") + except Exception as e: + print(f"Error: {{str(e)}}") + exit(1) + """) + + try: + result = subprocess.run( + ["python3", "-c", py_script], + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": f"anansescanpy.import_scanpy from {ananse_dir}", + "stdout": result.stdout, + "stderr": result.stderr, + "output_file": output_path + } + except subprocess.CalledProcessError as e: + return { + "error": "Failed to import ANANSE results", + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def anansnake_config( + adata_path: str, + cluster_id: str, + genome: str, + output_dir: str, + sample_col: Optional[str] = None, + atac_column: Optional[str] = None, +): + """ + Generate a configuration file for the anansnake pipeline based on a Scanpy object. + + Args: + adata_path: Path to the AnnData file (.h5ad). + cluster_id: The column in adata.obs containing cluster labels. + genome: Genome assembly name (e.g., 'hg38', 'mm10'). + output_dir: Directory where the config.yaml and analysis files will be created. + sample_col: Optional column in adata.obs containing sample identifiers. + atac_column: Optional column in adata.obs containing ATAC-seq peak data. + """ + p_adata = Path(adata_path) + if not p_adata.exists(): + return {"error": f"Input file {adata_path} not found."} + + sample_arg = f"'{sample_col}'" if sample_col else "None" + atac_arg = f"'{atac_column}'" if atac_column else "None" + + py_script = textwrap.dedent(f""" + import scanpy as sc + import anansescanpy as aspy + + try: + adata = sc.read_h5ad('{adata_path}') + aspy.anansnake_config( + adata, + cluster_id='{cluster_id}', + genome='{genome}', + output_dir='{output_dir}', + sample_col={sample_arg}, + atac_column={atac_arg} + ) + print("Config generation successful") + except Exception as e: + print(f"Error: {{str(e)}}") + exit(1) + """) + + try: + result = subprocess.run( + ["python3", "-c", py_script], + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": "anansescanpy.anansnake_config", + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir + } + except subprocess.CalledProcessError as e: + return { + "error": "Failed to generate anansnake config", + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def run_anansnake( + config_file: str, + snakefile: str, + cores: int = 12, + memory_mb: int = 48000, + use_conda: bool = True, + conda_frontend: str = "mamba", +): + """ + Execute the anansnake GRN analysis pipeline using Snakemake. + + Args: + config_file: Path to the config.yaml file (generated by anansnake_config). + snakefile: Path to the anansnake Snakefile. + cores: Number of CPU cores to use. + memory_mb: Memory resource limit in MB. + use_conda: Whether to use conda environments for the pipeline steps. + conda_frontend: The conda frontend to use ('mamba' or 'conda'). + """ + p_config = Path(config_file) + p_snake = Path(snakefile) + + if not p_config.exists(): + return {"error": f"Config file {config_file} not found."} + if not p_snake.exists(): + return {"error": f"Snakefile {snakefile} not found."} + + cmd = [ + "snakemake", + "--configfile", str(p_config), + "--snakefile", str(p_snake), + "--cores", str(cores), + "--resources", f"mem_mb={memory_mb}" + ] + + if use_conda: + cmd.append("--use-conda") + cmd.extend(["--conda-frontend", conda_frontend]) + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr + } + except subprocess.CalledProcessError as e: + return { + "error": "Snakemake pipeline execution failed", + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d17f7d94b2bdffb3950c93a0d3cfc165f87bfd9a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/app/anansescanpy_server.py') +SERVER_NAME = 'biosci_anansescanpy' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..be181dd45329ba5c46ff01ad28f7093a2bb3ce2c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-anansescanpy: + build: . + image: mcp-anansescanpy:latest + container_name: mcp-anansescanpy + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=anansescanpy + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86f5644cc42fc93ecff2a6e15385ae35f483501d --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - anansescanpy + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anansescanpy/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18524a55cc4d422e85fa84048762e0b740585cc8 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install anarci via conda (e.g., from bioconda) +RUN conda install -c bioconda anarci -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/anarci_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/anarci_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/anarci_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_server.py new file mode 100644 index 0000000000000000000000000000000000000000..236664764dd6dfa473b7a43786f9336c963623c7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_server.py @@ -0,0 +1,183 @@ +from pathlib import Path +import subprocess +from typing import Optional, List, Union + +@mcp.tool() +def run_anarci( + sequence: Optional[str] = None, + input_file: Optional[str] = None, + output_file: Optional[str] = None, + scheme: str = "imgt", + restrict: Optional[str] = None, + species: Optional[str] = None, + csv: bool = False, + ncpu: int = 1, + bit_score_threshold: float = 80.0, + assign_germline: bool = False, + name: Optional[str] = None, + verbose: bool = False +): + """ + ANARCI: Antibody Numbering and Antigen Receptor ClassIfication. + Numbers amino-acid sequences of antibody and T-cell receptor variable domains. + + Args: + sequence: A single amino acid sequence to number. + input_file: Path to a FASTA file containing sequences to number. + output_file: Path to the output file. If not provided, results are printed to stdout. + scheme: Numbering scheme to use. Options: 'imgt', 'kabat', 'chothia', 'martin', 'aho'. (Default: 'imgt') + restrict: Restrict numbering to specific domain types. Options: 'ig' (immunoglobulins), 'tr' (T-cell receptors). + species: Restrict germline search to specific species (e.g., 'human', 'mouse', 'rat', 'rabbit', 'rhesus', 'pig', 'alpaca'). + csv: If True, output results in CSV format (horizontal). If False, uses plain text (vertical). + ncpu: Number of CPUs to use for parallel processing. (Default: 1) + bit_score_threshold: HMMER bit score threshold for domain identification. (Default: 80.0) + assign_germline: If True, assign germline species and gene information. + name: Name to assign to the single sequence (used with 'sequence' parameter). + verbose: If True, produce verbose output. + """ + + # Input validation + if not sequence and not input_file: + raise ValueError("Either 'sequence' or 'input_file' must be provided.") + + if sequence and input_file: + raise ValueError("Provide either 'sequence' or 'input_file', not both.") + + valid_schemes = ["imgt", "kabat", "chothia", "martin", "aho"] + if scheme.lower() not in valid_schemes: + raise ValueError(f"Invalid scheme '{scheme}'. Must be one of {valid_schemes}") + + if restrict and restrict.lower() not in ["ig", "tr"]: + raise ValueError("Restrict must be either 'ig' or 'tr'.") + + # Build command + # The CLI tool is typically named 'ANARCI' (uppercase) + cmd = ["ANARCI"] + + if sequence: + cmd.extend(["--sequence", sequence]) + if name: + cmd.extend(["--name", name]) + + if input_file: + input_path = Path(input_file) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_file}") + cmd.extend(["--input", str(input_path)]) + + if output_file: + cmd.extend(["--outfile", output_file]) + + cmd.extend(["--scheme", scheme.lower()]) + + if restrict: + cmd.extend(["--restrict", restrict.lower()]) + + if species: + cmd.extend(["--species", species.lower()]) + + if csv: + cmd.append("--csv") + + if assign_germline: + cmd.append("--assign_germline") + + if verbose: + cmd.append("--verbose") + + cmd.extend(["--ncpu", str(ncpu)]) + cmd.extend(["--bit_score_threshold", str(bit_score_threshold)]) + + try: + # Execute the tool + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + + output_files = [] + if output_file: + # ANARCI often appends suffixes depending on the format + # e.g., .csv or .txt + actual_output = Path(output_file) + if actual_output.exists(): + output_files.append(str(actual_output)) + else: + # Check for common suffixes if the exact file isn't found + for suffix in [".csv", ".txt"]: + p = Path(f"{output_file}{suffix}") + if p.exists(): + output_files.append(str(p)) + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files + } + + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": f"ANARCI failed with return code {e.returncode}" + } + except Exception as e: + return { + "command_executed": " ".join(cmd), + "error": str(e) + } + +@mcp.tool() +def list_anarci_species(): + """ + Returns a list of species supported by ANARCI for germline alignment. + Note: This is an informational tool based on ANARCI's standard database. + """ + # Standard species supported by ANARCI + species_list = [ + "human", "mouse", "rat", "rabbit", "rhesus", "pig", "alpaca", + "dog", "chicken", "cow", "horse", "monkey", "macaque" + ] + + return { + "supported_species": species_list, + "note": "Availability may depend on the specific ANARCI version and installed HMM databases." + } + +@mcp.tool() +def get_anarci_version(): + """ + Retrieves the version information for the installed ANARCI tool. + """ + try: + # ANARCI doesn't always have a simple --version flag in older versions, + # but we can try to run it to see the help header or use pip/conda info. + # Most modern versions support --version. + result = subprocess.run( + ["ANARCI", "--version"], + capture_output=True, + text=True, + check=False + ) + + # If --version fails, try to get it from the help output + if result.returncode != 0: + result = subprocess.run( + ["ANARCI", "--help"], + capture_output=True, + text=True, + check=False + ) + + return { + "stdout": result.stdout, + "stderr": result.stderr + } + except Exception as e: + return { + "error": f"Could not determine ANARCI version: {str(e)}" + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..55ff8f0288ce249db3018b5ca2ac023e08892dfc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/anarci_server.py') +SERVER_NAME = 'biosci_anarci' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..74cc2ae89329fd2e72df0e4d5ded04a73743f2be --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-anarci: + build: . + image: mcp-anarci:latest + container_name: mcp-anarci + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=anarci + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..68546623ce299a013b727b854f595fddd6b9586e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - anarci + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_anarci/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2cdc6ab27d8af15e6706a59d711433b15df37b21 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install aragorn via conda (e.g., from bioconda) +RUN conda install -c bioconda aragorn -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/aragorn_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/aragorn_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/aragorn_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e2e35835cb9a7b85234eaee1381184952eae5b7c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_server.py @@ -0,0 +1,189 @@ +import subprocess +from pathlib import Path +from typing import Optional, List + +# In a real MCP environment, the mcp package would be available. +# This is a placeholder for the linter. +class _MCP: + def tool(self, *args, **kwargs): + def decorator(f): + return f + return decorator +mcp = _MCP() + + +@mcp.tool() +def aragorn( + fasta_file: Path, + output_file: Optional[Path] = None, + overwrite_output: bool = False, + verbose: bool = False, + batch_format: bool = False, + output_format: Optional[str] = None, + search_trna: bool = True, + search_tmrna: bool = False, + search_ciliate_trna: bool = False, + search_mito_chloro_trna: bool = False, + allow_introns: bool = False, + introns_in_anticodon_only: bool = False, + linear_sequence: bool = False, + search_protein_coding: bool = False, + protein_search_shift: int = 1, + no_search_definition_line: bool = False, + all_genes: bool = False, + less_stringent_cutoff: bool = False, + tmrna_genetic_code: int = 1, + tmrna_genetic_code_blast: Optional[Path] = None, +): + """ + Detects tRNA and tmRNA genes in nucleotide sequences using ARAGORN. + + ARAGORN is a program to detect tRNA genes and tmRNA genes in nucleotide sequences. + It is designed to be fast and accurate, and can handle both circular and linear sequences. + + Args: + fasta_file: Input FASTA file containing nucleotide sequences. + output_file: Write output to this file instead of stdout. + overwrite_output: Overwrite the output file if it exists. Used with -o. + verbose: Print out statistics and other verbose output. + batch_format: Print out in batch format for all sequences. + output_format: Specify the output format. Choices: 'fasta', 'compact_fasta', 'fasta_no_structure', 'bracket_structure', 'sequences_only'. + search_trna: Search for tRNA genes (this is the default behavior). + search_tmrna: Search for tmRNA genes. + search_ciliate_trna: Search for tRNA genes using the ciliate genetic code. + search_mito_chloro_trna: Search for tRNA genes using the mitochondrial/chloroplast genetic code. + allow_introns: Allow introns in tRNA genes. + introns_in_anticodon_only: Allow introns only in the anticodon loop (requires allow_introns=True). + linear_sequence: Assume linear sequence (default is circular). + search_protein_coding: Search protein coding sequence for tmRNA. + protein_search_shift: Shift for protein search (1, 2, or 3). Requires search_protein_coding=True to have an effect. + no_search_definition_line: Do not search on the definition line of the FASTA file. + all_genes: Print out all found genes, including pseudogenes. + less_stringent_cutoff: Use a less stringent score cutoff. + tmrna_genetic_code: Specify the genetic code for tmRNA search. Valid codes are 1-6, 9-16, 21-26. Default is 1 (standard code). + tmrna_genetic_code_blast: Specify the genetic code for tmRNA search using a file in BLAST format. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + # --- Input Validation --- + if not fasta_file.is_file(): + raise FileNotFoundError(f"Input FASTA file not found: {fasta_file}") + + if not any([search_trna, search_tmrna, search_ciliate_trna, search_mito_chloro_trna]): + raise ValueError("At least one search type must be enabled (e.g., search_trna, search_tmrna).") + + if output_format: + allowed_formats = ["fasta", "compact_fasta", "fasta_no_structure", "bracket_structure", "sequences_only"] + if output_format not in allowed_formats: + raise ValueError(f"Invalid output_format '{output_format}'. Allowed values are: {', '.join(allowed_formats)}") + + if introns_in_anticodon_only and not allow_introns: + raise ValueError("introns_in_anticodon_only=True (-io) requires allow_introns=True (-i).") + + if protein_search_shift not in [1, 2, 3]: + raise ValueError(f"protein_search_shift must be 1, 2, or 3, but got {protein_search_shift}.") + + if not search_protein_coding and protein_search_shift != 1: + raise ValueError("Specifying a protein_search_shift other than 1 requires search_protein_coding=True.") + + allowed_gc = list(range(1, 7)) + list(range(9, 17)) + list(range(21, 27)) + if tmrna_genetic_code not in allowed_gc: + raise ValueError(f"tmrna_genetic_code must be one of {allowed_gc}, but got {tmrna_genetic_code}.") + + if tmrna_genetic_code_blast: + if not tmrna_genetic_code_blast.is_file(): + raise FileNotFoundError(f"Genetic code BLAST file not found: {tmrna_genetic_code_blast}") + if tmrna_genetic_code != 1: + raise ValueError("Cannot specify both tmrna_genetic_code (-gc) and tmrna_genetic_code_blast (-gcb) simultaneously.") + + # --- Command Construction --- + cmd: List[str] = ["aragorn"] + + if verbose: + cmd.append("-v") + if batch_format: + cmd.append("-w") + + if output_file: + cmd.extend(["-o", str(output_file)]) + if overwrite_output: + cmd.append("-fo") + + if output_format: + format_map = { + "fasta": "-fasta", + "compact_fasta": "-fastc", + "fasta_no_structure": "-fons", + "bracket_structure": "-br", + "sequences_only": "-seq", + } + cmd.append(format_map[output_format]) + + if search_trna: + cmd.append("-t") + if search_tmrna: + cmd.append("-m") + if search_ciliate_trna: + cmd.append("-c") + if search_mito_chloro_trna: + cmd.append("-g") + + if allow_introns: + cmd.append("-i") + if introns_in_anticodon_only: + cmd.append("-io") + + if linear_sequence: + cmd.append("-l") + + if search_protein_coding: + cmd.append("-p") + cmd.append(f"-ps{protein_search_shift}") + + if no_search_definition_line: + cmd.append("-d") + if all_genes: + cmd.append("-a") + if less_stringent_cutoff: + cmd.append("-sc") + + if tmrna_genetic_code_blast: + cmd.extend(["-gcb", str(tmrna_genetic_code_blast)]) + else: + cmd.append(f"-gc{tmrna_genetic_code}") + + cmd.append(str(fasta_file)) + + # --- Subprocess Execution --- + command_str = " ".join(cmd) + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + except FileNotFoundError: + raise RuntimeError("aragorn executable not found. Please ensure it is in your system's PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": command_str, + "stdout": e.stdout, + "stderr": e.stderr, + "return_code": e.returncode, + "output_files": [], + } + + # --- Output Handling --- + output_files_list: List[str] = [] + if output_file: + if output_file.exists(): + output_files_list.append(str(output_file)) + + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files_list, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..101db851d0701fc6d8d572810bec9a75037b69cd --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/aragorn_server.py') +SERVER_NAME = 'biosci_aragorn' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..90e1e956e6c62b275450b10dc67a2ed34c58bb0c --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-aragorn: + build: . + image: mcp-aragorn:latest + container_name: mcp-aragorn + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=aragorn + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..613d2e28d7109c3855893da6fba0c4cf25384747 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - aragorn + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aragorn/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b4cb6c099c9996d6e3a809fe1b5f509b65a9dff1 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install aria2 via conda (e.g., from bioconda) +RUN conda install -c bioconda aria2 -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY aria2_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/aria2_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/aria2_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5f7b1304dcb2b682a79060a6388d89a9e7008897 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py @@ -0,0 +1,307 @@ +import subprocess +from pathlib import Path +from typing import List, Optional, Union + +@mcp.tool() +def aria2_download( + uris: List[str], + dir: Optional[str] = None, + out: Optional[str] = None, + split: int = 5, + max_connection_per_server: int = 1, + min_split_size: str = "20M", + continue_download: bool = True, + max_download_limit: str = "0", + user_agent: Optional[str] = None, + header: Optional[List[str]] = None, + all_proxy: Optional[str] = None, +): + """ + Download files from HTTP/HTTPS/FTP/SFTP URIs using aria2c. + + :param uris: List of URIs to download. + :param dir: The directory to store the downloaded file. + :param out: The file name of the downloaded file. + :param split: Download a file using N connections. + :param max_connection_per_server: The maximum number of connections to one server for each download. + :param min_split_size: aria2 does not split less than this size. (e.g., 20M) + :param continue_download: Continue downloading a partially downloaded file. + :param max_download_limit: Set max download speed in bytes/sec. 0 means unrestricted. (e.g., 1M, 500K) + :param user_agent: Set user agent. + :param header: Append HTTP header. + :param all_proxy: Use proxy server for all protocols. + """ + cmd = ["aria2c"] + + if dir: + path_dir = Path(dir) + path_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--dir", str(path_dir)]) + + if out: + cmd.extend(["--out", out]) + + cmd.extend([ + f"--split={split}", + f"--max-connection-per-server={max_connection_per_server}", + f"--min-split-size={min_split_size}", + f"--continue={str(continue_download).lower()}", + f"--max-download-limit={max_download_limit}" + ]) + + if user_agent: + cmd.extend([f"--user-agent={user_agent}"]) + + if header: + for h in header: + cmd.extend([f"--header={h}"]) + + if all_proxy: + cmd.extend([f"--all-proxy={all_proxy}"]) + + cmd.extend(uris) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def aria2_torrent( + torrent_path: str, + dir: Optional[str] = None, + seed_time: int = 0, + max_upload_limit: str = "0", + listen_port: str = "6881-6999", + select_file: Optional[str] = None, + follow_torrent: str = "true", +): + """ + Download files using a BitTorrent file or Magnet URI. + + :param torrent_path: Path to .torrent file or a Magnet URI. + :param dir: The directory to store the downloaded file. + :param seed_time: Specify seeding time in minutes. 0 means do not seed. + :param max_upload_limit: Set max upload speed in bytes/sec. + :param listen_port: Set TCP port number for BitTorrent. + :param select_file: Index of the file to download (e.g., "1,2,5"). + :param follow_torrent: If 'true' or 'mem', aria2 will download the torrent file if URI is a torrent file. + """ + cmd = ["aria2c"] + + if dir: + path_dir = Path(dir) + path_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--dir", str(path_dir)]) + + cmd.extend([ + f"--seed-time={seed_time}", + f"--max-upload-limit={max_upload_limit}", + f"--listen-port={listen_port}", + f"--follow-torrent={follow_torrent}" + ]) + + if select_file: + cmd.extend([f"--select-file={select_file}"]) + + # Check if it's a local file or a magnet link + if not torrent_path.startswith("magnet:?"): + path_torrent = Path(torrent_path) + if not path_torrent.exists(): + return {"error": f"Torrent file not found: {torrent_path}"} + cmd.append(str(path_torrent)) + else: + cmd.append(torrent_path) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def aria2_metalink( + metalink_file: str, + dir: Optional[str] = None, + metalink_language: Optional[str] = None, + metalink_location: Optional[str] = None, + metalink_os: Optional[str] = None, +): + """ + Download files using a Metalink file. + + :param metalink_file: Path to the .metalink file. + :param dir: The directory to store the downloaded file. + :param metalink_language: The language of the file to download. + :param metalink_location: The location of the preferred server. + :param metalink_os: The operating system of the file to download. + """ + path_meta = Path(metalink_file) + if not path_meta.exists(): + return {"error": f"Metalink file not found: {metalink_file}"} + + cmd = ["aria2c"] + + if dir: + path_dir = Path(dir) + path_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--dir", str(path_dir)]) + + if metalink_language: + cmd.extend([f"--metalink-language={metalink_language}"]) + if metalink_location: + cmd.extend([f"--metalink-location={metalink_location}"]) + if metalink_os: + cmd.extend([f"--metalink-os={metalink_os}"]) + + cmd.append(str(path_meta)) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def aria2_batch_download( + input_file: str, + dir: Optional[str] = None, + force_sequential: bool = False, + max_concurrent_downloads: int = 5, + parameterized_uris: bool = False, +): + """ + Download multiple URIs from a text file. + + :param input_file: Path to the file containing URIs (one per line). + :param dir: The directory to store the downloaded files. + :param force_sequential: Fetch URIs in the order they appear in the input file. + :param max_concurrent_downloads: Set maximum number of parallel downloads. + :param parameterized_uris: Enable parameterized URI support (e.g. http://{host1,host2}/file). + """ + path_input = Path(input_file) + if not path_input.exists(): + return {"error": f"Input file not found: {input_file}"} + + cmd = ["aria2c", f"--input-file={str(path_input)}"] + + if dir: + path_dir = Path(dir) + path_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--dir", str(path_dir)]) + + cmd.extend([ + f"--force-sequential={str(force_sequential).lower()}", + f"--max-concurrent-downloads={max_concurrent_downloads}", + f"--parameterized-uri={str(parameterized_uris).lower()}" + ]) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } + +@mcp.tool() +def aria2_rpc_server( + rpc_listen_port: int = 6800, + rpc_listen_all: bool = False, + rpc_secret: Optional[str] = None, + rpc_allow_origin_all: bool = False, + rpc_max_request_size: str = "2M", + daemon: bool = False, +): + """ + Start aria2 in RPC mode to allow remote control via JSON-RPC or XML-RPC. + + :param rpc_listen_port: Port number for RPC server. + :param rpc_listen_all: Listen for RPC requests on all network interfaces. + :param rpc_secret: Set RPC secret authorization token. + :param rpc_allow_origin_all: Add Access-Control-Allow-Origin: * to HTTP response. + :param rpc_max_request_size: Set max size of JSON-RPC/XML-RPC request. + :param daemon: Run as a background process. + """ + cmd = ["aria2c", "--enable-rpc"] + + cmd.extend([ + f"--rpc-listen-port={rpc_listen_port}", + f"--rpc-listen-all={str(rpc_listen_all).lower()}", + f"--rpc-allow-origin-all={str(rpc_allow_origin_all).lower()}", + f"--rpc-max-request-size={rpc_max_request_size}", + f"--daemon={str(daemon).lower()}" + ]) + + if rpc_secret: + cmd.append(f"--rpc-secret={rpc_secret}") + + try: + # If daemon is True, we don't wait for completion + if daemon: + subprocess.Popen(cmd) + return { + "command_executed": " ".join(cmd), + "status": "daemon_started", + "message": f"aria2 RPC server started in background on port {rpc_listen_port}" + } + else: + # This will block until the server is stopped + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "error" + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..58ac281d1c04b03249811a51d426b4d92554d94e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/app/aria2_server.py') +SERVER_NAME = 'biosci_aria2' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..ea7d8cc280282474edf221e8b8d2093ad080830f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-aria2: + build: . + image: mcp-aria2:latest + container_name: mcp-aria2 + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=aria2 + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6b289d129e8969673e82632e5d437191907dc251 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - aria2 + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_aria2/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..64f32321bcd1440c4b47360773aa12ac582f949e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install ariba via conda (e.g., from bioconda) +RUN conda install -c bioconda ariba -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/ariba_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/ariba_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/ariba_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_server.py new file mode 100644 index 0000000000000000000000000000000000000000..46ae5ebe025b76316d8b4866d8006084d8df4830 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_server.py @@ -0,0 +1,509 @@ +import subprocess +import tempfile +import os +from pathlib import Path +from typing import Optional, List, Literal + +# MCP decorator is not needed for the final code, as per instructions. +# Assuming it's provided by the MCP framework. +# from mcp import tool as mcp_tool +# For linting purposes, we can create a dummy decorator. +class mcp: + def tool(func): + return func + +@mcp.tool +def pubmlstget( + pubmlst_db: str, + outdir: Path, + force: bool = False, + noverify: bool = False, +): + """ + Download data from a pubmlst database. + + Args: + pubmlst_db: Name of the pubmlst database to download. + outdir: Output directory to save the downloaded data. + force: Overwrite existing files if they exist. + noverify: Do not verify the SSL certificate. + """ + # Input validation + if not pubmlst_db: + raise ValueError("pubmlst_db must be provided.") + + try: + outdir.mkdir(parents=True, exist_ok=True) + except Exception as e: + raise IOError(f"Could not create output directory {outdir}: {e}") + + # Command construction + cmd = ["ariba", "pubmlstget"] + if force: + cmd.append("--force") + if noverify: + cmd.append("--noverify") + cmd.extend([pubmlst_db, str(outdir)]) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files = [str(p) for p in outdir.rglob("*") if p.is_file()] + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA pubmlstget failed", + "return_code": e.returncode, + } + +@mcp.tool +def getref( + ref_name: Literal[ + "argannot", "card", "megares", "plasmidfinder", "resfinder", + "srst2_argannot", "vfdb_core", "vfdb_full", "virfinder" + ], + outdir: Path, + force: bool = False, + metadata_only: bool = False, +): + """ + Download reference data from NCBI/RefSeq or other sources. + + Args: + ref_name: Name of reference data to download. + outdir: Output directory to save the reference data. + force: Overwrite existing files if they exist. + metadata_only: Only download metadata, not the sequences. + """ + # Input validation + try: + outdir.mkdir(parents=True, exist_ok=True) + except Exception as e: + raise IOError(f"Could not create output directory {outdir}: {e}") + + # Command construction + cmd = ["ariba", "getref"] + if force: + cmd.append("--force") + if metadata_only: + cmd.append("--metadata_only") + cmd.extend([ref_name, str(outdir)]) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files = [str(p) for p in outdir.rglob("*") if p.is_file()] + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA getref failed", + "return_code": e.returncode, + } + +@mcp.tool +def prepareref( + fasta_in: Path, + metadata_in: Path, + outdir: Path, + min_length: int = 1, + max_length: int = 10000, + max_n: int = 5, + no_cdhit: bool = False, + cdhit_clusters: Optional[Path] = None, + cdhit_threads: int = 1, + cdhit_mem: int = 400, + force: bool = False, + tmp_dir: Optional[Path] = None, + verbose: bool = False, + debug: bool = False, +): + """ + Prepare reference data for use with ARIBA. + + Args: + fasta_in: Input FASTA file of sequences. + metadata_in: Input TSV file of metadata. + outdir: Output directory for prepared reference. + min_length: Minimum sequence length. + max_length: Maximum sequence length. + max_n: Maximum number of Ns allowed in a sequence. + no_cdhit: Do not run cd-hit. + cdhit_clusters: File of cd-hit clusters. Implies --no_cdhit. + cdhit_threads: Threads to use for cd-hit. + cdhit_mem: Memory for cd-hit in MB. + force: Overwrite existing files. + tmp_dir: Use this directory for temporary files. + verbose: Print STDOUT and STDERR from external programs. + debug: Print debugging messages. + """ + # Input validation + if not fasta_in.is_file(): + raise FileNotFoundError(f"Input FASTA file not found: {fasta_in}") + if not metadata_in.is_file(): + raise FileNotFoundError(f"Input metadata file not found: {metadata_in}") + if cdhit_clusters and not cdhit_clusters.is_file(): + raise FileNotFoundError(f"cd-hit clusters file not found: {cdhit_clusters}") + if min_length <= 0: + raise ValueError("min_length must be a positive integer.") + if cdhit_threads <= 0: + raise ValueError("cdhit_threads must be a positive integer.") + + try: + outdir.mkdir(parents=True, exist_ok=True) + except Exception as e: + raise IOError(f"Could not create output directory {outdir}: {e}") + + # Command construction + cmd = ["ariba", "prepareref", + "--fasta_in", str(fasta_in), + "--metadata_in", str(metadata_in), + "--outdir", str(outdir), + "--min_length", str(min_length), + "--max_length", str(max_length), + "--max_N", str(max_n), + "--cdhit_threads", str(cdhit_threads), + "--cdhit_mem", str(cdhit_mem)] + + if no_cdhit: + cmd.append("--no_cdhit") + if cdhit_clusters: + cmd.extend(["--cdhit_clusters", str(cdhit_clusters)]) + if force: + cmd.append("--force") + if tmp_dir: + cmd.extend(["--tmp_dir", str(tmp_dir)]) + if verbose: + cmd.append("--verbose") + if debug: + cmd.append("--debug") + + # Subprocess execution + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files = [str(p) for p in outdir.rglob("*") if p.is_file()] + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA prepareref failed", + "return_code": e.returncode, + } + +@mcp.tool +def run( + ref_dir: Path, + reads1: Path, + reads2: Path, + outdir: Path, + assembly_cov: int = 10, + gene_cov_cutoff: float = 0.95, + gene_nt_extend: int = 10, + local_th: float = 0.9, + min_gene_cov: int = 1, + assembled_threshold: float = 0.95, + nucmer_min_id: int = 90, + nucmer_min_len: int = 50, + nucmer_breaklen: int = 10, + nucmer_max_gap: int = 20, + assembler: Literal["fermilite", "spades"] = "fermilite", + spades_options: str = "--careful", + threads: int = 1, + force: bool = False, + tmp_dir: Optional[Path] = None, + verbose: bool = False, + debug: bool = False, + noclean: bool = False, + unique_map_only: bool = False, + other_ref_fasta: Optional[Path] = None, + filestem: Optional[str] = None, +): + """ + Run the main ARIBA pipeline to identify genes from paired sequencing reads. + + Args: + ref_dir: Reference directory, created by 'prepareref'. + reads1: First paired-end reads file. + reads2: Second paired-end reads file. + outdir: Output directory for results. + assembly_cov: Minimum coverage of internal contig flank. + gene_cov_cutoff: Minimum proportion of gene length covered by reads. + gene_nt_extend: Max nucleotides to extend assembly past gene ends. + local_th: Minimum proportion of bases in local assembly identical to reference. + min_gene_cov: Minimum read coverage depth on any base of a gene. + assembled_threshold: Minimum proportion of bases in a gene covered by local assembly. + nucmer_min_id: nucmer --minid option. + nucmer_min_len: nucmer --mincluster option. + nucmer_breaklen: nucmer --breaklen option. + nucmer_max_gap: nucmer --maxgap option. + assembler: Assembler to use. + spades_options: Options to pass to spades. + threads: Number of threads to use. + force: Overwrite existing output files. + tmp_dir: Use this directory for temporary files. + verbose: Print STDOUT and STDERR from external programs. + debug: Print debugging messages. + noclean: Do not clean up intermediate files. + unique_map_only: Only use uniquely mapping reads. + other_ref_fasta: FASTA file of other reference sequences (e.g., host genome). + filestem: Filestem to use for output files. + """ + # Input validation + if not ref_dir.is_dir(): + raise FileNotFoundError(f"Reference directory not found: {ref_dir}") + if not reads1.is_file(): + raise FileNotFoundError(f"Reads file 1 not found: {reads1}") + if not reads2.is_file(): + raise FileNotFoundError(f"Reads file 2 not found: {reads2}") + if other_ref_fasta and not other_ref_fasta.is_file(): + raise FileNotFoundError(f"Other reference FASTA not found: {other_ref_fasta}") + if threads <= 0: + raise ValueError("threads must be a positive integer.") + + try: + outdir.mkdir(parents=True, exist_ok=True) + except Exception as e: + raise IOError(f"Could not create output directory {outdir}: {e}") + + # Command construction + cmd = ["ariba", "run", + "--assembly_cov", str(assembly_cov), + "--gene_cov_cutoff", str(gene_cov_cutoff), + "--gene_nt_extend", str(gene_nt_extend), + "--local_th", str(local_th), + "--min_gene_cov", str(min_gene_cov), + "--assembled_threshold", str(assembled_threshold), + "--nucmer_min_id", str(nucmer_min_id), + "--nucmer_min_len", str(nucmer_min_len), + "--nucmer_breaklen", str(nucmer_breaklen), + "--nucmer_max_gap", str(nucmer_max_gap), + "--assembler", assembler, + "--spades_options", spades_options, + "--threads", str(threads)] + + if force: cmd.append("--force") + if verbose: cmd.append("--verbose") + if debug: cmd.append("--debug") + if noclean: cmd.append("--noclean") + if unique_map_only: cmd.append("--unique_map_only") + if tmp_dir: cmd.extend(["--tmp_dir", str(tmp_dir)]) + if other_ref_fasta: cmd.extend(["--other_ref_fasta", str(other_ref_fasta)]) + if filestem: cmd.extend(["--filestem", filestem]) + + cmd.extend([str(ref_dir), str(reads1), str(reads2), str(outdir)]) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files = [str(p) for p in outdir.rglob("*") if p.is_file()] + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA run failed", + "return_code": e.returncode, + } + +@mcp.tool +def summary( + out_prefix: Path, + in_dirs: List[Path], + preset: Literal["all", "assembled", "flags", "variants"] = "all", + cluster_cols: Optional[str] = None, + col_sep: str = ".", + row_sep: str = ".", + force: bool = False, + verbose: bool = False, + debug: bool = False, +): + """ + Summarise multiple ARIBA reports into a single file. + + Args: + out_prefix: Output file prefix. + in_dirs: List of directories containing ARIBA results. + preset: Output preset. + cluster_cols: Columns to use for clustering. + col_sep: Separator between column names in output file. + row_sep: Separator between sample name and cluster name in output file. + force: Overwrite existing files. + verbose: Print STDOUT and STDERR from external programs. + debug: Print debugging messages. + """ + # Input validation + if not in_dirs: + raise ValueError("At least one input directory must be provided in in_dirs.") + for d in in_dirs: + if not d.is_dir(): + raise FileNotFoundError(f"Input directory not found: {d}") + report_path = d / "report.tsv" + if not report_path.is_file(): + raise FileNotFoundError(f"Expected report file not found in {d}: {report_path}") + + try: + out_prefix.parent.mkdir(parents=True, exist_ok=True) + except Exception as e: + raise IOError(f"Could not create output directory {out_prefix.parent}: {e}") + + # Command construction + cmd = ["ariba", "summary", + "--preset", preset, + "--col_sep", col_sep, + "--row_sep", row_sep] + + if cluster_cols: + cmd.extend(["--cluster_cols", cluster_cols]) + if force: + cmd.append("--force") + if verbose: + cmd.append("--verbose") + if debug: + cmd.append("--debug") + + cmd.append(str(out_prefix)) + cmd.extend([str(d) for d in in_dirs]) + + # Subprocess execution + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + output_files = [str(p) for p in out_prefix.parent.glob(f"{out_prefix.name}*")] + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": output_files, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA summary failed", + "return_code": e.returncode, + } + +@mcp.tool +def version(): + """ + Print the ARIBA version number and exit. + """ + cmd = ["ariba", "version"] + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "version": result.stdout.strip(), + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA version command failed", + "return_code": e.returncode, + } + +@mcp.tool +def test(): + """ + Run the ARIBA test suite to verify installation and functionality. + """ + cmd = ["ariba", "test"] + try: + # The test command can be long-running and produce a lot of output. + # We capture it as usual. + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "test_passed": "OK" in result.stderr, + } + except FileNotFoundError: + raise RuntimeError("ariba command not found. Please ensure it is in your PATH.") + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "ARIBA test suite failed", + "return_code": e.returncode, + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..922f0fe58b406ab66a2ac3540a04e60a38f1f85e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/ariba_server.py') +SERVER_NAME = 'biosci_ariba' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..3fe30327b9341b624c6029e37d388c193221cbca --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-ariba: + build: . + image: mcp-ariba:latest + container_name: mcp-ariba + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=ariba + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..774ae8821bdba1c2e80cce68add26a6a867b0ce5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - ariba + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_ariba/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..88040f31a7f70727c035d7c7287f2d3836aceba5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install arriba via conda (e.g., from bioconda) +RUN conda install -c bioconda arriba -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/arriba_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/arriba_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/arriba_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b16b6cb2f3f57e344e13eafa776cc579d517a939 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_server.py @@ -0,0 +1,189 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Union + +@mcp.tool() +def run_arriba( + bam_file: str, + genome_fasta: str, + annotation_gtf: str, + output_file: str, + blacklist_file: Optional[str] = None, + known_fusions_file: Optional[str] = None, + tags_file: Optional[str] = None, + protein_domains_file: Optional[str] = None, + discarded_fusions_file: Optional[str] = None, + max_coverage: int = 1000, + min_anchor_length: int = 20, + max_homopolymer_length: int = 5, + strandedness: str = "auto", + interesting_contigs: str = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 X Y MT", + min_support: int = 2, + max_genomic_distance: int = 1000000, + filters: str = "top_haplotype,homology,short_anchor,low_entropy,read_through,no_genomic_support,many_spliced,long_gap,intragenic_exonic,end_to_end,large_distance,pcr_fakes,relative_support,min_support", + fill_gaps: bool = False, + verbose: bool = False +) -> dict: + """ + Detect gene fusions from RNA-Seq data using Arriba. + + Args: + bam_file: Path to the input BAM file (STAR-aligned with chimeric output). + genome_fasta: Path to the genome assembly FASTA file. + annotation_gtf: Path to the gene annotation GTF file. + output_file: Path where detected fusions will be saved. + blacklist_file: Optional path to a file containing blacklisted fusion candidates. + known_fusions_file: Optional path to a file containing known fusion candidates. + tags_file: Optional path to a file containing tags for fusions. + protein_domains_file: Optional path to a file containing protein domain coordinates. + discarded_fusions_file: Optional path to save discarded fusion candidates. + max_coverage: Maximum number of reads to process per genomic position. + min_anchor_length: Minimum number of bases a read must overlap with both fusion partners. + max_homopolymer_length: Maximum length of homopolymers allowed at fusion junctions. + strandedness: Strandedness of the library (auto, yes, no, reverse). + interesting_contigs: Space-separated list of contigs to process. + min_support: Minimum number of supporting reads for a fusion candidate. + max_genomic_distance: Maximum genomic distance for intra-chromosomal fusions. + filters: Comma-separated list of filters to apply. + fill_gaps: Whether to fill gaps in the alignment. + verbose: Enable verbose output. + """ + # Input validation + input_paths = [bam_file, genome_fasta, annotation_gtf] + for p in input_paths: + if not Path(p).exists(): + return {"error": f"Input file not found: {p}"} + + # Build command + cmd = [ + "arriba", + "-x", bam_file, + "-a", genome_fasta, + "-g", annotation_gtf, + "-o", output_file, + "-c", str(max_coverage), + "-e", str(min_anchor_length), + "-d", str(max_homopolymer_length), + "-s", strandedness, + "-i", interesting_contigs, + "-m", str(min_support), + "-l", str(max_genomic_distance), + "-f", filters + ] + + # Optional parameters + if blacklist_file: + if Path(blacklist_file).exists(): + cmd.extend(["-b", blacklist_file]) + if known_fusions_file: + if Path(known_fusions_file).exists(): + cmd.extend(["-k", known_fusions_file]) + if tags_file: + if Path(tags_file).exists(): + cmd.extend(["-t", tags_file]) + if protein_domains_file: + if Path(protein_domains_file).exists(): + cmd.extend(["-p", protein_domains_file]) + if discarded_fusions_file: + cmd.extend(["-O", discarded_fusions_file]) + + if fill_gaps: + cmd.append("-u") + if verbose: + cmd.append("-v") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [output_file] + ([discarded_fusions_file] if discarded_fusions_file else []) + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def draw_fusions( + fusions_file: str, + output_pdf: str, + annotation_gtf: str, + cytobands_file: str, + protein_domains_gff: str, + bam_file: Optional[str] = None, + min_confidence_for_circos: str = "medium", + pdf_width: float = 11.69, + pdf_height: float = 8.27, + squish_introns: bool = False, + print_all_fusions: bool = False +) -> dict: + """ + Visualize gene fusions detected by Arriba using the draw_fusions.R script. + + Args: + fusions_file: Path to the fusions.tsv file generated by Arriba. + output_pdf: Path to the output PDF file. + annotation_gtf: Path to the gene annotation GTF file. + cytobands_file: Path to the cytobands file (coordinates of chromosome bands). + protein_domains_gff: Path to the protein domains GFF3 file. + bam_file: Optional path to the BAM file for coverage visualization. + min_confidence_for_circos: Minimum confidence level to include fusion in circos plot (low, medium, high). + pdf_width: Width of the output PDF in inches. + pdf_height: Height of the output PDF in inches. + squish_introns: Whether to shrink introns to save space. + print_all_fusions: Whether to print all fusions or only those passing filters. + """ + # Input validation + required_files = [fusions_file, annotation_gtf, cytobands_file, protein_domains_gff] + for f in required_files: + if not Path(f).exists(): + return {"error": f"Required file not found: {f}"} + + # Arriba's visualization is typically an R script named draw_fusions.R + # We assume it is in the PATH or we use the standard name. + cmd = [ + "draw_fusions.R", + f"--fusions={fusions_file}", + f"--output={output_pdf}", + f"--annotation={annotation_gtf}", + f"--cytobands={cytobands_file}", + f"--proteinDomains={protein_domains_gff}", + f"--minConfidenceForCircos={min_confidence_for_circos}", + f"--pdfWidth={pdf_width}", + f"--pdfHeight={pdf_height}" + ] + + if bam_file: + if Path(bam_file).exists(): + cmd.append(f"--alignments={bam_file}") + + if squish_introns: + cmd.append("--squishIntrons") + + if print_all_fusions: + cmd.append("--printAll") + + try: + # R scripts often need to be called via Rscript + full_cmd = ["Rscript"] + cmd + result = subprocess.run(full_cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(full_cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [output_pdf] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(full_cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + except FileNotFoundError: + return {"error": "draw_fusions.R or Rscript not found in PATH."} diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..725f50e04015684fa3fd9c164e56197e36f1cbbf --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/arriba_server.py') +SERVER_NAME = 'biosci_arriba' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..56ad5d8bc47ba31e57831b7b4a243da795e49f55 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-arriba: + build: . + image: mcp-arriba:latest + container_name: mcp-arriba + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=arriba + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3847a209fc77964b4f3dadebc06ed85f81fd525e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - arriba + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arriba/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1f8ef92ebbbda705aee88d67596a0c8dc29b11ae --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install art via conda (e.g., from bioconda) +RUN conda install -c bioconda art -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/art_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/art_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/art_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_server.py new file mode 100644 index 0000000000000000000000000000000000000000..dcadc163fd5c6da45fe5e4cb294fe6e27ae9282e --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_server.py @@ -0,0 +1,294 @@ +import subprocess +from pathlib import Path +from typing import Optional, List, Dict, Any + +@mcp.tool() +def art_illumina( + input_fasta: str, + output_prefix: str, + read_len: int, + fold_coverage: Optional[float] = None, + read_count: Optional[int] = None, + paired: bool = False, + mean_frag_len: Optional[float] = None, + std_dev: Optional[float] = None, + seq_sys: Optional[str] = None, + no_aln: bool = False, + sam_output: bool = False, + random_seed: Optional[int] = None, + id_prefix: Optional[str] = None, + q_shift: Optional[float] = None, + q_shift2: Optional[float] = None, + error_free: bool = False, + cigar_m: bool = False, + quiet: bool = False +): + """ + ART_Illumina: Simulation of Illumina Next-Generation Sequencing Reads. + + Args: + input_fasta: The name of DNA reference format file (FASTA). + output_prefix: The prefix of output files. + read_len: The length of reads to be simulated. + fold_coverage: The fold of read coverage to be simulated. + read_count: The number of reads to be simulated (alternative to fold_coverage). + paired: Indicate a paired-end read simulation. + mean_frag_len: The mean size of DNA fragments for paired-end simulations. + std_dev: The standard deviation of DNA fragment size for paired-end simulations. + seq_sys: The sequencing system (e.g., 'HS20', 'HS25', 'HSXn', 'MSv1', 'MSv3', 'NS50'). + no_aln: Do not output alignment file. + sam_output: Generate SAM alignment file. + random_seed: The seed for random number generator. + id_prefix: The prefix of read ID. + q_shift: The amount to shift every quality score for read 1. + q_shift2: The amount to shift every quality score for read 2. + error_free: Generate error-free reads. + cigar_m: Use M instead of =/X in SAM CIGAR strings. + quiet: Do not print log messages. + """ + # Input validation + input_path = Path(input_fasta) + if not input_path.exists(): + return {"error": f"Input FASTA file not found: {input_fasta}"} + + if fold_coverage is None and read_count is None: + return {"error": "Either fold_coverage (-f) or read_count (-n) must be specified."} + + cmd = ["art_illumina", "-i", str(input_path), "-o", output_prefix, "-l", str(read_len)] + + if fold_coverage is not None: + cmd.extend(["-f", str(fold_coverage)]) + if read_count is not None: + cmd.extend(["-n", str(read_count)]) + + if paired: + cmd.append("-p") + if mean_frag_len is not None: + cmd.extend(["-m", str(mean_frag_len)]) + if std_dev is not None: + cmd.extend(["-s", str(std_dev)]) + + if seq_sys: + cmd.extend(["-ss", seq_sys]) + if no_aln: + cmd.append("-na") + if sam_output: + cmd.append("-sam") + if random_seed is not None: + cmd.extend(["-rs", str(random_seed)]) + if id_prefix: + cmd.extend(["-id", id_prefix]) + if q_shift is not None: + cmd.extend(["-qs", str(q_shift)]) + if q_shift2 is not None: + cmd.extend(["-qs2", str(q_shift2)]) + if error_free: + cmd.append("-ef") + if cigar_m: + cmd.append("-M") + if quiet: + cmd.append("-q") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + + # Identify output files based on prefix + output_files = list(Path(".").glob(f"{output_prefix}*")) + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(f) for f in output_files] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def art_454( + input_fasta: str, + output_prefix: str, + read_len: int, + fold_coverage: Optional[float] = None, + read_count: Optional[int] = None, + paired: bool = False, + mean_frag_len: Optional[float] = None, + std_dev: Optional[float] = None, + random_seed: Optional[int] = None, + quiet: bool = False +): + """ + ART_454: Simulation of 454 Next-Generation Sequencing Reads. + + Args: + input_fasta: The name of DNA reference format file (FASTA). + output_prefix: The prefix of output files. + read_len: The length of reads to be simulated. + fold_coverage: The fold of read coverage to be simulated. + read_count: The number of reads to be simulated (alternative to fold_coverage). + paired: Indicate a paired-end read simulation. + mean_frag_len: The mean size of DNA fragments for paired-end simulations. + std_dev: The standard deviation of DNA fragment size for paired-end simulations. + random_seed: The seed for random number generator. + quiet: Do not print log messages. + """ + input_path = Path(input_fasta) + if not input_path.exists(): + return {"error": f"Input FASTA file not found: {input_fasta}"} + + if fold_coverage is None and read_count is None: + return {"error": "Either fold_coverage (-f) or read_count (-n) must be specified."} + + cmd = ["art_454", "-i", str(input_path), "-o", output_prefix, "-l", str(read_len)] + + if fold_coverage is not None: + cmd.extend(["-f", str(fold_coverage)]) + if read_count is not None: + cmd.extend(["-n", str(read_count)]) + + if paired: + cmd.append("-p") + if mean_frag_len is not None: + cmd.extend(["-m", str(mean_frag_len)]) + if std_dev is not None: + cmd.extend(["-s", str(std_dev)]) + + if random_seed is not None: + cmd.extend(["-r", str(random_seed)]) + if quiet: + cmd.append("-q") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + output_files = list(Path(".").glob(f"{output_prefix}*")) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(f) for f in output_files] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def art_solid( + input_fasta: str, + output_prefix: str, + read_len: int, + fold_coverage: Optional[float] = None, + read_count: Optional[int] = None, + paired: bool = False, + mean_frag_len: Optional[float] = None, + std_dev: Optional[float] = None, + random_seed: Optional[int] = None, + quiet: bool = False +): + """ + ART_SOLiD: Simulation of Applied Biosystems SOLiD Sequencing Reads. + + Args: + input_fasta: The name of DNA reference format file (FASTA). + output_prefix: The prefix of output files. + read_len: The length of reads to be simulated. + fold_coverage: The fold of read coverage to be simulated. + read_count: The number of reads to be simulated (alternative to fold_coverage). + paired: Indicate a paired-end read simulation. + mean_frag_len: The mean size of DNA fragments for paired-end simulations. + std_dev: The standard deviation of DNA fragment size for paired-end simulations. + random_seed: The seed for random number generator. + quiet: Do not print log messages. + """ + input_path = Path(input_fasta) + if not input_path.exists(): + return {"error": f"Input FASTA file not found: {input_fasta}"} + + if fold_coverage is None and read_count is None: + return {"error": "Either fold_coverage (-f) or read_count (-n) must be specified."} + + cmd = ["art_solid", "-i", str(input_path), "-o", output_prefix, "-l", str(read_len)] + + if fold_coverage is not None: + cmd.extend(["-f", str(fold_coverage)]) + if read_count is not None: + cmd.extend(["-n", str(read_count)]) + + if paired: + cmd.append("-p") + if mean_frag_len is not None: + cmd.extend(["-m", str(mean_frag_len)]) + if std_dev is not None: + cmd.extend(["-s", str(std_dev)]) + + if random_seed is not None: + cmd.extend(["-r", str(random_seed)]) + if quiet: + cmd.append("-q") + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + output_files = list(Path(".").glob(f"{output_prefix}*")) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(f) for f in output_files] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } + +@mcp.tool() +def art_profiler_illumina( + output_profile: str, + input_dir: str, + fastq_extension: str = "fastq", + threads: int = 1 +): + """ + ART_Profiler_Illumina: Create a sequencing error profile from Illumina FASTQ files. + + Args: + output_profile: The name of the output profile. + input_dir: The directory containing Illumina FASTQ files. + fastq_extension: The filename extension of FASTQ files (e.g., 'fastq' or 'fq'). + threads: The number of threads to use. + """ + input_path = Path(input_dir) + if not input_path.is_dir(): + return {"error": f"Input directory not found: {input_dir}"} + + cmd = ["art_profiler_illumina", output_profile, str(input_path), fastq_extension, str(threads)] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + + # Profiles usually create multiple files with the profile name + output_files = list(Path(".").glob(f"{output_profile}*")) + + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(f) for f in output_files] + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "error": str(e), + "stdout": e.stdout, + "stderr": e.stderr + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..2ce743536007027b98f01e9c1d0a1f3b6147d2a5 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/art_server.py') +SERVER_NAME = 'biosci_art' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..20a4c99583e31aef8ccc4dd148ee8a86340024bf --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-art: + build: . + image: mcp-art:latest + container_name: mcp-art + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=art + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..68a8cb972b530852a1afaa487e3e2afac9381bcf --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - art + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_art/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..423488fd7d0f8b606ec807078f367139784c480a --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install arvados-cwl-runner via conda (e.g., from bioconda) +RUN conda install -c bioconda arvados-cwl-runner -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/arvados-cwl-runner_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/arvados-cwl-runner_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/arvados-cwl-runner_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_server.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf352a006238910f8c5b6a06278a09edc300123 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_server.py @@ -0,0 +1,270 @@ +import subprocess +import os +from pathlib import Path +from typing import Optional, List, Union + +@mcp.tool() +def arvados_cwl_runner( + workflow: str, + job_order: Optional[str] = None, + project_uuid: Optional[str] = None, + name: Optional[str] = None, + output_name: Optional[str] = None, + local: bool = False, + api: str = "containers", + eval_timeout: float = 20.0, + log_level: str = "INFO", + enable_reuse: bool = True, + submit: bool = True, + wait: bool = True, + priority: int = 1, + cluster_id: Optional[str] = None, + storage_classes: str = "default", + tmpdir_prefix: Optional[str] = None, + debug: bool = False, +): + """ + Run a CWL workflow on Arvados or locally. + + Args: + workflow: Path to the CWL workflow file (.cwl). + job_order: Path to the input parameters file (YAML or JSON). + project_uuid: Arvados project UUID where the workflow should run. + name: Name for the pipeline instance or container request. + output_name: Name for the output collection. + local: Run the workflow locally instead of on the Arvados cluster. + api: Arvados API to use (containers or jobs). Default is containers. + eval_timeout: Time to wait for CWL expression evaluation (seconds). + log_level: Logging level (DEBUG, INFO, WARNING, ERROR). + enable_reuse: Enable job/container reuse. + submit: Submit the workflow to Arvados (True) or run it in the foreground (False). + wait: Wait for the workflow to complete before exiting. + priority: Workflow priority (1-1000). + cluster_id: Specific Arvados cluster ID to submit to. + storage_classes: Comma-separated list of storage classes for outputs. + tmpdir_prefix: Path prefix for temporary directories. + debug: Enable debug logging and keep temporary files. + """ + + # Input validation + workflow_path = Path(workflow) + if not workflow_path.exists(): + return {"error": f"Workflow file not found: {workflow}"} + + cmd = ["arvados-cwl-runner"] + + # Boolean flags + if local: + cmd.append("--local") + if not enable_reuse: + cmd.append("--disable-reuse") + if not submit: + cmd.append("--no-submit") + if not wait: + cmd.append("--no-wait") + if debug: + cmd.append("--debug") + + # String/Value parameters + cmd.extend(["--api", api]) + cmd.extend(["--eval-timeout", str(eval_timeout)]) + cmd.extend(["--log-level", log_level]) + cmd.extend(["--priority", str(priority)]) + cmd.extend(["--collection-storage-classes", storage_classes]) + + if project_uuid: + cmd.extend(["--project-uuid", project_uuid]) + if name: + cmd.extend(["--name", name]) + if output_name: + cmd.extend(["--output-name", output_name]) + if cluster_id: + cmd.extend(["--cluster-id", cluster_id]) + if tmpdir_prefix: + cmd.extend(["--tmpdir-prefix", tmpdir_prefix]) + + # Positional arguments + cmd.append(str(workflow_path)) + + if job_order: + job_order_path = Path(job_order) + if not job_order_path.exists(): + return {"error": f"Job order file not found: {job_order}"} + cmd.append(str(job_order_path)) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "failed" + } + +@mcp.tool() +def arvados_cwl_validate( + workflow: str, +): + """ + Validate a CWL workflow file for syntax and Arvados compatibility. + + Args: + workflow: Path to the CWL workflow file. + """ + workflow_path = Path(workflow) + if not workflow_path.exists(): + return {"error": f"Workflow file not found: {workflow}"} + + cmd = ["arvados-cwl-runner", "--validate", str(workflow_path)] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "valid" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": "Validation failed", + "status": "invalid" + } + +@mcp.tool() +def arvados_cwl_create_workflow( + workflow: str, + project_uuid: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, +): + """ + Register a CWL workflow in Arvados as a reusable Workflow object. + + Args: + workflow: Path to the CWL workflow file. + project_uuid: Arvados project UUID where the workflow should be stored. + name: Name for the workflow object in Arvados. + description: Description for the workflow. + """ + workflow_path = Path(workflow) + if not workflow_path.exists(): + return {"error": f"Workflow file not found: {workflow}"} + + cmd = ["arvados-cwl-runner", "--create-workflow"] + + if project_uuid: + cmd.extend(["--project-uuid", project_uuid]) + if name: + cmd.extend(["--name", name]) + if description: + cmd.extend(["--description", description]) + + cmd.append(str(workflow_path)) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "failed" + } + +@mcp.tool() +def arvados_cwl_update_workflow( + workflow_uuid: str, + workflow: str, + name: Optional[str] = None, + description: Optional[str] = None, +): + """ + Update an existing Arvados Workflow object with a new CWL definition. + + Args: + workflow_uuid: The UUID of the Arvados Workflow object to update. + workflow: Path to the new CWL workflow file. + name: New name for the workflow object. + description: New description for the workflow. + """ + workflow_path = Path(workflow) + if not workflow_path.exists(): + return {"error": f"Workflow file not found: {workflow}"} + + cmd = ["arvados-cwl-runner", "--update-workflow", workflow_uuid] + + if name: + cmd.extend(["--name", name]) + if description: + cmd.extend(["--description", description]) + + cmd.append(str(workflow_path)) + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "failed" + } + +@mcp.tool() +def arvados_cwl_create_template( + workflow: str, +): + """ + Create an Arvados Pipeline Template from a CWL workflow (legacy API). + + Args: + workflow: Path to the CWL workflow file. + """ + workflow_path = Path(workflow) + if not workflow_path.exists(): + return {"error": f"Workflow file not found: {workflow}"} + + cmd = ["arvados-cwl-runner", "--create-template", str(workflow_path)] + + try: + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "status": "success" + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "error": str(e), + "status": "failed" + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..ac33e21f727f95a44766c86ff4590df5d624bf34 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/arvados-cwl-runner_server.py') +SERVER_NAME = 'biosci_arvados_cwl_runner' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..000600a1167daca6b20962f4ae9a2b0d9216b88b --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-arvados-cwl-runner: + build: . + image: mcp-arvados-cwl-runner:latest + container_name: mcp-arvados-cwl-runner + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=arvados-cwl-runner + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9e7fbef47cb463330a5767e74fa2ef3533f39628 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - arvados-cwl-runner + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-cwl-runner/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ecd637f0e9cb70c85569202ef0c48d5e81dfcbc2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install arvados-python-client via conda (e.g., from bioconda) +RUN conda install -c bioconda arvados-python-client -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/arvados-python-client_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/arvados-python-client_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/arvados-python-client_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c8e5baf49f88600d47cce3b7f6b7d809322b9649 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_server.py @@ -0,0 +1,298 @@ +import subprocess +import tempfile +from pathlib import Path +from typing import List, Optional + +# MCP-standardized error handling +class MCPError(Exception): + def __init__(self, message, stderr): + self.message = message + self.stderr = stderr + super().__init__(self.message) + +def _run_command(cmd: List[str]): + """Helper function to run a command and handle exceptions.""" + try: + command_str = " ".join(cmd) + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True, + ) + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + raise MCPError(f"Command '{cmd[0]}' not found. Is arvados-python-client installed and in the PATH?", "") + except subprocess.CalledProcessError as e: + raise MCPError(f"Command '{' '.join(cmd)}' failed with exit code {e.returncode}", e.stderr) + +@mcp.tool() +def arv_get( + object_locator: str, + destination_path: Optional[Path] = None, + filename: Optional[str] = None, + force: bool = False, + recursive: bool = False, + progress: bool = False, +) -> dict: + """ + Downloads an object from Arvados Keep to a local path or standard output. + + Args: + object_locator: The UUID or portable data hash (PDH) of the object to download. + destination_path: Local path to save the object. If a directory, the original filename is used. If not provided, content is written to stdout. + filename: The name of the file to get from a collection. + force: Overwrite existing files if they exist. + recursive: Recursively download collections. + progress: Show a progress bar during download. + + Returns: + A dictionary containing the command executed, stdout, stderr, and a list of output files. + """ + cmd = ["arv-get"] + + if force: + cmd.append("--force") + if recursive: + cmd.append("--recursive") + if progress: + cmd.append("--progress") + if filename: + cmd.extend(["--filename", filename]) + + cmd.append(object_locator) + + output_files = [] + if destination_path: + # Ensure parent directory exists if a full path is given + if destination_path.parent and not destination_path.parent.is_dir(): + destination_path.parent.mkdir(parents=True, exist_ok=True) + cmd.append(str(destination_path)) + output_files.append(str(destination_path)) + + try: + result = _run_command(cmd) + result["output_files"] = output_files + return result + except MCPError as e: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": e.stderr, + "error": e.message, + "output_files": [], + } + +@mcp.tool() +def arv_put( + paths: List[Path], + name: Optional[str] = None, + owner: Optional[str] = None, + portable_data_hash: bool = False, + storage_class: Optional[str] = None, + num_retries: int = 5, + progress: bool = False, +) -> dict: + """ + Uploads local files or directories to Arvados Keep. + + Args: + paths: One or more local file or directory paths to upload. + name: Set the name of the new collection. + owner: Set the owner project UUID for the new collection. + portable_data_hash: Use portable data hash to identify the collection. + storage_class: The storage class for the data (e.g., 'default', 'trash'). + num_retries: Number of times to retry a failed API call. + progress: Show a progress bar during upload. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + if not paths: + raise ValueError("At least one path must be provided for upload.") + + for p in paths: + if not p.exists(): + raise FileNotFoundError(f"Input path does not exist: {p}") + + cmd = ["arv-put"] + + if name: + cmd.extend(["--name", name]) + if owner: + cmd.extend(["--owner", owner]) + if portable_data_hash: + cmd.append("--portable-data-hash") + if storage_class: + cmd.extend(["--storage-class", storage_class]) + if progress: + cmd.append("--progress") + + # num_retries is a standard arvados client option + cmd.extend(["--num-retries", str(num_retries)]) + + cmd.extend([str(p) for p in paths]) + + try: + result = _run_command(cmd) + result["output_files"] = [] + return result + except MCPError as e: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": e.stderr, + "error": e.message, + "output_files": [], + } + +@mcp.tool() +def arv_ls( + object_locator: str, + path: Optional[str] = None, + long_format: bool = False, + recursive: bool = False, + human_readable: bool = False, +) -> dict: + """ + Lists the contents of a collection in Arvados Keep. + + Args: + object_locator: The UUID or portable data hash (PDH) of the collection to list. + path: A path within the collection to list. + long_format: Use a long listing format (similar to ls -l). + recursive: List subdirectories recursively. + human_readable: With long_format, print sizes in human-readable format (e.g., 1K, 234M, 2G). + + Returns: + A dictionary containing the command executed, stdout (the listing), and stderr. + """ + cmd = ["arv-ls"] + + if long_format: + cmd.append("-l") + if recursive: + cmd.append("-R") + if human_readable: + cmd.append("-h") + + cmd.append(object_locator) + if path: + cmd.append(path) + + try: + result = _run_command(cmd) + result["output_files"] = [] + return result + except MCPError as e: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": e.stderr, + "error": e.message, + "output_files": [], + } + +@mcp.tool() +def arv_copy( + src_locators: List[str], + dest_project_uuid: str, + name: Optional[str] = None, + num_retries: int = 5, +) -> dict: + """ + Copies one or more objects to a destination project in Arvados. + + Args: + src_locators: A list of source object UUIDs or portable data hashes (PDHs). + dest_project_uuid: The UUID of the destination project. + name: New name for the object(s). If copying multiple objects, this is ignored. + num_retries: Number of times to retry a failed API call. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + if not src_locators: + raise ValueError("At least one source locator must be provided.") + if not dest_project_uuid: + raise ValueError("A destination project UUID must be provided.") + + cmd = ["arv-copy"] + + if name and len(src_locators) == 1: + cmd.extend(["--name", name]) + + cmd.extend(["--num-retries", str(num_retries)]) + + cmd.extend(src_locators) + cmd.append(dest_project_uuid) + + try: + result = _run_command(cmd) + result["output_files"] = [] + return result + except MCPError as e: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": e.stderr, + "error": e.message, + "output_files": [], + } + +@mcp.tool() +def arv_tag( + locator: str, + tags_to_add: Optional[List[str]] = None, + keys_to_remove: Optional[List[str]] = None, + list_tags: bool = False, + num_retries: int = 5, +) -> dict: + """ + Manipulates tags on an Arvados object. It can list, add, or remove tags. + + Args: + locator: The UUID or portable data hash (PDH) of the object to tag. + tags_to_add: A list of tags to add, in 'key' or 'key=value' format. + keys_to_remove: A list of tag keys to remove. + list_tags: If True, lists the existing tags on the object. + num_retries: Number of times to retry a failed API call. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["arv-tag"] + + cmd.extend(["--num-retries", str(num_retries)]) + + if list_tags: + cmd.append("--list") + + cmd.append(locator) + + if tags_to_add: + for tag in tags_to_add: + if "=" not in tag and " " in tag: + raise ValueError(f"Invalid tag format: '{tag}'. Use 'key=value' or 'key'.") + cmd.extend(tags_to_add) + + if keys_to_remove: + for key in keys_to_remove: + cmd.extend(["--remove", key]) + + try: + result = _run_command(cmd) + result["output_files"] = [] + return result + except MCPError as e: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": e.stderr, + "error": e.message, + "output_files": [], + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..ef74af81cbbc0022fa32d692fc83a861df4eb431 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/arvados-python-client_server.py') +SERVER_NAME = 'biosci_arvados_python_client' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..02aad23170e4a610ba487a57362c075d0945db87 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-arvados-python-client: + build: . + image: mcp-arvados-python-client:latest + container_name: mcp-arvados-python-client + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=arvados-python-client + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..98a0ca44cd7cf90bff7b67d19f0e9e9da6b423e9 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - arvados-python-client + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_arvados-python-client/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..87b91368de59547fcc3fed31bf150dce0337d518 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install atropos via conda (e.g., from bioconda) +RUN conda install -c bioconda atropos -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/atropos_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/atropos_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/atropos_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5c363cd26ddb0e87c3731749c732ef39ef7d54f2 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_server.py @@ -0,0 +1,274 @@ +import subprocess +import logging +from pathlib import Path +from typing import Optional, List, Dict, Any + +# In a real MCP environment, the 'mcp' object with its decorators would be provided by the framework. +# This is a placeholder to make the code runnable for demonstration purposes. +class mcp: + @staticmethod + def tool(): + def decorator(f): + return f + return decorator + +@mcp.tool() +def atropos_trim( + # --- Input/Output Options --- + output: Path, + single_end: Optional[Path] = None, + paired_end_first: Optional[Path] = None, + paired_end_second: Optional[Path] = None, + interleaved_input: Optional[Path] = None, + paired_output: Optional[Path] = None, + interleaved_output: bool = False, + untrimmed_output: Optional[Path] = None, + untrimmed_paired_output: Optional[Path] = None, + too_short_output: Optional[Path] = None, + too_short_paired_output: Optional[Path] = None, + too_long_output: Optional[Path] = None, + too_long_paired_output: Optional[Path] = None, + report_file: Optional[Path] = None, + report_formats: Optional[List[str]] = None, + log_file: Optional[Path] = None, + quality_base: int = 33, + file_format: Optional[str] = None, + + # --- Adapter Trimming Options --- + adapter: Optional[List[str]] = None, + front: Optional[List[str]] = None, + anywhere: Optional[List[str]] = None, + adapter2: Optional[List[str]] = None, + front2: Optional[List[str]] = None, + anywhere2: Optional[List[str]] = None, + error_rate: float = 0.1, + no_indels: bool = False, + times: int = 1, + overlap: int = 3, + match_read_wildcards: bool = False, + no_match_adapter_wildcards: bool = False, + no_trim: bool = False, + mask_adapter: bool = False, + + # --- Filtering and Modification Options --- + quality_cutoff: Optional[str] = None, + nextseq_trim: Optional[int] = None, + cut: Optional[str] = None, + cut_after_trim: Optional[str] = None, + minimum_length: Optional[int] = None, + maximum_length: Optional[int] = None, + max_n: Optional[float] = None, + discard_trimmed: bool = False, + discard_untrimmed: bool = False, + length_tag: Optional[str] = None, + strip_suffix: Optional[List[str]] = None, + prefix: Optional[str] = None, + suffix: Optional[str] = None, + trim_n: bool = False, + + # --- Paired-End Options --- + pair_filter: Optional[str] = None, + overwrite_pair_names: bool = False, + + # --- Performance Options --- + threads: int = 1 +) -> Dict[str, Any]: + """ + Trims adapters and performs quality control on high-throughput sequencing data using Atropos. + + This tool wraps the 'atropos trim' command, providing a comprehensive interface to its features + for single-end, paired-end, and interleaved FASTQ/FASTA data. + """ + # --- Input Validation --- + input_modes = sum([ + single_end is not None, + (paired_end_first is not None and paired_end_second is not None), + interleaved_input is not None + ]) + if input_modes != 1: + raise ValueError("You must specify exactly one input mode: 'single_end', 'paired_end_first'/'paired_end_second', or 'interleaved_input'.") + + if (paired_end_first and not paired_end_second) or (paired_end_second and not paired_end_first): + raise ValueError("'paired_end_first' and 'paired_end_second' must be specified together.") + + if paired_end_first and not paired_output: + raise ValueError("'paired_output' is required for paired-end trimming.") + + if single_end and not single_end.is_file(): + raise FileNotFoundError(f"Input file not found: {single_end}") + if paired_end_first and not paired_end_first.is_file(): + raise FileNotFoundError(f"Input file not found: {paired_end_first}") + if paired_end_second and not paired_end_second.is_file(): + raise FileNotFoundError(f"Input file not found: {paired_end_second}") + if interleaved_input and not interleaved_input.is_file(): + raise FileNotFoundError(f"Input file not found: {interleaved_input}") + + if not (0.0 <= error_rate <= 1.0): + raise ValueError(f"'error_rate' must be between 0.0 and 1.0, but was {error_rate}.") + if threads < 1: + raise ValueError(f"'threads' must be at least 1, but was {threads}.") + if times < 1: + raise ValueError(f"'times' must be at least 1, but was {times}.") + if overlap < 1: + raise ValueError(f"'overlap' must be at least 1, but was {overlap}.") + if quality_base not in [33, 64]: + raise ValueError(f"'quality_base' must be 33 or 64, but was {quality_base}.") + if pair_filter and pair_filter not in ['any', 'both', 'first']: + raise ValueError(f"'pair_filter' must be one of 'any', 'both', 'first', but was {pair_filter}.") + if report_formats: + valid_formats = {'json', 'txt', 'yaml', 'csv'} + for fmt in report_formats: + if fmt not in valid_formats: + raise ValueError(f"Invalid report format '{fmt}'. Must be one of {valid_formats}.") + + # --- Command Construction --- + cmd = ["atropos", "trim"] + output_files = [] + + # Input/Output + cmd.extend(["-o", str(output)]) + output_files.append(str(output)) + + if single_end: + cmd.extend(["-se", str(single_end)]) + if paired_end_first: + cmd.extend(["-pe1", str(paired_end_first), "-pe2", str(paired_end_second)]) + if interleaved_input: + cmd.extend(["--interleaved-input", str(interleaved_input)]) + if paired_output: + cmd.extend(["-p", str(paired_output)]) + output_files.append(str(paired_output)) + if interleaved_output: + cmd.append("--interleaved-output") + if untrimmed_output: + cmd.extend(["--untrimmed-output", str(untrimmed_output)]) + output_files.append(str(untrimmed_output)) + if untrimmed_paired_output: + cmd.extend(["--untrimmed-paired-output", str(untrimmed_paired_output)]) + output_files.append(str(untrimmed_paired_output)) + if too_short_output: + cmd.extend(["--too-short-output", str(too_short_output)]) + output_files.append(str(too_short_output)) + if too_short_paired_output: + cmd.extend(["--too-short-paired-output", str(too_short_paired_output)]) + output_files.append(str(too_short_paired_output)) + if too_long_output: + cmd.extend(["--too-long-output", str(too_long_output)]) + output_files.append(str(too_long_output)) + if too_long_paired_output: + cmd.extend(["--too-long-paired-output", str(too_long_paired_output)]) + output_files.append(str(too_long_paired_output)) + if report_file: + cmd.extend(["--report-file", str(report_file)]) + output_files.append(str(report_file)) + if report_formats: + for fmt in report_formats: + cmd.extend(["--report-formats", fmt]) + if log_file: + cmd.extend(["--log-file", str(log_file)]) + output_files.append(str(log_file)) + if quality_base != 33: + cmd.extend(["--quality-base", str(quality_base)]) + if file_format: + cmd.extend(["--format", file_format]) + + # Adapters + if adapter: + for a in adapter: cmd.extend(["-a", a]) + if front: + for g in front: cmd.extend(["-g", g]) + if anywhere: + for b in anywhere: cmd.extend(["-b", b]) + if adapter2: + for a in adapter2: cmd.extend(["-A", a]) + if front2: + for g in front2: cmd.extend(["-G", g]) + if anywhere2: + for b in anywhere2: cmd.extend(["-B", b]) + if error_rate != 0.1: + cmd.extend(["-e", str(error_rate)]) + if no_indels: + cmd.append("--no-indels") + if times != 1: + cmd.extend(["-n", str(times)]) + if overlap != 3: + cmd.extend(["-O", str(overlap)]) + if match_read_wildcards: + cmd.append("--match-read-wildcards") + if no_match_adapter_wildcards: + cmd.append("-N") + if no_trim: + cmd.append("--no-trim") + if mask_adapter: + cmd.append("--mask-adapter") + + # Filtering/Modification + if quality_cutoff: + cmd.extend(["-q", quality_cutoff]) + if nextseq_trim is not None: + cmd.extend(["--nextseq-trim", str(nextseq_trim)]) + if cut: + cmd.extend(["--cut", cut]) + if cut_after_trim: + cmd.extend(["--cut-after-trim", cut_after_trim]) + if minimum_length is not None: + cmd.extend(["-m", str(minimum_length)]) + if maximum_length is not None: + cmd.extend(["-l", str(maximum_length)]) + if max_n is not None: + cmd.extend(["--max-n", str(max_n)]) + if discard_trimmed: + cmd.append("--discard-trimmed") + if discard_untrimmed: + cmd.append("--discard-untrimmed") + if length_tag: + cmd.extend(["--length-tag", length_tag]) + if strip_suffix: + for s in strip_suffix: cmd.extend(["--strip-suffix", s]) + if prefix: + cmd.extend(["--prefix", prefix]) + if suffix: + cmd.extend(["--suffix", suffix]) + if trim_n: + cmd.append("--trim-n") + + # Paired-End + if pair_filter: + cmd.extend(["--pair-filter", pair_filter]) + if overwrite_pair_names: + cmd.append("--overwrite-pair-names") + + # Performance + if threads != 1: + cmd.extend(["-T", str(threads)]) + + # --- Subprocess Execution --- + command_str = " ".join(cmd) + logging.info(f"Executing command: {command_str}") + + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + encoding='utf-8' + ) + return { + "command_executed": command_str, + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": [str(p) for p in output_files] + } + except subprocess.CalledProcessError as e: + logging.error(f"Atropos execution failed with return code {e.returncode}") + logging.error(f"Stdout: {e.stdout}") + logging.error(f"Stderr: {e.stderr}") + raise RuntimeError( + f"Atropos failed with exit code {e.returncode}.\n" + f"Command: {command_str}\n" + f"Stderr: {e.stderr}\n" + f"Stdout: {e.stdout}" + ) from e + except FileNotFoundError: + raise RuntimeError("atropos command not found. Please ensure it is installed and in your PATH.") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..75911c3bbb29fb8c9fbff746406330e1fd05ed49 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/atropos_server.py') +SERVER_NAME = 'biosci_atropos' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..fa10de1021a8dac44d981f66c7fca25a7ba5accd --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-atropos: + build: . + image: mcp-atropos:latest + container_name: mcp-atropos + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=atropos + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6937fbbb646912ebb8dc709e75a9fcc0c3bf4599 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - atropos + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_atropos/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_augur/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_augur/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_augur/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/Dockerfile b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d25db4d616a48de43407b52e112dc59dc8f0ce5f --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/Dockerfile @@ -0,0 +1,40 @@ + +FROM python:3.10-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y default-jre wget curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Miniconda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && bash /tmp/miniconda.sh -b -p /opt/conda && rm /tmp/miniconda.sh + +# Add conda to PATH +ENV PATH="/opt/conda/bin:$PATH" + +# Install auspice via conda (e.g., from bioconda) +RUN conda install -c bioconda auspice -y && conda clean -a + +# Install Python dependencies +RUN pip install uv +RUN uv pip install --system fastmcp + +# Create app directory +WORKDIR /app + +# Copy your MCP server +COPY app/auspice_server.py /app/ + +# Create workspace and output directories +RUN mkdir -p /app/workspace /app/output + +# Make sure the server script is executable +RUN chmod +x /app/auspice_server.py + +# Expose port for MCP over HTTP (optional) +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0)" + +# Default command runs the MCP server via stdio +CMD ["python", "/app/auspice_server.py"] + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_server.py new file mode 100644 index 0000000000000000000000000000000000000000..76cb7ab07feea71e1588531cb8198ccaaa0dadd7 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_server.py @@ -0,0 +1,398 @@ +import subprocess +from pathlib import Path +from typing import Dict, List, Optional, Any + +# This is a placeholder for the MCP decorator. +# In a real MCP environment, this would be provided by the MCP framework. +def tool(): + def decorator(f): + return f + return decorator + +mcp = type("mcp", (), {"tool": tool})() + + +@mcp.tool() +def view( + dataset_dir: Optional[List[Path]] = None, + host: str = "localhost", + port: int = 4000, + verbose: bool = False, + allow_remote_access: bool = False, + handlers: Optional[Path] = None, + config: Optional[Path] = None, + extend: Optional[Path] = None, +) -> Dict[str, str]: + """ + Starts the Auspice server to view and explore phylogenomic data. + Note: This command starts a long-running server process and may not be suitable + for automated workflows that expect a command to terminate. + + Args: + dataset_dir: Directory of datasets to serve. Can be specified multiple times. + host: Host IP address to listen on. + port: Port to listen on. + verbose: Print more information to the console. + allow_remote_access: Allow remote connections to the server. + handlers: Path to a Javascript file with custom API handlers. + config: Path to a custom config JSON file. + extend: Path to a directory containing custom client code. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["auspice", "view"] + + if dataset_dir: + for d in dataset_dir: + if not d.is_dir(): + raise ValueError(f"Dataset directory not found: {d}") + cmd.extend(["--datasetDir", str(d)]) + + cmd.extend(["--host", host]) + cmd.extend(["--port", str(port)]) + + if verbose: + cmd.append("--verbose") + if allow_remote_access: + cmd.append("--allow-remote-access") + + if handlers: + if not handlers.is_file(): + raise FileNotFoundError(f"Handlers file not found: {handlers}") + cmd.extend(["--handlers", str(handlers)]) + + if config: + if not config.is_file(): + raise FileNotFoundError(f"Config file not found: {config}") + cmd.extend(["--config", str(config)]) + + if extend: + if not extend.is_dir(): + raise ValueError(f"Extend directory not found: {extend}") + cmd.extend(["--extend", str(extend)]) + + try: + # This will block until the server is manually stopped. + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + } + + +@mcp.tool() +def build( + verbose: bool = False, + extend: Optional[Path] = None, + deploy_path: Optional[str] = None, +) -> Dict[str, Any]: + """ + Creates a production bundle of the Auspice client-side app. + The output is typically created in a './dist' directory. + + Args: + verbose: Print more information to the console. + extend: Path to a directory containing custom client code. + deploy_path: Path to deploy the app to (e.g., for GitHub pages). + + Returns: + A dictionary containing the command executed, stdout, stderr, and output files. + """ + cmd = ["auspice", "build"] + + if verbose: + cmd.append("--verbose") + + if extend: + if not extend.is_dir(): + raise ValueError(f"Extend directory not found: {extend}") + cmd.extend(["--extend", str(extend)]) + + if deploy_path: + cmd.extend(["--deploy-path", deploy_path]) + + try: + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + output_dir = Path("./dist") + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": { + "build_directory": str(output_dir) if output_dir.exists() else "Not created" + } + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + "output_files": {} + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": {} + } + + +@mcp.tool() +def export_v1( + dataset_dir: Path, + output_dir: Path, + verbose: bool = False, +) -> Dict[str, Any]: + """ + Exports auspice v1 JSONs to create a static site. + This is a deprecated command and will be removed in a future version. + + Args: + dataset_dir: Directory of datasets to export. + output_dir: Directory to export the auspice client and datasets to. + verbose: Print more information to the console. + + Returns: + A dictionary containing the command executed, stdout, stderr, and output directory. + """ + cmd = ["auspice", "export", "v1"] + + if not dataset_dir.is_dir(): + raise ValueError(f"Dataset directory not found: {dataset_dir}") + cmd.extend(["--dataset-dir", str(dataset_dir)]) + + output_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--output-dir", str(output_dir)]) + + if verbose: + cmd.append("--verbose") + + try: + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": { + "export_directory": str(output_dir) + } + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + "output_files": {} + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": {} + } + + +@mcp.tool() +def export_v2( + dataset_dir: Path, + output_dir: Path, + verbose: bool = False, + config: Optional[Path] = None, + extend: Optional[Path] = None, + deploy_path: Optional[str] = None, +) -> Dict[str, Any]: + """ + Exports auspice v2 JSONs to create a static site. + + Args: + dataset_dir: Directory of datasets to export. + output_dir: Directory to export the auspice client and datasets to. + verbose: Print more information to the console. + config: Path to a custom config JSON file. + extend: Path to a directory containing custom client code. + deploy_path: Path to deploy the app to (e.g., for GitHub pages). + + Returns: + A dictionary containing the command executed, stdout, stderr, and output directory. + """ + cmd = ["auspice", "export", "v2"] + + if not dataset_dir.is_dir(): + raise ValueError(f"Dataset directory not found: {dataset_dir}") + cmd.extend(["--dataset-dir", str(dataset_dir)]) + + output_dir.mkdir(parents=True, exist_ok=True) + cmd.extend(["--output-dir", str(output_dir)]) + + if verbose: + cmd.append("--verbose") + + if config: + if not config.is_file(): + raise FileNotFoundError(f"Config file not found: {config}") + cmd.extend(["--config", str(config)]) + + if extend: + if not extend.is_dir(): + raise ValueError(f"Extend directory not found: {extend}") + cmd.extend(["--extend", str(extend)]) + + if deploy_path: + cmd.extend(["--deploy-path", deploy_path]) + + try: + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "output_files": { + "export_directory": str(output_dir) + } + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + "output_files": {} + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "output_files": {} + } + + +@mcp.tool() +def develop( + verbose: bool = False, + extend: Optional[Path] = None, + config: Optional[Path] = None, + dataset_dir: Optional[List[Path]] = None, + port: int = 4000, + host: str = "localhost", +) -> Dict[str, str]: + """ + Starts the Auspice development server with hot-reloading. + Note: This command starts a long-running server process and may not be suitable + for automated workflows that expect a command to terminate. + + Args: + verbose: Print more information to the console. + extend: Path to a directory containing custom client code. + config: Path to a custom config JSON file. + dataset_dir: Directory of datasets to serve. Can be specified multiple times. + port: Port to listen on. + host: Host IP address to listen on. + + Returns: + A dictionary containing the command executed, stdout, and stderr. + """ + cmd = ["auspice", "develop"] + + if verbose: + cmd.append("--verbose") + + if extend: + if not extend.is_dir(): + raise ValueError(f"Extend directory not found: {extend}") + cmd.extend(["--extend", str(extend)]) + + if config: + if not config.is_file(): + raise FileNotFoundError(f"Config file not found: {config}") + cmd.extend(["--config", str(config)]) + + if dataset_dir: + for d in dataset_dir: + if not d.is_dir(): + raise ValueError(f"Dataset directory not found: {d}") + cmd.extend(["--datasetDir", str(d)]) + + cmd.extend(["--port", str(port)]) + cmd.extend(["--host", host]) + + try: + # This will block until the server is manually stopped. + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + } + + +@mcp.tool() +def version() -> Dict[str, str]: + """ + Prints the version number of auspice and exits. + + Returns: + A dictionary containing the command executed, stdout, stderr, and parsed version. + """ + cmd = ["auspice", "version"] + try: + result = subprocess.run( + cmd, capture_output=True, text=True, check=True + ) + return { + "command_executed": " ".join(cmd), + "stdout": result.stdout, + "stderr": result.stderr, + "version": result.stdout.strip(), + } + except FileNotFoundError: + return { + "command_executed": " ".join(cmd), + "stdout": "", + "stderr": "Error: 'auspice' command not found. Please ensure it is installed and in your PATH.", + "version": "", + } + except subprocess.CalledProcessError as e: + return { + "command_executed": " ".join(cmd), + "stdout": e.stdout, + "stderr": e.stderr, + "version": "", + } \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_shim_server.py b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_shim_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b809ae5fdf2881a1fde324cd692d2a9caff62a43 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_shim_server.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import ast +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + + +SOURCE_SERVER = Path('/225040511/project/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/auspice_server.py') +SERVER_NAME = 'biosci_auspice' + + +class _ShimMCP: + @staticmethod + def tool(): + def _decorator(fn): + return fn + return _decorator + + +def _load_functions(): + code = SOURCE_SERVER.read_text(encoding="utf-8") + tree = ast.parse(code, filename=str(SOURCE_SERVER)) + function_names = [n.name for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")] + namespace = { + "__name__": "__mcp_source__", + "mcp": _ShimMCP(), + } + exec(compile(code, str(SOURCE_SERVER), "exec"), namespace, namespace) + loaded = [] + for name in function_names: + fn = namespace.get(name) + if callable(fn): + loaded.append(fn) + return loaded + + +mcp = FastMCP(SERVER_NAME) +for _fn in _load_functions(): + mcp.tool()(_fn) + + +if __name__ == "__main__": + mcp.run(transport="stdio") diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/app/requirements.txt @@ -0,0 +1 @@ + diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/docker-compose.yml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..9a3df520dc961f08ec57d610d823931b1d415765 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + mcp-auspice: + build: . + image: mcp-auspice:latest + container_name: mcp-auspice + ports: + - "8000:8000" + environment: + - MCP_SERVER_NAME=auspice + volumes: + - ./workspace:/app/workspace + - ./output:/app/output + restart: unless-stopped + healthcheck: + test: ["CMD", "python", "-c", "import sys; sys.exit(0)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/environment.yaml b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..492ce6777fe7c7088cc1c347fa0b1d14cf597302 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/environment.yaml @@ -0,0 +1,10 @@ + +name: mcp-tool +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - auspice + - python=3.10 + \ No newline at end of file diff --git a/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/requirements.txt b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc4702c254694b94825ae9800a56d8f68b1bcda0 --- /dev/null +++ b/BioScientist/agent_system/toolbase/mcp_batch_from_manual_txt/mcp_auspice/requirements.txt @@ -0,0 +1,2 @@ +fastmcp +mcp