Authoring and static analysis
Format, check, lint, parse, inspect, and analyze dependencies in Rego source without a running OPA server. Wraps opa fmt, opa check, opa parse, opa inspect, opa deps, and the Regal linter.
OPA MCP is an open-source Model Context Protocol server that gives Claude, Cursor, VS Code, and any other MCP-compatible client a structured interface to Open Policy Agent and Regal. Instead of parsing CLI output, your AI agent calls 50 schema-validated tools with stable error codes and gets structured results it can reason about.
What it gives you
OPA MCP wraps the OPA CLI and REST API into a tool surface designed for how AI agents actually work. Every tool returns a structured JSON envelope with stable error codes, so the agent gets readable results rather than raw CLI output to parse.
Format, check, lint, parse, inspect, and analyze dependencies in Rego source without a running OPA server. Wraps opa fmt, opa check, opa parse, opa inspect, opa deps, and the Regal linter.
Evaluate queries against policies and inputs with optional explain traces, profiling data, and per-line coverage. Run the full opa test suite or benchmark hot rules. All results are structured JSON, not terminal output.
rego_explain_decision walks through every rule that fired and every rule that did not. rego_verify formally verifies Rego rule invariants using Z3 SMT solving via WASM, no additional install required. rego_explain_undefined diagnoses why a fully-qualified Rego query produces no value. rego_generate_test_skeleton builds a test file from a policy. rego_infer_input_schema statically derives the JSON Schema for every input field a policy reads. rego_policy_diff compares two policies side by side.
List, get, put, and delete policies on a running OPA server through its REST API. Read and write data paths, POST to decision endpoints, and check health and bundle status. Works against a local dev server or a production deployment with bearer-token auth.
Install
Drop-in example configs are included for Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Zed, and Docker. The Docker image is multi-arch (amd64 and arm64) and bundles pinned versions of OPA and Regal so nothing needs to be installed on the host.
Register with one command via claude mcp add or drop the example JSON config into your client's MCP settings. Requires Node.js 20 or later and the OPA binary on PATH or via the OPA_BINARY env var.
The multi-arch image bundles OPA and Regal and runs as a non-root user. No host install of OPA or Regal required. Point any MCP client at it using the Docker example config.
Install via npx -y @smithery/cli install @orygn/opa-mcp --client claude. Smithery handles the config file automatically. Listed in the Smithery registry under @orygn/opa-mcp.
Download the signed opa-mcp.mcpb bundle from the latest release and double-click to install directly into Claude Desktop. Bundles OPA and Regal, no PATH configuration needed.
Distribution
OPA MCP is available everywhere policy engineers and security teams expect to find tooling. The npm package ships with provenance attestations. The Docker image is reproducibly built from the committed Dockerfile.
Built with
The server communicates over stdio and never writes to stdout, reserving that channel for the MCP protocol. Subprocesses run with shell disabled and hard timeouts. CI tests across Ubuntu, macOS, and Windows on Node 20, 22, and 24.
FAQ
Built by Orygn
Orygn builds custom software, security tooling, and infrastructure-level systems for teams that need them production-grade from day one. OPA MCP came out of the same kind of work, applied directly to the policy-as-code workflows security and platform engineers run every day.
Work with Orygn