joule-mcp
An MCP server that lets an AI agent inspect a Joule installation. It calls the Guardian REST API
(/joule/management/*). It is independent of joulectl and Guardian.
By default the server is read-only. The change tools exist only when you set JOULE_MCP_ALLOW_WRITE=1.
Tools
| Tool | Guardian route | Same as |
|---|---|---|
list_pods |
pods/list |
joulectl ls pods |
list_pod_members |
pods/connected |
joulectl ls members POD |
list_usecases |
usecase/list |
joulectl ls usecases |
list_transports |
transports/list |
joulectl ls transports |
list_streams |
stream/list |
joulectl ls streams |
usecase_status |
usecase/status |
joulectl status usecase NAME |
usecase_events(name, pod, limit) |
usecase/status |
joulectl status usecase NAME --events |
whoami |
apikeys/whoami |
the Joule UI's "who am I" |
describe_usecase |
usecase/list, usecase/detail, usecase/status |
joulectl inspect usecase NAME and status |
Every tool carries the readOnlyHint annotation.
usecase_events returns the latest events a use case emitted, parsed from JSON, for each running process (limit 1 to
100, default 10, newest last). Guardian keeps only a short sample in memory (last_emitted_events), so it is for
inspection, not a stream, and it is empty while a use case is paused or idle. The result gives emitted_events for
each process, so two calls show whether events are flowing.
Change tools
Off unless JOULE_MCP_ALLOW_WRITE=1 is set. Guardian needs the usecases:write scope on the key.
pod is always required, so no change reaches every pod by accident.
| Tool | Guardian route | Same as |
|---|---|---|
deploy_usecase(pod, specification) |
POST usecase/deploy |
joulectl deploy usecase |
pause_usecase(name, pod) |
PUT usecase/pause |
joulectl process pause |
resume_usecase(name, pod) |
PUT usecase/resume |
joulectl process resume |
undeploy_usecase(name, pod, confirm) |
DELETE usecase/undeploy |
joulectl undeploy usecase |
specificationis an object, or JSON or YAML text. It is parsed with a safe loader and sent as JSON. The root key isuse case, and a use case needs at least one source and one sink. For example:{"use case": {"name": "x", "stream name": "s", "sources": ["a"], "sinks": ["b"]}}.- Guardian answers HTTP 200 with an empty body for a deploy the daemons rejected (the reason is only in the Guardian
log), for a duplicate deploy, and for pause, resume or undeploy of an unknown name. The server raises for a failure
in the envelope, maps service codes (for example 653 to
UNKNOWN_POD), and never treats an empty reply as proof of success. - Before a change the server reads
usecase/list. Deploy of a name already on the pod, and pause, resume or undeploy of a name that is not on it, fail at once and send nothing. - After a deploy the result has
verified: trueorfalseand the listedstate. If the use case is not listed, the note says the deployment most likely failed and points at the DSL schema and the daemon logs. - Pause and resume return
state_beforeandstate_afterfromusecase/list(RUNNING,SUSPENDED), and the live status rows. undeploy_usecaseremoves the use case and cannot be undone.confirmmust equalnameexactly. If it does not, the error tells the agent to ask the user, and no request is sent. After the call the server checksusecase/listand returnsremoved: trueorfalse.- A change is never retried.
- Every change tool is annotated as not read-only.
undeploy_usecaseis annotated destructive; the others are not.pause_usecaseandresume_usecaseare idempotent.
Resources
An agent should read these before it writes a use case specification.
| Resource | Guardian route | Content |
|---|---|---|
joule://dsl/schema |
dsl/schema |
JSON Schema (2020-12) for the Joule DSL, as application/schema+json |
joule://dsl/catalogue |
dsl/catalogue |
Every component with its key, properties and example, plus analytic and aggregate functions |
joule://dsl/component/{key} |
dsl/catalogue |
One component by its DSL key (not case sensitive). Much smaller than the full catalogue |
The key needs the dsl:read scope. Guardian caches both routes for 5 minutes.
Install
Needs Python 3.10 or newer. After the first release on PyPI:
pipx install joule-mcp # or: pip install joule-mcp
joule-mcp --help # starts the stdio server; an MCP client launches it for you
Without installing anything, with uv:
claude mcp add joule -- uvx joule-mcp
From a source checkout:
python3 -m venv .venv
.venv/bin/pip install -e ".[test]" # or: poetry install
.venv/bin/joule-mcp
Upgrade with pipx upgrade joule-mcp or pip install --upgrade joule-mcp.
API keys
The server follows the same rules as the Joule UI. Guardian refuses any request without a valid X-API-Key, so the server
needs a key unless Guardian runs with authentication off.
| Situation | What the server does |
|---|---|
| Key is malformed (not 8 to 200 printable characters, no spaces) | Stops at start-up with a message. The key is not repeated. |
| Guardian wants a key and none is set | Every tool and resource answers "Guardian requires an API key" with how to set one. Nothing else is sent. |
Guardian rejects the key (AUTH_INVALID, AUTH_EXPIRED, AUTH_REVOKED) |
Every call says so and tells you to get a new key and restart. |
| Key is valid but lacks a scope | The call is refused before it is sent, and the message names the scope and the key's owner. |
Guardian uses no keys (its apikeys/whoami does not exist) |
Calls go through. |
| Guardian cannot be reached | The call itself reports that. |
Each tool states the scope it needs, the same as its Guardian route: pods:read, usecases:read, transports:read,
streams:read, usecases:write (deploy, pause, resume, undeploy) and dsl:read (the resources). A higher level
covers a lower one, so usecases:write includes usecases:read. Guardian stays the authority. The server's check only
saves a request that Guardian would refuse, and it never grants anything.
Use the whoami tool first when a call is refused. It says whether Guardian wants a key, whether this key is accepted,
who owns it, its scopes and when it ends. It never returns the key.
Get a key from the Joule UI (API keys) or joulectl. A viewer key is enough for the read tools, and an operator key adds
the change tools. Put the key in a file, set JOULE_API_KEY_FILE to its path, and keep the file private (chmod 600).
The server reads the key when it starts, so restart it after you change the key.
Settings
| Setting | Source, highest first |
|---|---|
| Guardian host | JOULE_HOST, joule_host in ~/.config/joule/config.json, 127.0.0.1:9080 |
| API key | JOULE_API_KEY_FILE, JOULE_API_KEY, the key joulectl stored for that host |
| Change tools | JOULE_MCP_ALLOW_WRITE=1 (default off) |
| Timeout | JOULE_TIMEOUT, default 30 seconds |
| Private CA | JOULE_CA_BUNDLE |
The key is sent as X-API-Key. It is never a tool argument, and it is not logged. Redirects are
refused so the key cannot be forwarded. A key with only *:read scopes keeps the agent read-only
at Guardian too.
Use with Claude Code
claude mcp add joule -- joule-mcp
claude mcp add joule -e JOULE_MCP_ALLOW_WRITE=1 -- joule-mcp # with change tools
Checked against a real Guardian
Run on 2026-12-02 against Joule 1.3 on minikube, through kubectl port-forward, with the key from joulectl's config:
all read tools and resources; pause and resume of a running use case (RUNNING to SUSPENDED and back, on both
daemons); deploy, refused duplicate and undeploy of a throwaway use case; and the refusal paths.
Release
Same process as joulectl (.gitlab-ci.yml here follows fractalworks-joule-cli/.gitlab-ci.yml).
- Set
versioninpyproject.tomland add the entry toCHANGELOG.md. - Check:
poetry install && poetry run pytest --cov --cov-fail-under=95, thenpoetry build && twine check dist/*. - Tag with
release/release.sh <version> joule-mcp, then push the tag yourself. The tag must bevX.Y.Zand equalversion, or the pipeline stops. - The pipeline runs tests on Python 3.10 and 3.13, the security gates (pip-audit, bandit, secret detection), builds, signs with Sigstore, then waits. Publish to TestPyPI first, then PyPI, each with a manual click.
Releasing from your own machine
scripts/release_local.py does the same checks and the same build as the pipeline, then uploads if you ask. Use one route
for each version: an index accepts a version once.
git tag -a v0.1.0 -m "Release v0.1.0" # on a clean tree; the script never tags or pushes
python scripts/release_local.py # dry run: tests, build, twine check. Uploads nothing.
python scripts/release_local.py --upload testpypi # then try it: pip install -i https://test.pypi.org/simple/ joule-mcp
python scripts/release_local.py --upload pypi # needs the version on TestPyPI first; you type the tag to confirm
Trusted Publishing works only from CI, so a local upload uses an API token. Put it in TESTPYPI_TOKEN or PYPI_TOKEN
(never on the command line), or leave it unset and twine reads ~/.pypirc, your keyring, or asks. The first upload of a new
project needs a token for the whole account; replace it with one scoped to joule-mcp afterwards. A local upload has no
Sigstore signature and no SBOM: those come from the pipeline.
One-time setup, by the maintainers: create the GitLab project and add it to repos.txt; register a Trusted Publisher
(or a pending publisher for the first upload) for joule-mcp on pypi.org and test.pypi.org; protect v* tags and the
pypi environment. Details are at the top of .gitlab-ci.yml.
Test
.venv/bin/python -m pytest
Next
- Streamable HTTP transport.
Known risk: shared streams
On the Joule 1.3 test install (2026-12-02), deploying a second use case on the same stream as a running one worked.
Undeploying it then shut down the shared stream processors (cleanMarketData and the select step). The first use
case stayed RUNNING and kept receiving events, but processed and emitted none, and Guardian reported no error.
undeploy_usecase now refuses when another use case on the pod uses the same stream, and deploy_usecase returns a
warning in that case. Treat this as a Joule platform issue to confirm, not as a rule.
Metadata
Release files for joule-mcp 0.1.1
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 |
|---|---|---|---|---|
| joule_mcp-0.1.1.tar.gz | 22.7 kB | Without provenance | Details for joule_mcp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| joule_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for joule_mcp-0.1.1-py3-none-any.whl |
Total release size: 44.6 kB
Release files / joule_mcp-0.1.1.tar.gz
| Download URL | joule_mcp-0.1.1.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0ddbed9624cb37434421de8ead05b6403eea5f7215d74c730804ac1233209f7
|
|
BLAKE2b-256 checksum How to use checksums |
ed3d182ac4e88cb8892c39625875b9ef4585db06191d0a458e9b097b8ad86dcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.10
|
Release files / joule_mcp-0.1.1-py3-none-any.whl
| Download URL | joule_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
627ac4b4c053fddc7026bc77738f0dea5f0721993a93c8c4e686a3387739f2e4
|
|
BLAKE2b-256 checksum How to use checksums |
ed491d0b83a8532072393f480375893e5e10608fbe7e54a161b582d5c52cb6dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.10
|
Security for joule-mcp 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.