PluginBench
MCP Server
Active
MIT

OPA MCP MCP Server

io.github.OrygnsCode/opa-mcp

What is the OPA MCP MCP server?

Author, validate, debug, and explain OPA Rego policies through any MCP-compatible client.

How to install OPA MCP

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • OPA_URL

    Base URL of a running OPA server. Required only for opa_* runtime tools, not for rego_* language tools.

  • OPA_TOKEN
    secret

    Bearer token for OPA running with --authentication=token.

  • OPA_BINARY

    Path to the opa binary. Defaults to 'opa' on PATH.

  • REGAL_BINARY

    Path to the regal binary (optional, used by rego_lint). Defaults to 'regal' on PATH.

  • CONFTEST_BINARY

    Path to the conftest binary (optional, used by conftest_* tools). Defaults to 'conftest' on PATH.

  • OPA_MCP_ALLOWED_PATHS

    Comma-separated list of root directories tools may read/write. When unset, file-based tools refuse to access the disk.

  • GITHUB_TOKEN
    secret

    GitHub personal access token with the "gist" scope. Required only for rego_playground_share.

Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "<YOUR_OPA_URL>",
        "OPA_TOKEN": "<YOUR_OPA_TOKEN>",
        "OPA_BINARY": "<YOUR_OPA_BINARY>",
        "REGAL_BINARY": "<YOUR_REGAL_BINARY>",
        "CONFTEST_BINARY": "<YOUR_CONFTEST_BINARY>",
        "OPA_MCP_ALLOWED_PATHS": "<YOUR_OPA_MCP_ALLOWED_PATHS>",
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
Cursor
~/.cursor/mcp.json
{
  "mcpServers": {
    "opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "<YOUR_OPA_URL>",
        "OPA_TOKEN": "<YOUR_OPA_TOKEN>",
        "OPA_BINARY": "<YOUR_OPA_BINARY>",
        "REGAL_BINARY": "<YOUR_REGAL_BINARY>",
        "CONFTEST_BINARY": "<YOUR_CONFTEST_BINARY>",
        "OPA_MCP_ALLOWED_PATHS": "<YOUR_OPA_MCP_ALLOWED_PATHS>",
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
Windsurf
~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "opa-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "<YOUR_OPA_URL>",
        "OPA_TOKEN": "<YOUR_OPA_TOKEN>",
        "OPA_BINARY": "<YOUR_OPA_BINARY>",
        "REGAL_BINARY": "<YOUR_REGAL_BINARY>",
        "CONFTEST_BINARY": "<YOUR_CONFTEST_BINARY>",
        "OPA_MCP_ALLOWED_PATHS": "<YOUR_OPA_MCP_ALLOWED_PATHS>",
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
VS Code
.vscode/mcp.json
{
  "servers": {
    "opa-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "<YOUR_OPA_URL>",
        "OPA_TOKEN": "<YOUR_OPA_TOKEN>",
        "OPA_BINARY": "<YOUR_OPA_BINARY>",
        "REGAL_BINARY": "<YOUR_REGAL_BINARY>",
        "CONFTEST_BINARY": "<YOUR_CONFTEST_BINARY>",
        "OPA_MCP_ALLOWED_PATHS": "<YOUR_OPA_MCP_ALLOWED_PATHS>",
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
Claude Code
claude mcp add opa-mcp --env OPA_URL=<YOUR_OPA_URL> --env OPA_TOKEN=<YOUR_OPA_TOKEN> --env OPA_BINARY=<YOUR_OPA_BINARY> --env REGAL_BINARY=<YOUR_REGAL_BINARY> --env CONFTEST_BINARY=<YOUR_CONFTEST_BINARY> --env OPA_MCP_ALLOWED_PATHS=<YOUR_OPA_MCP_ALLOWED_PATHS> --env GITHUB_TOKEN=<YOUR_GITHUB_TOKEN> -- npx -y @orygn/opa-mcp

Related MCP servers

Your AI runs your Discord server: chat, moderation, admin, even building it all from one brief.

1
TypeScript
View repository →
OPA MCP MCP Server | PluginBench