Skip to main content
Glama

pipen-mcp

一个 pipen CLI 插件,它将 pipen 进程和流程公开为 MCP (Model Context Protocol) 工具,允许 AI 助手发现并运行生物信息学流程。

概述

pipen-mcp 将 pipen 的进程/流程生态系统与支持模型上下文协议 (MCP) 的 AI 助手连接起来。安装后,任何通过 pipen_cli_run 入口点组注册的命名空间都可以被兼容 MCP 的客户端(例如 Claude、VS Code Copilot、Cursor)自动发现并执行。

Related MCP server: @llmgraph/mcp-server

安装

pip install pipen-mcp

pipen-mcp 需要 Python ≥ 3.10,并依赖于:

使用方法

pipen-mcp 为 pipen CLI 添加了一个 mcp 子命令:

pipen mcp [--transport {stdio,sse,streamable-http}] [--host HOST] [--port PORT]

选项

描述

默认值

--transport

MCP 传输方式 (stdio, sse, 或 streamable-http)

stdio

--host

绑定的主机地址(仅限 SSE / streamable-http)

127.0.0.1

--port

监听的端口(仅限 SSE / streamable-http)

8520

stdio (默认)

适用于与将服务器作为子进程启动的 MCP 客户端直接集成:

pipen mcp

SSE

启动一个带有服务器发送事件 (Server-Sent Events) 传输的 HTTP 服务器:

pipen mcp --transport sse --host 0.0.0.0 --port 8520

Streamable HTTP

启动一个带有流式 HTTP (streamable-HTTP) 传输的 HTTP 服务器:

pipen mcp --transport streamable-http --host 0.0.0.0 --port 8520

MCP 工具

该服务器公开了四个支持渐进式披露工作流的工具:

工具

描述

get_namespaces

列出所有可用的命名空间。从这里开始发现已安装的内容。

get_processes

列出命名空间中所有可用的进程/流程。

get_process

获取特定进程/流程的完整参数模式。

run_process

使用 CLI 参数列表执行进程/流程。

典型工作流

1. get_namespaces()
   → "delim", "bam", "rnaseq", ...

2. get_processes("delim")
   → RowsBinder (proc): Bind rows of input files
   → ColsBinder (proc): Bind columns of input files

3. get_process("delim", "RowsBinder")
   → Required:
       --in.infiles <list[str]>  Input files
   → Optional:
       --envs.sep <str> (default: '\t')  Separator
       --outdir <str>  Output directory
       ...

4. run_process("delim", "RowsBinder", [
       "--in.infiles", "/tmp/a.csv,/tmp/b.csv",
       "--envs.sep", ",",
       "--outdir", "/tmp/out"
   ])
   → Pipeline output / logs

VS Code / Copilot 集成

将服务器添加到您的 MCP 配置中(~/.vscode/mcp.json 或 ~/.vscode-server/data/User/mcp.json):

{
  "servers": {
    "pipen-mcp": {
      "type": "stdio",
      "command": "pipen",
      "args": ["mcp"]
    }
  }
}

或者对于 SSE:

{
  "servers": {
    "pipen-mcp": {
      "type": "sse",
      "url": "http://127.0.0.1:8520/sse"
    }
  }
}

编写命名空间

任何包都可以通过声明 pipen_cli_run 入口点来向 pipen-mcp 注册进程/流程:

# pyproject.toml
[project.entry-points."pipen_cli_run"]
myns = "mypackage.ns.myns"

引用的模块应包含 Proc 子类(带有 input 属性)或 ProcGroup 子类。使用 pipen-annotate 来记录参数 — 注释后的字段会在 get_process 输出中公开,并用于构建工具模式。

# mypackage/ns/myns.py
"""My namespace — tools for processing text files."""
from pipen import Proc
from pipen_annotate import annotate

@annotate
class MyProc(Proc):
    """Concatenate rows from multiple files.

    Input:
        infiles (list): Input files to concatenate

    Envs:
        sep (str): Column separator. Default: ","
    """
    input = "infiles:files"
    output = "outfile:file:{{in.infiles[0] | stem}}_concat.tsv"
    script = "..."

许可证

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      C
      quality
      B
      maintenance
      Exposes the NGS360 bioinformatics platform REST API as MCP tools, enabling AI assistants to manage sequencing runs, projects, workflows, and more through natural language.
      82
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Exposes SciNote ELN bench workflows as MCP tools so an AI assistant can drive them by voice or chat, including ticking checklist items, completing steps, consuming inventory stock, and adding result notes through the SciNote REST API with the user's own credentials.
      -