Opa MCP Server logo

Opa MCP Server

by OrygnsCode

MCP tools for authoring, testing, evaluating, linting, and operating Open Policy Agent and Rego policies.

Install Opa MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "orygnscode-opa-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio orygnscode-opa-mcp-server -- npx -y @orygn/opa-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y @orygn/opa-mcp

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

OrygnsCode/opa-mcp-server exposes OPA and Rego workflows through MCP, covering policy authoring, validation, testing, evaluation, benchmarking, bundle handling, and OPA REST operations. It invokes the OPA CLI, optionally uses Regal for linting, and can query or mutate a running OPA instance over HTTP. Reach for it when an MCP-compatible coding agent needs structured policy diagnostics, decision traces, coverage data, or repeatable policy checks instead of parsing command-line output.

Use cases

  • Format and validate Rego policies in an agent-assisted workflow
  • Run policy tests with coverage thresholds and filtered cases
  • Trace why an OPA decision allowed or denied an input
  • Build, sign, and verify deployable policy bundles
  • Manage policies and data on a running OPA server

Key features

  • OPA CLI and REST API access over MCP
  • Regal linting with structured findings
  • Decision traces, profiling, and coverage reports
  • Rego v0-to-v1 migration support
  • Bundle build, signing, and verification
  • Multi-root policy test aggregation

Tools52

What Opa MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~17.0k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/26 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · @orygn/opa-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars9Stargazers on the source repository.
npm downloads1.1kPackage downloads in the last 30 days.
Last commit4d agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed52Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Opa MCP Server works

What OrygnsCode/opa-mcp-server does

OrygnsCode/opa-mcp-server connects MCP clients to Open Policy Agent (OPA), Rego policy files, the Regal linter, and a running OPA server. Its tools cover the policy lifecycle: formatting and type-checking source, validating input references against JSON Schema, inspecting syntax trees and bundles, analyzing dependencies, migrating Rego v0 to v1, evaluating decisions, running tests, measuring coverage and performance, and compiling partial queries.

It also handles bundle delivery and OPA administration. Policies can be built, signed, and verified; policies and data can be listed, retrieved, uploaded, changed, or deleted through OPA's REST API; and decisions can be evaluated against the server's data hierarchy.

How it works

The server runs locally over MCP stdio. CLI-oriented tools invoke OPA commands such as fmt, check, eval, test, bench, build, parse, inspect, and exec. Regal is invoked for linting when its executable is available. REST-oriented tools send requests to a configured OPA HTTP endpoint.

Responses use structured JSON rather than requiring an agent to interpret terminal text. Depending on the operation, results include diagnostics with file and line locations, evaluation results, execution traces, coverage information, benchmark statistics, test counts, or bundle verification details. Evaluation variants expose full traces, rule profiles, or per-line coverage. Multi-root testing runs OPA separately for independent policy namespaces and aggregates the results.

Setup and configuration

The package is available through npm as @orygn/opa-mcp; a typical client starts it with npx -y @orygn/opa-mcp. It can also be installed through the downloadable MCP bundle. The server requires Node.js 22 or later. Configure the OPA executable with OPA_BINARY when using a custom installation, and set REGAL_BINARY when Regal is not available on PATH. OPA_URL selects the OPA server used by REST tools, while OPA_MCP_ALLOWED_PATHS limits filesystem access to approved policy locations.

Claude Desktop and Claude Code examples use absolute executable and policy paths. The server can connect to a local opa run --server process or an OPA deployment using bearer-token authentication.

Tools and capabilities

  • Format, parse, type-check, lint, inspect, and migrate Rego source.
  • Validate input references against inline or file-based JSON Schema.
  • Evaluate, explain, profile, benchmark, and measure coverage for policy queries.
  • Run filtered tests, coverage gates, parameterized cases, fixtures, and multi-root suites.
  • Build, sign, and verify deployable OPA bundles.
  • Execute decisions across multiple input files with CI-style failure gates.
  • Manage OPA policies and data, then query decisions through the REST API.

Limitations and notes

Regal-dependent linting returns an error when its executable cannot be found. Formatting Rego containing string interpolation is guarded when OPA 1.12.0 or 1.12.1 is detected because those versions can corrupt escaped sequences; OPA 1.12.2 fixes that issue. Response-size limits affect large capability, policy, AST, and coverage responses. OPA's root data document cannot be deleted through the delete-data tool, and signed archives must be produced through bundle building rather than signing an archive in place.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Opa MCP Server

OrygnsCode/opa-mcp-server is an MCP server that connects AI clients to Open Policy Agent, Rego policies, Regal, and a running OPA REST API. Its main tools format, check, lint, evaluate, test, benchmark, inspect, migrate, build bundles, manage policies and data, and query decisions.

Install it by starting `npx -y @orygn/opa-mcp` from your MCP client configuration, or download the MCP bundle from the latest project release. The server runs locally over stdio and requires Node.js 22 or later.

Yes, OrygnsCode/opa-mcp-server works with Cursor. The project also names Claude Desktop, Claude Code, VS Code, Windsurf, and Zed as compatible MCP clients.

Set `OPA_URL` to the running OPA server's HTTP address, then use the policy, data, and decision tools that operate through OPA's REST API. The server supports local `opa run --server` instances and deployments using bearer-token authentication.

Call `rego_lint` with Rego source or policy paths and ensure Regal is on `PATH` or configured through `REGAL_BINARY`. Results include categorized violations and file or line locations; unavailable Regal produces `REGAL_NOT_FOUND`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOpa MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/orygnscode-opa-mcp-server?style=directory)](https://allmcps.com/mcp/orygnscode-opa-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/orygnscode-opa-mcp-server"><img src="https://allmcps.com/api/badge/orygnscode-opa-mcp-server?style=directory" alt="Opa MCP Server on AllMCPs" /></a>