LINKing All Resources CLI + API + MCP

Reusable analysis templates for humans and machines

Turn scripts, tools, and notebooks into reusable work.

Package each analysis step as a template with explicit inputs and outputs. Connect steps through bindings. Run everything from a short CLI, a local JSON API, or an MCP agent.

Install pipx install git+https://github.com/chaochungkuo/linkar.git
$ linkar config author set --name "Your Name"
$ linkar project init --name study
$ cd study
$ linkar pack add ../examples/packs/basic --id basic
$ linkar run simple_echo --name Linkar
$ linkar inspect run simple_echo_001

study/
  simple_echo/            ← stable project alias
  .linkar/runs/
    simple_echo_001/
      meta.json           ← provenance
      results/greeting.txt

How It Works

Three building blocks.

Every Linkar project is built from templates, bindings, and a project directory. Each piece has a single job — together they make analysis work reusable and inspectable.

Templates

Standalone units with explicit params, declared outputs, and a reproducible run command. Each template is testable on its own.

id: fastq_stats
params:
  input:
    type: path
    required: true
outputs:
  report:
    path: stats.txt
run:
  command: fastqc "${param:input}"

Bindings

Encode how outputs from one template become inputs to the next. Write the resolution logic once; reuse it every run.

# step_a produced output_file
# binding auto-resolves it
$ linkar run step_b
# no manual path wiring needed

Projects

A local directory with stable run aliases, immutable history under .linkar/runs/, and inspectable metadata for every execution.

$ linkar inspect run fastqc_001
instance:  fastqc_001
status:    completed
outputs:
  report: ./fastqc/stats.txt

Interfaces

One runtime, three entry points.

Humans use the CLI. Scripts and agents use the local JSON API or MCP server. All three paths write the same run artifact on disk.

Human

Short CLI

Template params become flags. The active project is discovered automatically. Common paths stay short.

linkar config author set --name "Your Name"
linkar project init --name study
cd study
linkar pack add ../examples/packs/chaining --id chaining
linkar run produce_message --message "hello"
linkar run consume_message
linkar inspect run consume_message_001
Machine

Local API & MCP

Resolve params, execute templates, and read outputs without shell scraping. Agents can use the MCP server directly.

linkar serve --port 8000 --api-token local-dev:read,resolve,execute

# resolve params → get a short-lived token
POST /v1/templates/{template_id}:resolve

# run with the token
POST /v1/templates/{template_id}:run

# read outputs by run reference
GET  /v1/runs/{run_ref}/outputs

# or use the MCP server for agents
linkar mcp serve

Documentation

Concepts, tutorials, then examples.

Read the concepts first to understand the model. Use the tutorials to do real work step by step. Browse the bundled examples when you want the smallest runnable pack for a specific pattern.