Skip to main content

pipen-mcp

A pipen CLI plugin that exposes pipen processes and pipelines as MCP (Model Context Protocol) tools, allowing AI assistants to discover and run bioinformatics pipelines.

Overview

pipen-mcp bridges pipen's process/pipeline ecosystem with AI assistants that support the Model Context Protocol. Once installed, any namespace registered via the pipen_cli_run entry point group is automatically discoverable and executable by an MCP-compatible client (e.g., Claude, VS Code Copilot, Cursor).

Installation

pip install pipen-mcp

pipen-mcp requires Python ≥ 3.10 and depends on:

Usage

pipen-mcp adds an mcp subcommand to the pipen CLI:

pipen mcp [--transport {stdio,sse,streamable-http}] [--host HOST] [--port PORT]
Option Description Default
--transport MCP transport (stdio, sse, or streamable-http) stdio
--host Host to bind to (SSE / streamable-http only) 127.0.0.1
--port Port to listen on (SSE / streamable-http only) 8520

stdio (default)

Suitable for direct integration with MCP clients that launch the server as a subprocess:

pipen mcp

SSE

Starts an HTTP server with Server-Sent Events transport:

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

Streamable HTTP

Starts an HTTP server with the streamable-HTTP transport:

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

MCP Tools

The server exposes four tools that support a progressive-disclosure workflow:

Tool Description
get_namespaces List all available namespaces. Start here to discover what is installed.
get_processes List all processes/pipelines available in a namespace.
get_process Get the full argument schema for a specific process/pipeline.
run_process Execute a process/pipeline with a list of CLI arguments.

Typical workflow

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 Integration

Add the server to your MCP configuration (~/.vscode/mcp.json or ~/.vscode-server/data/User/mcp.json):

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

Or for SSE:

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

Authoring a Namespace

Any package can register processes/pipelines with pipen-mcp by declaring a pipen_cli_run entry point:

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

The referenced module should contain Proc subclasses (with an input attribute) or ProcGroup subclasses. Use pipen-annotate to document arguments — annotated fields are exposed in get_process output and used to build the tool schema.

# 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 = "..."

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipen_mcp-0.1.0.tar.gz (140.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipen_mcp-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pipen_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: pipen_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 140.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pipen_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b99df1ccbd5bb7a2a83ffdbfe213f0506e54d051a6443de83f38286696fac98
MD5 7a0930730fb3de98e4a1a34fbce16513
BLAKE2b-256 5b12f4b84289e052f9e253afc08c41b0abc479bc1e51b050f1ab0318f1cf3a7b

See more details on using hashes here.

File details

Details for the file pipen_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipen_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pipen_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cda69b3767179f60d68798b996bac0e9b9257dd029eb791110fac694e1e8fe19
MD5 41b0704cc627bd022f7e6c475a71b87d
BLAKE2b-256 0dd042cda235cb6785fd959ba0c1d60640553135f5880ff6275283ed26571588

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page