valohai-mcp (research preview)
An MCP server for Valohai. It lets AI assistants (Claude Code, Claude Desktop, IDE agents) work with Valohai as the signed-in user. For example, you can ask "find my latest failed execution and explain what happened".
This is a research preview: tools, their output and the hosted server may change or break without notice.
Install in Claude Code
claude mcp add --transport http valohai https://mcp.valohai.com/mcp
Then run /mcp in Claude Code, choose valohai and sign in to Valohai. Ask "find my latest failed execution and explain what happened", or run /mcp__valohai__explain_latest_failure.
Signing in gives the server a Valohai access token. A read-only token (token:read scope) can't change data; a full one (token scope) can. The tools see only what you can see in Valohai.
Run it locally
Install uv and clone this repository. Create a Valohai API token at <your Valohai URL>/auth/tokens/; it can be read-only. Keep the token in a variable or a secret store rather than typing it on the command line, where it would end up in your shell history.
With a Bearer token from the client
Run the server against your Valohai installation:
VALOHAI_HOST=https://valohai.example.com uv run valohai-mcp
Connect Claude Code, sending your token with each request:
claude mcp add --transport http valohai http://localhost:8765/mcp --header "Authorization: Bearer $VALOHAI_TOKEN"
The server checks the token with Valohai and uses it to call the Valohai API. The client saves the token in its configuration.
With VALOHAI_HOST and VALOHAI_TOKEN
Run the server in token mode:
VALOHAI_HOST=https://valohai.example.com VALOHAI_TOKEN="$VALOHAI_TOKEN" uv run valohai-mcp
Connect Claude Code with no credentials:
claude mcp add --transport http valohai http://localhost:8765/mcp
The server uses the token for every Valohai API call. It doesn't check the token when it starts: if Valohai rejects it, tool calls fail with an error that says so. Check the token with curl -H "Authorization: Token $VALOHAI_TOKEN" https://valohai.example.com/api/v0/users/me/.
Anything that can reach the server's port acts as the token's user, except web pages in a browser, which the server refuses by their Host and Origin headers. Keep the server on localhost.
Configuration
| Variable | Default | Meaning |
|---|---|---|
VALOHAI_HOST |
https://app.valohai.com |
The Valohai installation. It must equal that installation's OIDC issuer. |
VALOHAI_TOKEN |
none (OAuth mode) | Token mode: every API call uses this token, and clients don't sign in |
VALOHAI_MCP_HOST |
localhost |
Address to listen on |
VALOHAI_MCP_PORT |
8765 |
Port to listen on |
VALOHAI_MCP_PUBLIC_URL |
http://{host}:{port} |
The URL that MCP clients use to reach this server |
Health check
GET /health answers 200 OK while the server is running. It needs no token and doesn't call Valohai, so it's a liveness check: it doesn't tell whether Valohai is reachable.
The server refuses requests whose Host isn't localhost or the host of VALOHAI_MCP_PUBLIC_URL, with 421. A probe that connects by IP address, such as a Kubernetes httpGet probe, must send that host in its Host header.
Tools and prompts
| Name | Kind | What it does |
|---|---|---|
get_context |
tool | Orientation: the user's projects, or for one project its newest commit and what it defines, environments, and unfinished and recent work |
list_executions |
tool | The most recent executions, by default only the user's own; can be filtered by status and step |
get_execution_failure_details |
tool | For one execution, given by ID, URL or counter (by default the user's latest failure): what ran, the status log, alerts and the end of the log |
compare_executions |
tool | Two executions side by side (by default the user's latest and the previous one of its step): what each is, what it ran and its price |
explain_latest_failure |
prompt | "Find my latest failed execution and explain what happened" |
How it works
Valohai is the OAuth authorization server. When an MCP client connects, it finds Valohai through this server's metadata, registers itself, and asks the user to sign in to Valohai and approve access. The Valohai access token it receives is sent with each MCP request, and this server uses it to call the Valohai API. In OAuth mode, this server stores no credentials; in token mode, it holds the token from its environment.
MCP client ──(MCP, Bearer token)──> valohai-mcp ──(Bearer token)──> Valohai API (/api/v0/)
└──(discovery, registration, sign-in, token)──> Valohai OAuth (/oidc/…)
Development
just setup # Python, dependencies and commit hooks
just serve # run the server (configured with VALOHAI_* environment variables)
just dev-client # check the OAuth flow by hand against a running server
just test # pytest
just test-all # pytest on all supported Python versions
just lint # prek: ruff, typos, whitespace
Put your own recipes in justfile.local; it is imported when it exists and ignored by git.
See AGENTS.md for the code layout and conventions.
Metadata
Release files for valohai-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| valohai_mcp-0.1.0.tar.gz | 86.4 kB | With provenance | Details for valohai_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| valohai_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for valohai_mcp-0.1.0-py3-none-any.whl |
Total release size: 105.5 kB
Release files / valohai_mcp-0.1.0.tar.gz
| Download URL | valohai_mcp-0.1.0.tar.gz |
|---|---|
| Size | 86.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32e8f4d3e3cec339c6945ca4392cac5990b1039b0752d4d1178d49d65aaa4dd4
|
|
BLAKE2b-256 checksum How to use checksums |
e0f926f7734268abba4bc6d0f97ed4d9e5f8b98ea24643d00b3151661f8b246a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / valohai_mcp-0.1.0-py3-none-any.whl
| Download URL | valohai_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33283efdabda0f058142c17ad76f791aa82bb66f657eac6da69115385ad9726d
|
|
BLAKE2b-256 checksum How to use checksums |
a41458ce312eaca9f0d41f7b7a76b1b87c4cf3249dd2b83d3285446891c6beec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for valohai-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for valohai_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.