Metadata-Version: 2.5
Name: salpa-mcp
Version: 0.2.0
Summary: Let your own AI agent drive your Salpa: list templates, prepare workflows, run them and read their results, over the Model Context Protocol.
Project-URL: Homepage, https://salpa.app
Author: Salpa
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agent,computational-science,mcp,model-context-protocol,salpa,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: mcp<3,>=2.3
Requires-Dist: salpa-cli>=0.18.0
Description-Content-Type: text/markdown

# salpa-mcp

Let your own AI agent drive your own [Salpa](https://salpa.app), over the
[Model Context Protocol](https://modelcontextprotocol.io).

Salpa runs scientific workflows (molecular simulation, docking and similar) on your computer, one
step per node on a canvas. With salpa-mcp, an agent you already use can list Salpa's workflow
templates, prepare a workflow from one in one of your projects, change its steps' settings, run it,
and read what each step made, through the same local API the app's own window uses.

## Setting it up

In Claude Code:

```
claude mcp add salpa -- uvx salpa-mcp
```

In Claude Desktop, and other clients that read an `mcpServers` table:

```json
{
  "mcpServers": {
    "salpa": { "command": "uvx", "args": ["salpa-mcp"] }
  }
}
```

A client started from the Dock, or from the Start menu, may not see your shell's `PATH`, and then
cannot find `uvx`: write its full path as the `command` (`which uvx` prints it on a Mac and on Linux,
`where uvx` on Windows). Salpa's Settings, under Connect an agent, shows both: Claude Code's line, and
the `mcpServers` JSON with `uvx`'s full path filled in when Salpa finds it.

### Updating

`uvx` keeps the version of salpa-mcp it first fetched. If you set it up before, fetch the newest once,
then restart your agent:

```
uvx salpa-mcp@latest --version
```

It prints the version and exits; it starts no server.

There is nothing to paste from Salpa: salpa-mcp finds the Salpa running on this computer, as you, on
port 18000 unless `SALPA_PORT` or `SALPA_APP_URL` says otherwise, with the app's per-launch local API
token. Start Salpa before you ask your agent to use it; when Salpa is not running, every tool says so.

It needs Python 3.10 or later, which `uvx` chooses for you, and Salpa 0.12.0 or later. Changing a
step's settings (`set_node_options`) needs Salpa 0.15.0 or later, and proposals (below) Salpa 0.28.0
or later.

## The tools

| Tool | What it does |
|---|---|
| `list_templates` | The workflow templates Salpa offers, and whether each one's packages are installed |
| `list_nodes` | The steps installed in Salpa, with their default settings; optionally filtered |
| `list_projects` | Your projects, with the question each was made for, its folder and its workflows |
| `load_template` | Prepare a new workflow from a template, in a folder you name, and in a project if you say which |
| `read_workflow` | A workflow's steps, their settings, the links between them, its folder, whether it is open in Salpa |
| `set_node_options` | Change settings of one step: at once in a workflow that is not open in Salpa, else as a proposal |
| `proposal_status` | What became of a proposal: still waiting, applied, declined, lapsed or replaced |
| `run` | Run a workflow, or one step of it; gives the run's id |
| `job_status` | Where a run stands |
| `history` | The latest runs of a workflow or of one step |
| `outputs` | The files a step's run made |
| `cancel` | Stop a run |

## When a workflow is open in Salpa

Salpa's canvas keeps its own copy of a workflow it has open, and its next save would put back a
change made under it. So your agent's change to an open workflow is not made: it is proposed to you.
Salpa shows it at the top of that workflow's canvas, and in Needs you, naming your agent and each
setting it would change, from and to. You apply it, which is one step you can undo and which Salpa
saves, or decline it. If the step's settings changed in the meantime, it lapses and nothing changes.

Your agent is told the change waits for you, and asks `proposal_status` for the outcome; it is told
never to send the same change again. A newer proposal from the same agent for the same step takes
the place of the one waiting. A change to a workflow no Salpa window has open is made at once, and
the step is marked with your agent's name until it runs or you accept it on the canvas.

A Salpa older than 0.28.0 refuses a change to an open workflow instead, and the tool tells your agent
to ask you to close the workflow's tab, or to make the change in Salpa.

## Which agent

Every call names salpa-mcp and your agent: the name your agent's host gives itself over the protocol
(its `clientInfo` name). Salpa shows it on the runs your agent starts, on
the changes it makes or proposes, and in Settings, under Connect an agent, with what it did recently.
It is a label your agent declares, not a lock: anything you run on this computer as you can reach
your Salpa.

## What your agent's model sees

What the tools answer goes to your agent's model, wherever that model runs: your templates and
projects, the workflows' steps and settings, the folders they work in, and the runs' statuses and
file names. Salpa's own assistant hides your folders from its model; salpa-mcp hands them over, since
your agent needs them to name a new workflow's folder.

## What it will not do

- **Change a workflow you have open in Salpa without you.** It proposes the change, and you apply
  or decline it in Salpa. It has no tool to apply or decline one itself.
- **Spend Salpa Compute.** A cloud step runs with your Salpa sign-in, which only the Salpa window
  sends with a run it starts. In a run your agent starts, a cloud step fails at once with "Sign in to
  Salpa to use it", even when you are signed in, and nothing is spent. Run a workflow with a cloud
  step from Salpa.
- **Reach anything but your own Salpa.** It talks only to the app on this computer, with the app's
  per-launch local API token, which only you can read and which it sends only to the app that
  issued it.

A run starts work on your computer. salpa-mcp tells your agent to ask you before it runs anything, and
most agents also ask before each tool call.

## Licence

Apache-2.0.
