Skip to main content
Glama

pipen-mcp

pipenのCLIプラグインであり、pipenのプロセスやパイプラインをMCP (Model Context Protocol)ツールとして公開することで、AIアシスタントがバイオインフォマティクスパイプラインを発見・実行できるようにします。

概要

pipen-mcpは、pipenのプロセス/パイプラインエコシステムと、Model Context ProtocolをサポートするAIアシスタントを橋渡しします。インストールすると、pipen_cli_runエントリーポイントグループを介して登録された名前空間は、MCP互換クライアント(Claude、VS Code Copilot、Cursorなど)によって自動的に検出および実行可能になります。

Related MCP server: NGS360 MCP Server

インストール

pip install pipen-mcp

pipen-mcpはPython 3.10以上を必要とし、以下に依存しています:

使用方法

pipen-mcppipen 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

streamable-HTTPトランスポートを使用してHTTPサーバーを起動します:

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

MCPツール

サーバーは、段階的な開示ワークフローをサポートする4つのツールを公開します:

ツール

説明

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

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Exposes a local biomedical literature pipeline as MCP tools for automated research workflows. Enables literature search, open-access paper retrieval, and draft generation for biomedical and pathology domains through standard MCP clients.
    6
    -
  • 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
    -