O

Opa MCP

by OrygnsCode · io.github.OrygnsCode/opa-mcp

MCP server for Open Policy Agent (OPA) and the Rego policy language. Wraps the OPA CLI and Regal linter with 50+ tools for authoring, evaluating, and debugging Rego policies through any MCP-compatible client.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-orygnscode-opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "http://localhost:8181",
        "OPA_TOKEN": "<YOUR_VALUE>",
        "OPA_BINARY": "opa",
        "REGAL_BINARY": "regal",
        "CONFTEST_BINARY": "conftest",
        "OPA_MCP_ALLOWED_PATHS": "<VALUE>",
        "GITHUB_TOKEN": "<YOUR_VALUE>",
        "OPA_MCP_LOG_FILE": "<tmpdir>/orygn-opa-mcp.log",
        "OPA_MCP_LOG_LEVEL": "info",
        "OPA_MCP_TIMEOUT_MS": "30000",
        "OPA_MCP_HTTP_TIMEOUT_MS": "15000",
        "OPA_MCP_MAX_RESPONSE_BYTES": "100000"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
OPA_URL No Base URL of an OPA REST endpoint, used by opa_* tools. Default: http://localhost:8181
OPA_TOKEN secret No Bearer token for OPA, if your instance requires auth. Treated as a secret. Never echoed in logs or tool responses.
OPA_BINARY No Path to the opa CLI, used by rego_* tools. Default: opa
REGAL_BINARY No Path to the regal linter. Only required by rego_lint. Default: regal
CONFTEST_BINARY No Path to the conftest binary (optional, used by conftest_* tools). Defaults to 'conftest' on PATH. Default: conftest
OPA_MCP_ALLOWED_PATHS No Comma- or semicolon-separated list of directories the server is allowed to read policies from. When unset, file-based tools refuse to read from disk.
GITHUB_TOKEN secret No GitHub personal access token with the "gist" scope. Required only for rego_playground_share.
OPA_MCP_LOG_FILE No Path the server appends logs to. The server never writes to stdout; that channel is reserved for the MCP protocol. Default: <tmpdir>/orygn-opa-mcp.log
OPA_MCP_LOG_LEVEL No One of debug, info, warn, error. Default: info
OPA_MCP_TIMEOUT_MS No Hard timeout for any spawned subprocess (opa, regal). After this, the child gets SIGTERM and then SIGKILL. Default: 30000
OPA_MCP_HTTP_TIMEOUT_MS No Timeout for HTTP requests to the OPA REST API. Default: 15000
OPA_MCP_MAX_RESPONSE_BYTES No Hard cap on a single tool response. Larger payloads are truncated with a __truncated: true marker. Default: 100000

Similar servers