OPA MCP
OCI · DOCKER.IO/ORYGN/OPA-MCP:0.2.1 · 2 COMPONENTS · SCANNED AUG 3
Author, validate, debug, and explain OPA Rego policies through any MCP-compatible client.
Available components
How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score →
Supply Chain Security0
- Malware scan not yet available for this package.Unverified
- CVE data not yet available for this package.Unverified
- Install-script risk not yet assessed.Unverified
- Dependency-health data not yet available.Unverified
Provenance & Transparency45
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Provenance check failed: no build-provenance attestation is published. See how to fix → View diagnostics → Fail
- Clear OSI-approved license (MIT).Pass
- Actively maintained (last published 38 days ago).Pass
- Disclosure check failed: no security disclosure policy was found in the source repository. See how to fix → Fail
Schema Quality & AI Usability79
- 100% of prompts and resources have a non-trivial description (not blank, and not just the item's name).Pass
- AI-judged instruction clarity (excellent).Pass
- Context-footprint check failed: tool/resource definitions use about 10903 tokens (~198/item across 55 items; 52 tools + 3 resources), over budget; trim descriptions and params. See how to fix → Fail
- Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management27
- Stability observed for 8 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage100
- 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
- 100% of tool parameters carry a description.Pass
Capabilities100
- Implements a supported MCP spec version (2025-11-25); the latest is 2026-07-28.Pass
Unverified: 1 category
A category scored 0 because we could not verify it: a data source with nothing on this package, evidence we could not reach, or a check we could not run. We only credit what we can confirm.
Add this component to your MCP client. Where a client-specific snippet is available, pick your client below and copy it straight into your config; otherwise use the connection detail shown.
oci · docker.io/orygn/opa-mcp:0.2.1
claude mcp add orygnscode-opa-mcp -- docker run --rm -i docker.io/orygn/opa-mcp:0.2.1
codex mcp add orygnscode-opa-mcp -- docker run --rm -i docker.io/orygn/opa-mcp:0.2.1
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"orygnscode-opa-mcp": {
"type": "local",
"command": [
"docker",
"run",
"--rm",
"-i",
"docker.io/orygn/opa-mcp:0.2.1"
],
"enabled": true
}
}
} mcp_servers:
orygnscode-opa-mcp:
command: "docker"
args: ["run", "--rm", "-i", "docker.io/orygn/opa-mcp:0.2.1"] {
"mcpServers": {
"orygnscode-opa-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"docker.io/orygn/opa-mcp:0.2.1"
]
}
}
} Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.
- 3 Aug 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 23 to 27. That category is still filling its 30-day observation window: 7 days of observed history at the previous scan, 8 at this one. The score rises as the window fills, whether or not the server changes.
- 2 Aug 26 +3
- Stability: unverified → 0.23 ▲ functional
- 31 Jul 26 −6
- We updated how we score, so this day's move reflects our rubric, not a change to the server See what changed → functional
- 27 Jul 26 0
- We updated how we score, so this day's move reflects our rubric, not a change to the server See what changed → functional
- 26 Jul 26 46
First indexed and scored.
Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.
Captured 3 Aug 2026 · Analysed oci/docker.io/orygn/opa-mcp:0.2.1
Provenance none
Ecosystem: oci · Outcome: none
Reason: no_attestation
The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability.
conftest_pull Conftest pull ~265
Download Rego policies from an OCI registry or Git repository into a local directory using `conftest pull`. Use this to hydrate a local `policy/` directory before running `conftest_test`. Requires `conftest` on PATH or `CONFTEST_BINARY` set. The `policy` directory must be inside OPA_MCP_ALLOWED_PATHS. SECURITY: pulled policies are arbitrary Rego source that will be executed by `conftest_test`. Only pull from registries or repositories you own or explicitly trust -- malicious policy code can use OPA built-ins (http.send, opa.runtime) to exfiltrate data or make outbound network requests when the tests run.
| Name | Type | Req | Description |
|---|---|---|---|
| policy | string | — | Local directory where the pulled policies will be written. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Defaults to `./policy` (conftest's convention). |
| url | string | yes | Policy URL to pull. Supported schemes: `oci://registry/repo:tag` (OCI registry), `github.com/org/repo//path` (GitHub subdirectory), `git::https://example.com/repo//path` (generic Git). See https://ww… |
No output schema declared.
No examples provided.
conftest_push Conftest push ~209
Package the local Rego policy directory as an OCI artifact and push it to a registry using `conftest push`. Registry credentials must be pre-configured in the host environment (docker login, ORAS keychain, etc.) -- this tool never handles credentials. The `policy` directory must be inside OPA_MCP_ALLOWED_PATHS. Requires `conftest` on PATH or `CONFTEST_BINARY` set.
| Name | Type | Req | Description |
|---|---|---|---|
| policy | string | — | Path to the local directory containing Rego policies to push. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS) and must exist. Defaults to `./policy` (conftest's convention). |
| repository | string | yes | OCI repository URL to push policies to (e.g. `ghcr.io/my-org/policies:latest`). Registry credentials must already be configured in the host environment (via `docker login`, ORAS keychain, or REGISTRY… |
No output schema declared.
No examples provided.
conftest_test Conftest test ~698
Evaluate configuration files (Kubernetes manifests, Terraform plans, Dockerfiles, Helm charts, or any YAML/JSON/HCL/TOML/INI) against Rego policies using `conftest test`. Returns per-file, per-namespace pass/fail/warn results so you can pinpoint exactly which policy rules fired. Requires `conftest` on PATH or `CONFTEST_BINARY` set; returns CONFTEST_NOT_FOUND otherwise. Provide config via `files` (disk paths) or `inlineConfig` (inline string). Provide policy via `policy` (disk path) or `inlinePolicy` (inline Rego source). Omit `policy` and `inlinePolicy` to use conftest's default `./policy` directory.
| Name | Type | Req | Description |
|---|---|---|---|
| allNamespaces | boolean | — | Test policies found in all discovered namespaces. Overrides `namespace`. |
| combine | boolean | — | Combine all configuration files into a single input document before evaluating. Useful when policies need to inspect relationships across multiple files. |
| data | array | — | Paths to directories from which additional data will be loaded for the Rego policies. Each path must be inside an allowed root. |
| failOnWarn | boolean | — | Return `passed: false` even when only warnings (no hard failures) are present. |
| files | array | — | Filesystem paths to configuration files to evaluate (YAML, JSON, HCL, Dockerfile, etc.). Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `inlineConfig`. |
| inlineConfig | string | — | Inline configuration content to evaluate (e.g. a Kubernetes manifest as a YAML string). Mutually exclusive with `files`. Defaults to YAML format; set `inlineConfigParser` to override. |
| inlineConfigParser | string | — | Parser to use for `inlineConfig`. Valid values: yaml (default), json, toml, hcl1, hcl2, ini, xml, dotenv, cue, jsonnet, properties, edn, hocon, dockerfile. Ignored when `files` is used (conftest infe… |
| inlinePolicy | string | — | Inline Rego policy source. Written to a temporary directory and passed as `--policy`. The policy should declare `package main` (or match the `namespace` parameter). Mutually exclusive with `policy`. |
| namespace | string | — | Rego namespace (package name) to test against. Defaults to `main`. Use `allNamespaces: true` to test all discovered namespaces instead. |
| parser | string | — | Force a specific parser for all input `files` via conftest's global `--parser` flag, overriding extension-based detection. Useful for files whose extension does not match their format (e.g. parse a `… |
| policy | string | — | Path to a directory or file containing Rego policies. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `inlinePolicy`. Omit to let conftest use its default `./policy` d… |
No output schema declared.
No examples provided.
conftest_verify Conftest verify ~192
Run the `test_*` rules inside `*_test.rego` files within a conftest policy directory, verifying that the policies themselves are correct. Equivalent to `opa test` but using conftest's policy-loading machinery. Returns per-file pass/fail results. Requires `conftest` on PATH or `CONFTEST_BINARY` set; returns CONFTEST_NOT_FOUND otherwise.
| Name | Type | Req | Description |
|---|---|---|---|
| data | array | — | Paths to data directories. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
| namespace | string | — | Namespace to verify. Defaults to `main`. Omit to verify all namespaces. |
| policy | string | — | Path to the directory containing both the Rego policies and the `*_test.rego` test files. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Omit to use conftest's default `./policy` directory. |
No output schema declared.
No examples provided.
mcp_server_info MCP server info ~61
Return the name, version, and runtime details of this opa-mcp server instance. Use this when you need to confirm which version of opa-mcp is running, or to verify that the OPA, Regal, and Conftest binaries are reachable.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
opa_bundle_build Build OPA bundle ~448
Build a deployable bundle from policy / data paths using `opa build`. Output is a `.tar.gz` archive with optional inline signing. Supports optimization, custom revision strings, and the WASM target.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | boolean | — | Load `paths` as bundle files or root directories (`--bundle`). Required when rebuilding or re-signing an existing bundle. |
| capabilities | string | — | Path to a capabilities JSON file. |
| claimsFile | string | — | Path to a claims file for inline signing. |
| entrypoints | array | — | Entrypoint refs (required when `target=wasm` or `optimize > 0`). |
| ignore | array | — | File/directory name patterns to ignore during loading (`--ignore`), e.g. `[".*"]` to skip hidden files. These are name patterns, not filesystem paths. |
| optimize | number | — | Optimization level (0 = none, 2 = aggressive). |
| output | string | yes | Output bundle path (typically `*.tar.gz`). Must be in an allowed root. |
| paths | array | yes | Policy / data paths to include. Each must be in an allowed root. |
| pruneUnused | boolean | — | Exclude dependents of entrypoints that are not reachable from them (`--prune-unused`). Most useful alongside `entrypoints`. |
| revision | string | — | Bundle revision string written to the manifest. |
| signingAlg | string | — | Signing algorithm (e.g. RS256). |
| signingKey | string | — | Path to a signing key for inline signing. |
| target | string | — | Build target (default `rego`; `wasm` compiles to WebAssembly). |
| v1Compatible | boolean | — | Opt in to OPA v1.0-compatible behaviors (`--v1-compatible`). Affects the built bundle's runtime semantics. |
| verificationKey | string | — | Path to a PEM public key (or HMAC secret file) used to re-verify an existing signed bundle during the build (`--verification-key`). Pair with `bundle: true`. |
| verificationKeyId | string | — | Key ID for verification (`--verification-key-id`, OPA default `default`). |
No output schema declared.
No examples provided.
opa_bundle_sign Sign OPA bundle ~115
Sign an OPA bundle with a private key using `opa sign`. Writes a `.signatures.json` next to the bundle directory, or updates the archive in place.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | string | yes | Path to a bundle directory or archive. Must be in an allowed root. |
| claimsFile | string | — | Path to extra claims to include in the signature. |
| signingAlg | string | — | Signing algorithm (e.g. RS256). Default: RS256. |
| signingKey | string | yes | Path to the signing key. |
No output schema declared.
No examples provided.
opa_bundle_verify Verify OPA bundle signature ~267
Verify the cryptographic signature of a signed OPA bundle using `opa eval --bundle --verification-key`. The bundle must have been signed with `opa sign` (or `opa_bundle_sign`). OPA checks the `.signatures.json` manifest inside the bundle against the provided public key before loading any policy -- a tampered or unsigned bundle will fail with `INVALID_BUNDLE`. Returns `{ bundle, verified: true }` on success.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | string | yes | Path to the signed bundle directory or `.tar.gz` archive. Must be inside an allowed root. |
| scope | string | — | Expected `scope` value in the bundle signature. Required when the bundle was signed with `--scope`. |
| signingAlg | string | — | Signing algorithm used when the bundle was signed (e.g. `RS256`, `PS256`, `ES256`, `HS256`). Defaults to `RS256`. |
| verificationKey | string | yes | Path to the PEM file containing the RSA or ECDSA public key, or the path to the HMAC secret file. Must be inside an allowed root. |
| verificationKeyId | string | — | Key ID that must match the `keyid` field in the bundle signature. Required when the bundle was signed with `--public-key-id`. |
No output schema declared.
No examples provided.
opa_compile_query Compile (partially evaluate) a query on OPA ~96
Send a query to the OPA server's `/v1/compile` endpoint for partial evaluation. Returns the residual query -- what remains after substituting in everything that's known.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Optional partial input document. |
| query | string | yes | Rego query to compile, e.g. "data.rbac.allow == true". |
| unknowns | array | — | Refs to treat as unknown (default: ["input"]). |
No output schema declared.
No examples provided.
opa_config OPA configuration ~24
Return the running OPA server configuration (sanitized -- secrets are not included).
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
opa_delete_data Delete a data document from OPA ~132
Remove a document from OPA's data store at the given path. The path may be in dotted form (`users.alice`) or slash form (`users/alice`). OPA responds with 204 No Content on success; if no document exists at the path, OPA returns 404 which is mapped to `DATA_NOT_FOUND`. Root-path deletion (`/v1/data/` itself) is intentionally excluded -- supply at least one path segment.
| Name | Type | Req | Description |
|---|---|---|---|
| path | string | yes | Data path to delete, e.g. "users.alice" or "users/alice". Must be at least one segment deep. |
No output schema declared.
No examples provided.
opa_delete_policy Delete OPA policy ~32
Delete a policy by ID from the running OPA server.
| Name | Type | Req | Description |
|---|---|---|---|
| id | string | yes | Policy ID to delete. |
No output schema declared.
No examples provided.
opa_exec Batch-evaluate OPA policy against input files ~509
Evaluate a policy decision against one or more input files using `opa exec --format=json`. Unlike `rego_eval` (single input), `opa exec` processes every file independently and returns a per-file result -- ideal for CI pipelines that check many config files against a policy in one call. Supply `bundle` for bundle-based policies or `dataPaths` for raw policy files; these are mutually exclusive. Each file that fails evaluation appears in `results` with an `error` field rather than a `result` field. Set one of `fail`/`failDefined`/`failNonEmpty` to turn the call into a CI gate: the result then reports `failed: true` (instead of erroring) when the gate condition is met.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | string | — | Path to an OPA bundle directory or `.tar.gz` archive to load as the policy source. Mutually exclusive with `dataPaths`. |
| dataPaths | array | — | Policy and/or data file or directory paths, each loaded as an OPA bundle root (opa exec loads policy only via bundles). Mutually exclusive with `bundle`. |
| decision | string | yes | The policy entrypoint to evaluate for each input, e.g. `"data.authz.allow"` or `"data.policy.violations"`. Must be a fully-qualified Rego reference. |
| fail | boolean | — | CI gate: report `failed: true` when any decision is undefined or errors. Mutually exclusive with `failDefined` and `failNonEmpty`. |
| failDefined | boolean | — | CI gate: report `failed: true` when any decision is defined or errors. Use when a defined result means a violation. Mutually exclusive with `fail` and `failNonEmpty`. |
| failNonEmpty | boolean | — | CI gate: report `failed: true` when any decision result is non-empty or errors. Mutually exclusive with `fail` and `failDefined`. |
| inputPaths | array | yes | One or more JSON/YAML input file paths, or a directory containing input files. OPA evaluates each file independently. Every path must be inside an allowed root. |
| timeout | string | — | Per-exec evaluation timeout as a Go duration, e.g. `"30s"` or `"5m"`. Still bounded by the server subprocess timeout (OPA_MCP_TIMEOUT_MS). |
| v1Compatible | boolean | — | Opt in to OPA v1.0-compatible behaviors (`--v1-compatible`). |
No output schema declared.
No examples provided.
opa_get_data Read data from OPA ~68
Read a path from OPA's data hierarchy. The `path` argument may be in dotted form (`users.alice`) or slash form (`users/alice`).
| Name | Type | Req | Description |
|---|---|---|---|
| path | string | yes | Data path under `data.`, e.g. "users" or "users/alice". |
No output schema declared.
No examples provided.
opa_get_policy Get OPA policy by ID ~45
Fetch a single policy by ID from the running OPA server.
| Name | Type | Req | Description |
|---|---|---|---|
| id | string | yes | Policy ID, e.g. "rbac" or "policies/auth/main". |
No output schema declared.
No examples provided.
opa_health OPA health check ~77
Hit the OPA `/health` endpoint. Returns `{ healthy: true }` on 200. Supports `bundles` and `plugins` query flags to require those subsystems to also be healthy.
| Name | Type | Req | Description |
|---|---|---|---|
| bundles | boolean | — | Require bundle plugin to be healthy as well. |
| plugins | boolean | — | Require all plugins to be healthy. |
No output schema declared.
No examples provided.
opa_list_policies List OPA policies ~34
List policies registered on the running OPA server. Returns an array of `{ id, raw, ast }` records.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
opa_patch_data Patch data on OPA ~68
Apply a JSON Patch (RFC 6902) to the data document. Each operation is `{ op, path, value? }`.
| Name | Type | Req | Description |
|---|---|---|---|
| operations | array | yes | Array of JSON Patch operations. |
| path | string | yes | Data path the patch is applied to. Use "" for the root. |
No output schema declared.
No examples provided.
opa_put_data Write data to OPA ~50
Write or replace a value at the given data path. Body is sent as JSON.
| Name | Type | Req | Description |
|---|---|---|---|
| path | string | yes | Data path to write to. |
| value | — | — | JSON value to store at this path. |
No output schema declared.
No examples provided.
opa_put_policy Upload or replace OPA policy ~69
Upload a Rego policy under the given ID. Replaces any existing policy with that ID. The policy is uploaded as raw text/plain -- OPA parses it on the server side.
| Name | Type | Req | Description |
|---|---|---|---|
| id | string | yes | Policy ID to create or replace. |
| source | string | yes | Rego source. |
No output schema declared.
No examples provided.
opa_query_decision Query OPA decision ~119
Evaluate a decision against the running OPA server. POSTs to the data path with `{input}` and returns whatever the rule produces. Use this to ask the server "given this input, what does data.X.allow say?"
| Name | Type | Req | Description |
|---|---|---|---|
| explain | string | — | Include a trace at the requested level. |
| input | — | — | Input document to evaluate against. |
| metrics | boolean | — | Include metrics in the response. |
| path | string | yes | Decision path under `data.`, e.g. "rbac/allow" or "rbac.allow". |
No output schema declared.
No examples provided.
opa_status OPA status ~86
Return the running OPA server configuration via `GET /v1/config`. Returns the same underlying document as `opa_config` but presented under a `status` key as a convenience for agents that want to check "what is running" rather than "what was the server configured with". The response includes bundle settings, decision-log settings, and plugin configuration as OPA reported them at startup.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
rego_bench Benchmark Rego query ~121
Benchmark a Rego query against a policy + input with `opa bench`. Returns statistical timing data: iterations, ns/op, and allocation counts. Use this to spot slow rules.
| Name | Type | Req | Description |
|---|---|---|---|
| count | integer | — | Number of benchmark iterations. Defaults to OPA's built-in default. |
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. |
| paths | array | — | Policy / data paths to load. Each must be in an allowed root. |
| query | string | yes | Rego query to benchmark. |
No output schema declared.
No examples provided.
rego_capabilities OPA capabilities ~219
Return OPA capabilities -- the available builtins, future keywords, features, and WASM ABI versions. With `current: true`, returns the running OPA's capabilities. With `version: "v0.69.0"`, returns those of a specific version. With neither, lists available named versions. By default (`names_only: true`), returns only builtin names and count to stay within response size limits; pass `names_only: false` for full type signatures and documentation.
| Name | Type | Req | Description |
|---|---|---|---|
| current | boolean | — | Print the capabilities of the currently installed OPA. Mutually exclusive with `version`. |
| names_only | boolean | — | When true (default), return only builtin names, count, future keywords, and features. The full spec payload routinely exceeds client response size limits. Set to false to retrieve complete type signa… |
| version | string | — | A specific OPA capabilities version (e.g. "v0.69.0"). When neither flag is set, lists available versions. |
No output schema declared.
No examples provided.
rego_check Check Rego ~241
Type-check Rego with `opa check`. Returns `{ valid: true, errors: [] }` on success, or a list of structured diagnostics with file/line locations on failure. Provide either `source` for inline checking or `paths` for file/directory checking.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | boolean | — | Load `paths` as bundle files or root directories (`--bundle`). Only valid with `paths`, not inline `source`. |
| capabilities | string | — | Path to a capabilities JSON file restricting allowed builtins. |
| maxErrors | integer | — | Maximum number of errors to collect before `opa check` aborts compilation (`--max-errors`, OPA default 10). Raise it to surface more diagnostics from a badly broken policy in a single pass. |
| paths | array | — | Filesystem paths to check. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
| schemaDir | string | — | Schema directory for input/data validation. |
| source | string | — | Inline Rego source. Mutually exclusive with `paths`. |
| strict | boolean | — | Enable strict mode -- fail on unused vars, deprecated builtins, etc. |
No output schema declared.
No examples provided.
rego_check_schema Check Rego against a JSON Schema ~353
Validate that a Rego policy's input.* field references are consistent with a JSON Schema using `opa check --schema`. Every field the policy reads from `input` must exist in the schema; mismatches surface as rego_type_error diagnostics with file/line locations. Returns `{ valid: true, errors: [] }` when all references match the schema, or `{ valid: false, errors: [...] }` with structured diagnostics when they do not. Accepts the schema inline (pass the `schema` output of `rego_infer_input_schema` directly as `inlineSchema`) or as a path to an existing JSON Schema file on disk (`schemaPath`). Provide `source` for inline Rego or `paths` for file/directory checking.
| Name | Type | Req | Description |
|---|---|---|---|
| inlineSchema | object | — | JSON Schema (draft-07) object describing the expected shape of the `input` document. Mutually exclusive with `schemaPath`. Accepts the `schema` field from `rego_infer_input_schema` output directly. |
| paths | array | — | Filesystem paths to policy files or directories to validate. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `source`. |
| schemaPath | string | — | Path to a JSON Schema file on disk to use for `input` validation. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `inlineSchema`. |
| source | string | — | Inline Rego source to validate against the schema. Mutually exclusive with `paths`. |
| strict | boolean | — | Enable strict mode -- also fail on unused variables, deprecated builtins, and other non-fatal issues in addition to schema violations. |
No output schema declared.
No examples provided.
rego_compile_query Partially evaluate a Rego query ~216
Run partial evaluation on a query -- substitute known values and return the residual policy. Defaults `unknowns` to `["input"]` (treat input as unknown), so the residual encodes "given input X, this is what would have to be true." Use this for offline policy slicing or pre-computing decision sets.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_coverage_gaps Rego test coverage gaps ~138
Run opa test --coverage and return a per-file breakdown of uncovered line ranges. Identifies which rules or branches are not yet exercised by tests. Files are sorted by coverage ascending so the worst-covered files appear first. Use threshold to limit the report to files below a target coverage percentage.
| Name | Type | Req | Description |
|---|---|---|---|
| paths | array | yes | Test directories or files. opa test looks for *_test.rego siblings of source files. |
| runPattern | string | — | Run only tests whose names match this regex. |
| threshold | number | — | Report only files below this coverage percentage (0-100). When omitted, all files with uncovered ranges are reported. |
No output schema declared.
No examples provided.
rego_deps Rego dependency analysis ~104
Static dependency analysis for a Rego reference. Given a target ref like "data.example.allow", returns the base document references (input/data leaves) and virtual document references (rules) it depends on, transitively.
| Name | Type | Req | Description |
|---|---|---|---|
| paths | array | yes | Policy / data paths to load before computing dependencies. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
| ref | string | yes | Reference to compute dependencies for, e.g. "data.example.allow". |
No output schema declared.
No examples provided.
rego_describe_policy Describe Rego policy ~98
Parse a Rego policy and return a structured summary: package, imports, and rules. Each rule reports clauseCount (how many definitions share the name), isDefault (true if any clause is a default), hasArgs, bodyLength (total body expressions across all clauses), and inline annotations. Useful as the first step in any "what does this policy do" workflow.
| Name | Type | Req | Description |
|---|---|---|---|
| source | string | yes | Rego source to describe. |
No output schema declared.
No examples provided.
rego_eval Evaluate Rego query ~184
Evaluate a Rego query against a policy and an input document using `opa eval`. Returns the standard `{result: [...]}` shape. The bread-and-butter authoring tool.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_eval_with_coverage Evaluate Rego with coverage ~177
Evaluate with `--coverage` and return per-line coverage data. Useful for verifying that tests actually exercise the rules they're meant to.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_eval_with_explain Evaluate Rego with execution trace ~199
Evaluate with `--explain=full` and return a structured trace alongside the result. Use this when an agent needs to see why a rule fired (or didn't) -- the trace is the basis for `rego_explain_decision`.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_eval_with_profile Evaluate Rego with profiling ~175
Evaluate with `--profile` and return per-rule timing and evaluation counts. Use this to find hot rules in slow policies.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_explain_decision Explain Rego decision ~206
Evaluate a Rego query with full tracing and return a structured trace plus per-rule fired/not-fired summary. Use this when you need to answer "why was this denied?" -- the agent reads the structured trace and narrates the cause without re-implementing the trace parser.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Inline input document. |
| inputPath | string | — | Path to a JSON input file. Mutually exclusive with `input`. |
| partial | boolean | — | Run partial evaluation rather than full evaluation. |
| paths | array | — | Policy / data file or directory paths. Each must be inside an allowed root. |
| query | string | yes | Rego query to evaluate, e.g. "data.example.allow". |
| source | string | — | Inline Rego policy source. Mutually exclusive with `paths`. |
| strictBuiltinErrors | boolean | — | Treat builtin errors as fatal instead of returning undefined. |
| unknowns | array | — | Refs to treat as unknown during partial evaluation. |
No output schema declared.
No examples provided.
rego_explain_undefined Explain why a Rego query is undefined ~196
Diagnose why a fully-qualified Rego query (e.g. "data.authz.allow") produces no value. Combines a plain eval, a full-trace eval, and per-condition AST analysis to identify the exact body expression blocking each rule. Handles both runtime failures (trace-based) and indexer elimination (standalone condition eval). Returns a structured breakdown of which conditions blocked each rule plus a human-readable summary.
| Name | Type | Req | Description |
|---|---|---|---|
| input | — | — | Input document (JSON value) for the query. |
| inputPath | string | — | Path to an input JSON file. |
| paths | array | — | Policy .rego file paths to load. Mutually exclusive with source. |
| query | string | yes | Fully-qualified rule reference to explain, e.g. "data.authz.allow". Must match the path you would pass to rego_eval. |
| source | string | — | Inline Rego source to analyse. Mutually exclusive with paths. |
No output schema declared.
No examples provided.
rego_fix Auto-fix Rego violations ~300
Run regal fix to automatically apply mechanical fixes for the five rules regal 0.30.0 supports: opa-fmt, use-rego-v1, use-assignment-operator, no-whitespace-comment, and directory-package-mismatch. Use dryRun: true to preview changes before modifying files. NOTE: directory-package-mismatch moves files to match their package path -- use disable: ["directory-package-mismatch"] to skip it. Files with uncommitted git changes require force: true. Requires regal.
| Name | Type | Req | Description |
|---|---|---|---|
| configFile | string | — | Path to a Regal config file (.regal/config.yaml). |
| disable | array | — | Disable specific fix rules. Useful to skip directory-package-mismatch if you do not want files moved. |
| disableCategory | array | — | Disable all rules in a category. |
| dryRun | boolean | — | Preview what would be fixed without modifying any files. Recommended before the first real run. |
| enable | array | — | Enable specific fix rules. |
| enableCategory | array | — | Enable all rules in a category. |
| force | boolean | — | Allow fixing files that have uncommitted git changes, or when the project is not a git repository. Without this flag regal refuses to touch uncommitted files. |
| ignoreFiles | array | — | Glob patterns to exclude from fixing. |
| paths | array | yes | Policy files or directories to fix. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
No output schema declared.
No examples provided.
rego_format Format Rego ~118
Format Rego source code using `opa fmt`. Returns the formatted source and a `changed` flag indicating whether the input was already canonical. When the source uses string interpolation ($"..." or $`...` syntax) and OPA v1.12.0 or v1.12.1 is detected, the tool warns about or blocks formatting due to a known OPA bug that corrupts \{ escape sequences (fixed in OPA v1.12.2).
| Name | Type | Req | Description |
|---|---|---|---|
| source | string | yes | Rego source code to format. |
No output schema declared.
No examples provided.
rego_format_write Format Rego files in place ~260
Run `opa fmt --write` to canonically format one or more Rego files or directories in place. Use `dryRun: true` to preview which files would change without modifying them. Returns a list of files that were (or would be) reformatted. Unlike `rego_format` which returns formatted source as a string, this tool writes directly to disk. Supports `regoV1`, `v0Compatible`, and `v1Compatible` flags for version-specific formatting. If any file cannot be parsed, the operation is aborted and no files are written.
| Name | Type | Req | Description |
|---|---|---|---|
| dryRun | boolean | — | Preview which files would be reformatted without modifying them. Recommended before the first real run. |
| paths | array | yes | Policy files or directories to format in place. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
| regoV1 | boolean | — | Format module(s) to be compatible with both Rego v1 and the current OPA version. Adds `import rego.v1` where missing. |
| v0Compatible | boolean | — | Use OPA behaviors and syntax prior to the v1.0 release. |
| v1Compatible | boolean | — | Use OPA v1.0-compatible behaviors. |
No output schema declared.
No examples provided.
rego_generate_test_skeleton Generate Rego test skeleton ~244
Generate a `*_test.rego` skeleton from a policy. Parses the AST, finds each non-test rule, and emits one stub test per rule. Existing `test_*` and `todo_test_*` rules are skipped automatically -- only testable production rules get stubs. The AST is walked to infer which `input.*` fields the policy accesses; the inferred shape is used as the placeholder `with input as {...}` in each stub, so the developer only needs to fill in realistic values rather than guess the structure. With `tableStyle: true`, each stub uses an `every tc in cases { ... }` loop so you can add multiple input/expected pairs without duplicating assertion code. The `inferredInputShape` field in the response shows the detected shape for reference.
| Name | Type | Req | Description |
|---|---|---|---|
| source | string | yes | Rego source to generate tests for. |
| tableStyle | boolean | — | Generate table-driven test stubs instead of single-case stubs. Each rule gets a `cases` array and an `every tc in cases { ... }` assertion loop. Pair with `rego_test varValues: true` to see which cas… |
No output schema declared.
No examples provided.
rego_infer_input_schema Infer input schema ~153
Statically analyse one or more Rego policies and return a JSON Schema (draft-07) object describing every input.* field the policies read. Uses opa parse for AST-level analysis -- no running OPA server required. Correct starting point for writing integration tests, configuring opa check --schema validation, or documenting a policy API. Accepts inline source, individual files, or directories (walked recursively for *.rego files).
| Name | Type | Req | Description |
|---|---|---|---|
| paths | array | — | Policy files or directories to analyse. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Directories are walked recursively for *.rego files. |
| source | string | — | Inline Rego source to analyse. Mutually exclusive with paths. |
No output schema declared.
No examples provided.
rego_inspect Inspect bundle or policy ~71
Inspect an OPA bundle, policy directory, or single Rego file with `opa inspect`. Returns manifest data, namespaces, rule annotations, and (if signed) signature metadata.
| Name | Type | Req | Description |
|---|---|---|---|
| target | string | yes | Path to a bundle archive (`*.tar.gz`), directory, or single Rego file. |
No output schema declared.
No examples provided.
rego_lint Lint Rego ~289
Lint Rego source with the Regal linter. Returns categorized violations (style, bugs, idiomatic, performance) with file/line locations. Requires `regal` on PATH or `REGAL_BINARY` set; returns REGAL_NOT_FOUND otherwise. When called with inline `source`, location-bound rules whose verdict depends on the on-disk path (`directory-package-mismatch`) are auto-disabled to avoid temp-file false positives, and `location.file` is reported as `<inline>` instead of the randomized temp path. Re-enable those rules via `enable` if your workflow actually needs them.
| Name | Type | Req | Description |
|---|---|---|---|
| configFile | string | — | Path to a Regal config file (defaults to .regal/config.yaml lookup). |
| disable | array | — | Disable specific named rules. |
| disableCategory | array | — | Disable entire rule categories (e.g. style, idiomatic, bugs). |
| enable | array | — | Enable specific named rules. |
| enableCategory | array | — | Enable entire rule categories. |
| failLevel | string | — | Severity at which Regal returns a non-zero exit. Default: `error`. |
| ignoreFiles | array | — | Glob patterns to skip. |
| paths | array | — | Filesystem paths to lint. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). |
| source | string | — | Inline Rego source. Mutually exclusive with `paths`. |
No output schema declared.
No examples provided.
rego_migrate_v1 Migrate Rego to v1 syntax ~208
Migrate Rego v0 source to Rego v1 syntax in two phases: (1) `opa fmt --rego-v1` auto-fixes reserved keywords (`if`, `contains`, `every`, `in` in rule heads) and adds `import rego.v1`; (2) `opa check --v1-compatible` validates the migrated source and reports any remaining issues that cannot be auto-fixed (e.g. removed builtins, semantic conflicts). Returns the migrated source and a `changed` flag even when check finds remaining errors -- this lets you inspect what changed and fix the remainder manually. If the source is completely unparseable, returns `INVALID_REGO`.
| Name | Type | Req | Description |
|---|---|---|---|
| source | string | yes | Rego v0 source to migrate to Rego v1 syntax. `opa fmt --rego-v1` auto-fixes reserved keywords and adds `import rego.v1`; any remaining issues are returned in `errors` so you can resolve them manually. |
No output schema declared.
No examples provided.
rego_parse_ast Parse Rego to AST ~68
Parse Rego source to a JSON AST using `opa parse`. Returns the AST as a tree of nodes (package, imports, rules, expressions, terms). Use this when you need to introspect policy structure programmatically.
| Name | Type | Req | Description |
|---|---|---|---|
| source | string | yes | Rego source code to parse. |
No output schema declared.
No examples provided.
rego_playground_share Share Rego policy as a GitHub Gist ~292
Share a Rego policy with teammates or create a reproducible example by publishing it as a public GitHub Gist. Returns { gistUrl, rawPolicyUrl, id }: the gistUrl renders the policy with syntax highlighting on github.com; the rawPolicyUrl can be passed directly to OPA (`opa eval -d <rawPolicyUrl> <query>`) or used as a data source in Conftest. When query, input, or data are supplied, a metadata.json file is bundled into the Gist so recipients have the full evaluation context to reproduce results. Each call creates a new Gist -- use the returned id to reference it later. Requires GITHUB_TOKEN in the environment (GitHub personal access token with the "gist" scope); returns GITHUB_TOKEN_MISSING with setup instructions if unset.
| Name | Type | Req | Description |
|---|---|---|---|
| data | string | — | Data document as a JSON string. Stored in metadata.json alongside the policy file. |
| description | string | — | Short description for the Gist (shown on github.com/gists). |
| input | string | — | Input document as a JSON string. Stored in metadata.json alongside the policy file. |
| policy | string | yes | Rego source code to share (the contents of a .rego file). |
| query | string | — | Default query to evaluate against the policy, e.g. "data.authz.allow". Stored in metadata.json alongside the policy file. |
No output schema declared.
No examples provided.
rego_policy_diff Diff two Rego policies ~313
Evaluate the same query against two policies (or two versions of the same policy) and compare the results. Both evaluations run in parallel. Returns `equal: true/false`, the raw result from each side, and `changedPaths` -- the dot/bracket paths that differ. Useful for verifying that a refactor preserves behavior, or understanding exactly where two policies diverge. Each side takes either inline source (sourceA/sourceB) or a file/directory path (pathA/pathB). The same input and query are used for both evaluations.
| Name | Type | Req | Description |
|---|---|---|---|
| dataPaths | array | — | Additional data or policy paths loaded for both evaluations. Each must be inside an allowed root. |
| input | — | — | Inline input document (JSON). Mutually exclusive with inputPath. |
| inputPath | string | — | Path to a JSON input file. Must be inside an allowed root. Mutually exclusive with input. |
| pathA | string | — | File or directory path for policy A. Must be inside an allowed root. Mutually exclusive with sourceA. |
| pathB | string | — | File or directory path for policy B. Must be inside an allowed root. Mutually exclusive with sourceB. |
| query | string | yes | The query to evaluate against both policies, e.g. "data.example.allow". |
| sourceA | string | — | Inline Rego source for policy A. Mutually exclusive with pathA. |
| sourceB | string | — | Inline Rego source for policy B. Mutually exclusive with pathB. |
No output schema declared.
No examples provided.
rego_security_audit Rego security audit ~140
Run regal lint restricted to the security and bugs categories across one or more policy directories. Returns findings grouped by severity (high/medium) with remediation guidance. Use this for a periodic fleet-wide security sweep rather than per-file style review. Requires regal.
| Name | Type | Req | Description |
|---|---|---|---|
| configFile | string | — | Path to a Regal config file. Useful when your repo has custom rule configuration. |
| ignoreFiles | array | — | Glob patterns to exclude from the audit. |
| paths | array | yes | Policy directories or files to audit. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Pass the root of your policy fleet to scan everything at once. |
No output schema declared.
No examples provided.
rego_suggest_fix Suggest fix for Rego diagnostics ~87
Map common Rego compile errors and Regal lint findings to mechanical fix suggestions. Pass diagnostics from `rego_check` or `rego_lint`. Returns one suggestion per input diagnostic; confidence is `high` for well-known patterns, `medium` for partial matches, `low` for everything else.
| Name | Type | Req | Description |
|---|---|---|---|
| diagnostics | array | yes | Diagnostics from rego_check or rego_lint. |
No output schema declared.
No examples provided.
rego_test Run Rego tests ~763
Run Rego unit tests with `opa test`. Returns aggregate pass/fail counts plus per-test records. Tests live in `*_test.rego` files; rule names beginning with `test_` are picked up automatically. Use `runPattern` to filter by name regex; when no tests match, the error hint includes the pattern you supplied. Use `threshold` to gate on minimum coverage (returns COVERAGE_BELOW_THRESHOLD on failure). Use `varValues: true` with `verbose: true` to include local variable bindings in the trace -- essential for debugging table-driven tests written with `every tc in cases { ... }` to identify which case caused a failure. When tests use the `test_X[case]` parametrized form, the output includes `parameterizedGroups` mapping each base test name to its case records. Use `ignorePatterns` to exclude generated or fixture files. Use `bundle: true` when testing bundle-structured policy directories. Use `timeout` to raise the per-test limit beyond OPA's default 5s. Note: enabling `coverage` or `threshold` switches OPA to coverage-report output mode -- per-test counts are unavailable but `coverage` and `coveragePct` fields are populated.
| Name | Type | Req | Description |
|---|---|---|---|
| bundle | boolean | — | Load paths as OPA bundle roots (`--bundle`). Required when testing policies structured as bundles with a `manifest.json` at the root. Not needed for plain policy directories. |
| count | integer | — | Number of times to repeat each test (`--count N`). Default is 1. Useful for measuring repeatability or catching flaky tests under load. |
| coverage | boolean | — | Include per-line coverage data. Switches output to coverage-report mode: test record counts are not available, but `coverage` and `coveragePct` fields are populated. |
| explain | string | — | Add a query-explanation trace to test records (`--explain`). `fails` traces only failing tests, `full` traces everything, `notes` surfaces `trace()` notes, `debug` is most verbose. Populates each rec… |
| ignorePatterns | array | — | Glob patterns for files to exclude from the test run (`--ignore <pattern>`). Pass one pattern per array element. Useful for excluding generated or fixture files that contain no tests (e.g. `["*_gener… |
| paths | array | yes | Test directories or files. `opa test` looks for `*_test.rego` siblings of source files. |
| runPattern | string | — | Run only tests whose names match this regular expression (passed as `--run`). |
| threshold | number | — | Minimum coverage percentage required (0–100). Returns COVERAGE_BELOW_THRESHOLD when actual coverage falls below this value. Implicitly enables coverage-report output mode. |
| timeout | string | — | Per-test timeout as a Go duration string, e.g. `"30s"` or `"2m"` (`--timeout`). OPA's default is 5s. Increase for tests that load large policy sets or call slow built-ins. |
| v1Compatible | boolean | — | Opt in to OPA v1.0-compatible behaviors (`--v1-compatible`). |
| varValues | boolean | — | Include local variable bindings in trace output (`--var-values`). When a table-driven test using `every tc in cases { ... }` fails, the trace shows which `tc` triggered the failure. Has no effect unl… |
| verbose | boolean | — | Emit per-test pass/fail details. |
No output schema declared.
No examples provided.