vijil-mcp
MCP (Model Context Protocol) server for the Vijil AI trust platform. Lets Claude Code interact with Vijil Console APIs through typed tools — using the CLI under the hood.
How it works
Claude Code ←── stdio ──→ vijil-mcp (local process) ─── vijil-console CLI ──→ Vijil Console API
The MCP server is a local process on your machine — not a deployed server. Claude Code spawns it as a subprocess, discovers its tools automatically, and calls them during conversations. Each tool runs a vijil-console command and returns JSON output.
Prerequisites
- Python 3.10+
- A Vijil Console account with API access
- Claude Code (CLI, desktop app, or VS Code extension)
Install
pip install vijil-mcp
# or isolated:
pipx install --include-deps vijil-mcp
--include-deps is required for the pipx path — pipx only exposes a
package's own console scripts by default, so a plain pipx install vijil-mcp
leaves vijil-console (a dependency, not vijil-mcp itself) unreachable on
PATH. The tradeoff: it also exposes every other dependency's scripts.
This automatically installs vijil-console (the CLI) as a dependency.
Upgrading an environment that predates this rename
If this environment already has both vijil-console and vijil-sdk
installed from before this rename (they used to collide on the vijil
command and the vijil_cli package — see below), do not
pip install --upgrade them in place, in either order. Fully uninstall
both first, then reinstall:
pip uninstall vijil-console vijil-sdk
pip install --upgrade vijil-console vijil-sdk # or vijil-mcp, which pulls in vijil-console
Why: pre-rename, both packages wrote files to the same paths (the vijil
script, and — before a companion vijil-sdk fix — the vijil_cli package
directory), so each package's installed-files manifest (RECORD) still
lists paths it no longer actually owns. An in-place upgrade of either
package uninstalls its old version first, and that uninstall deletes
every path in the old RECORD — including ones the other package has
since taken over — regardless of which package currently owns them.
Verified directly: upgrading vijil-sdk first then vijil-console deletes
the freshly-upgraded SDK's vijil script; upgrading in the other order
instead deletes files out of the freshly-upgraded Console's package
directory. Only a full uninstall-then-reinstall leaves a clean, correct
result in both directions. A fresh environment that never had the
pre-rename collision is unaffected by any of this.
Connecting to the public platform (recommended)
For the hosted Vijil platform, the server needs no vijil-console auth init / vijil-console auth login. It defaults to the public gateway https://console-api.vijil.ai and authenticates from the environment. Use the API-key pair you mint at console.vijil.ai → Settings → API Keys — the preferred headless credential because it is revocable, scoped, and self-healing:
export VIJIL_CLIENT_ID=vk_... # the API key's client ID
export VIJIL_CLIENT_SECRET=... # the paired secret, shown once at creation
# optional, for a non-production environment:
# export VIJIL_CONSOLE_URL=https://console-api.dev05.vijil.ai
# optional, to pin a team for team-scoped tools:
# export VIJIL_TEAM_ID=<team_id>
The CLI exchanges the pair for a short-lived bearer token (POST /v1/auth/token) and re-exchanges automatically when it expires — so long-running headless sessions do not break. This is the same vk_ credential vijil-sdk reads, so one key authenticates both surfaces.
If you already hold a raw access token, VIJIL_API_KEY=<access-token> is an escape hatch — sent verbatim as Authorization: Bearer, with no exchange. It is not refreshable (a 401 means it expired), so prefer the pair for anything long-running.
| Variable | Default | Purpose |
|---|---|---|
VIJIL_CLIENT_ID + VIJIL_CLIENT_SECRET |
— | Revocable API-key pair, exchanged for a bearer (preferred). Highest precedence; re-exchanged on expiry. Same credential vijil-sdk reads. |
VIJIL_API_KEY |
— | Raw bearer access token, sent verbatim. Escape hatch; not refreshable. Used only when the pair is unset. |
VIJIL_CONSOLE_URL |
https://console-api.vijil.ai |
Platform/gateway URL override. |
VIJIL_TEAM_ID |
— | Team scope for team-scoped commands when not signed in interactively. |
VIJIL_CA_BUNDLE |
— | PEM file holding a private CA to trust in addition to the OS store and certifi. Needed for a self-hosted Console behind your own PKI; cannot be persisted to a config file, so it must be exported (and declared in the MCP env block). Reported by auth status as ca_bundle. |
Because auth is an env var rather than an interactive login, this is the path used by scheduled/headless runs and by the vijil-adlc Claude Code plugin, which declares this server in its plugin manifest. Add the MCP config (step 4 below) and you are done.
Connecting to a self-managed environment
The MCP server uses the CLI for all API communication. Configure the CLI once and the MCP server inherits the connection.
1. Find your Console API URL
If you have kubectl access to the EKS cluster:
kubectl get svc vijil-console-nginx -n vijil-console \
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
This gives you the raw ELB hostname. If a DNS record exists (e.g., console-api.dev05.vijil.ai), use that instead.
2. Initialize the CLI
vijil-console auth init --url https://console-api.example.com
Or run vijil-console auth init without arguments to be prompted for the URL. The CLI verifies connectivity before saving.
3. Authenticate
vijil-console auth login
You will be prompted for your email and password. If you belong to multiple teams, select one:
vijil-console team list
vijil-console team use <team_id>
4. If your Console uses a private CA
A self-managed Console often terminates TLS with a certificate from your own
PKI, which certifi does not carry — so step 2 fails with a certificate error
even though the URL is right. Point VIJIL_CA_BUNDLE at a PEM file containing
that CA:
export VIJIL_CA_BUNDLE=/etc/ssl/certs/your-internal-ca.pem
It is additive: the CLI verifies against the OS trust store, certifi, and
that file. It never disables verification.
This value cannot be persisted anywhere — there is no config key for it — so the
MCP server needs it in its own env block as well as in your shell, because the
server captures its environment at spawn:
"env": { "VIJIL_CA_BUNDLE": "${VIJIL_CA_BUNDLE:-}" }
vijil-console auth status --json reports it as ca_bundle (null when unset),
and so does the vijil_status tool, so a missing or stale bundle is visible
rather than mysterious.
5. Add MCP config
Create a .mcp.json file in your project root:
{
"mcpServers": {
"vijil": {
"type": "stdio",
"command": "vijil-mcp",
"env": {
"VIJIL_API_KEY": "${VIJIL_API_KEY:-}",
"VIJIL_CONSOLE_URL": "${VIJIL_CONSOLE_URL}"
}
}
}
}
The env block is optional if you authenticated the CLI interactively, but it is what lets the server connect to the public platform with no vijil-console auth step. (This is exactly the block the vijil plugin ships in its manifest.)
Note the two shapes, and copy them as written. The :- on a credential is the belt: hosts that support it emit an empty string rather than the literal text ${VIJIL_API_KEY} when the variable is unset in your shell. The braces on VIJIL_CONSOLE_URL carry no :- default: pinning the public gateway there would override a self-hosted console_url already on disk (CON-723). Either way the CLI treats an unexpanded ${NAME} as unset for every one of these variables — credentials included — so a host that ignores :- cannot turn a placeholder into a credential that shadows your session (CON-725).
Alternative locations:
- Project-level (shared via git):
.mcp.jsonin project root - User-level (all projects):
~/.claude.json - Local-only (not committed):
.claude/mcp.jsonin project root
6. Use with Claude Code
Start Claude Code in a directory with .mcp.json. The Vijil tools appear automatically. Ask Claude things like:
- "List my agents"
- "Run a safety evaluation on agent X"
- "Show the latest evaluation results"
- "Create a red team campaign against my agent"
- "What's on my trust dashboard?"
Available tools
All CLI commands are exposed as MCP tools (116 total). Tool names follow the pattern {group}_{command}:
| Group | Example tools | Description |
|---|---|---|
agent |
agent_list, agent_create, agent_get, agent_update, agent_import |
Manage AI agents |
eval |
eval_run, eval_status, eval_list, eval_results_detail, eval_report |
Run and manage evaluations |
harness |
harness_list, harness_custom_create, harness_custom_list |
Manage test harnesses |
dome |
dome_config_list, dome_config_create, dome_detect |
Guardrail configuration and detection |
persona |
persona_list, persona_create, persona_from_preset |
Manage test personas |
policy |
policy_list, policy_create, policy_activate, policy_add_rule |
Compliance policies and rules |
telemetry |
telemetry_logs, telemetry_traces, telemetry_metric_total |
Query observability data |
evolution |
evolution_run, evolution_status |
Darwin evolution engine |
proposal |
proposal_list, proposal_approve, proposal_reject |
Manage mutation proposals |
genome |
genome_list, genome_get, genome_create, genome_extract |
Manage agent genomes |
demographics |
demographics_list, demographics_create, demographics_values |
Demographic dimensions |
dimensions |
dimensions_list, dimensions_create, dimensions_values |
Evaluation dimensions |
dashboard |
dashboard_show |
Trust dashboard |
team |
team_list, team_use |
Switch team context |
vijil_status |
vijil_status |
Credential source, Console URL and which rung supplied it, and the next step when auth is broken |
Async operations
Some tools support a wait parameter (eval_run, evolution_run). When wait=True, the tool polls until the operation completes (up to 10 minutes).
Configuration
Connection state resolves in this order (highest first):
-
Environment variables —
VIJIL_CLIENT_ID+VIJIL_CLIENT_SECRET(preferred), orVIJIL_API_KEY, plusVIJIL_CONSOLE_URLandVIJIL_TEAM_ID. -
On-disk CLI config at
~/.vijil/config.yaml(written byvijil-console auth login):console_url: https://console-api.example.com auth_token: eyJhbG... refresh_token: ... default_team_id: c58aea71-3861-4f28-b8c4-20832a2f22ee
-
The URL carrier at
~/.vijil/credentials.json— itsurlfield, written by whichever client (this CLI or thevijilSDK) logged in most recently, so a URL learned by one is visible to the other. -
Default —
console_urlfalls back to the public gatewayhttps://console-api.vijil.ai.
A console_url that is not an http(s):// URL is a configuration error naming the file it came from, never a network error. When two of these sources name different hosts, the CLI prints one warning on stderr naming both — a token minted at one Console and sent to another is the usual cause of an unexplained 401.
VIJIL_CONSOLE_URL is not an ephemeral override at login time: vijil-console auth login / login-browser persist the URL they signed in against into config.yaml, so a login performed with the variable set pins that host durably and unsetting it afterwards does not undo it. Run vijil-console auth init --url <other> to move it.
This server captures its environment at spawn. Exporting or unsetting a VIJIL_* variable in your shell does not reach an already-running server — reconnect it (restart Claude Code, or toggle the server off and on) for the change to take effect.
Token recovery on a 401 depends on the credential. An API-key pair is re-exchanged automatically for a fresh bearer (so headless sessions self-heal). An interactive JWT session is refreshed via /auth/jwt/refresh. A raw VIJIL_API_KEY bearer is not refreshable — a 401 means it is invalid or expired.
Troubleshooting
| Error | Fix |
|---|---|
| "vijil-console not found in PATH" | Run pip install vijil-console |
401 with VIJIL_CLIENT_ID / VIJIL_CLIENT_SECRET set |
The API-key pair was rejected (invalid or revoked) — mint a new one at Settings → API Keys |
401 with VIJIL_API_KEY set |
The raw bearer token is invalid or expired — supply a fresh one, or switch to the key pair |
| "Session expired" (interactive login) | Run vijil-console auth login |
| "No team selected" | Run vijil-console team use <team_id> or set VIJIL_TEAM_ID. Note that vijil_status reports the team separately from authenticated — a null team does not mean you are signed out |
| An environment credential is shadowing an on-disk session | unset VIJIL_CLIENT_ID VIJIL_CLIENT_SECRET (or unset VIJIL_API_KEY), then reconnect this server — see the spawn note above. If they are already unset, the shadowing credential was an unexpanded ${VIJIL_CLIENT_ID} literal from the manifest; that no longer counts as a credential, so upgrade the server rather than unsetting anything |
| Any other auth confusion | Call vijil_status first. It names the URL, which rung supplied it, the credential source (masked), and the next step |
| Tools don't appear in Claude Code | Check .mcp.json is in the project root and restart Claude Code |
Metadata
Release files for vijil-mcp 0.4.12
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 |
|---|---|---|---|---|
| vijil_mcp-0.4.12.tar.gz | 36.3 kB | Without provenance | Details for vijil_mcp-0.4.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vijil_mcp-0.4.12-py3-none-any.whl | Python 3 | none | any | Details for vijil_mcp-0.4.12-py3-none-any.whl |
Total release size: 88.6 kB
Release files / vijil_mcp-0.4.12.tar.gz
| Download URL | vijil_mcp-0.4.12.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee629018efc91f30e4d36b1ea5c19b00955199179e5cd3177579c312a3c84a6c
|
|
BLAKE2b-256 checksum How to use checksums |
4c431519abd784c99eddc08da67f5896c86f4e292402b18669d6ad29d0fa54ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.12.15 Linux/7.0.0-1017-azure
|
Release files / vijil_mcp-0.4.12-py3-none-any.whl
| Download URL | vijil_mcp-0.4.12-py3-none-any.whl |
|---|---|
| Size | 52.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58e44ed295e69c435154fc23de481da4fc394e0757387c1ba1ae62a91bde6f2d
|
|
BLAKE2b-256 checksum How to use checksums |
e313bc8ad4218567126ae84ad840464d512300adbd39420635d4e1529e47e56b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.12.15 Linux/7.0.0-1017-azure
|
Security for vijil-mcp 0.4.12
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.