Metadata-Version: 2.5
Name: salpa-mcp
Version: 0.3.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,
read what each step made, and show you any of it in Salpa's window when you ask, 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, proposals (below) Salpa 0.28.0 or
later, and showing you something in Salpa (`open_in_salpa`) Salpa 0.30.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 |
| `open_in_salpa` | Show you a project, a workflow, one step of a workflow, or a run in Salpa's window, in a tab of its own; only when you ask to see something. Says what Salpa's window did |

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

## Showing you something

When you ask your agent to show you something in Salpa, it calls `open_in_salpa`, and Salpa's window
brings it forward in a tab of its own, leaving your other tabs as they are, with a note naming your
agent; it does so even when Salpa's window is out of view (covered, minimized, or closed on a Mac,
which only hides it). While a dialog is open in Salpa, nothing moves: Salpa offers to show it instead,
and you press Show. It offers too when it has just shown you something else, or when another action
is busy with what it would show. The tool's description tells your agent to use it only when you ask,
since it moves your window.

Salpa waits up to three seconds for its window, and the tool says what Salpa's window did: it showed
it (or put it in front in Salpa while Salpa's window is out of view, so you may need to bring Salpa
forward), it offered it, or it could not show it (and why). If the window has not answered in that
time, the tool says Salpa was asked and the window has not answered yet. When Salpa's window is not
open, the tool says so, and Salpa keeps the request for a minute in case you open it. Salpa takes one
such request every two seconds, from any agent, and keeps at most ten waiting for its window. A newer
request from your agent takes the place of an earlier one the window has not been given yet (so does
the newest of ten waiting), never of one it has: the newer request's answer says so, and so does the
earlier one's, if your agent is still waiting for it.

## 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

- **Press your own buttons.** Since Salpa 0.30.0, Salpa keeps them for its own window, which holds a
  key nothing else does, among them: deciding on a proposal or on Salpa's assistant's work; the
  canvas's own changes (saving a workflow from its canvas, adding, removing or connecting its steps);
  installing or uninstalling packages and environments; changing Salpa's settings, the workers'
  settings, a project's settings or objectives, or your cluster profiles; starting, stopping or
  scaling Salpa's workers; publishing a workflow as a template or withdrawing one; deleting a workflow
  or a project; and clearing what Salpa keeps of your work (results, run history and records, jobs,
  conversations and what the Copilot learned, logs and data).
  Salpa refuses them to your agent when Salpa's window started its server, which is how the app starts
  when you open it; a server started some other way (a developer's, by hand) does not check. Salpa's
  Settings, under Connect an agent, says whether the check is on. salpa-mcp calls none of them; if your
  agent meets such a refusal, the tool says "Only the person can do that, in Salpa's window", naming
  the action, and tells it to ask you.
- **Change a workflow you have open in Salpa without you.** It proposes the change, and you apply
  or decline it in Salpa. Applying or declining is one of your buttons: Salpa refuses it from here.
- **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.
