ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

OPA MCP

โดย OrygnsCodeรุ่น 0.9.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.OrygnsCode/opa-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

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

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ
  • ต้องใส่ค่าเหล่านี้: OPA_TOKEN, GITHUB_TOKEN

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: OPA_URL, OPA_TOKEN, OPA_BINARY, REGAL_BINARY, CONFTEST_BINARY, OPA_MCP_ALLOWED_PATHS, GITHUB_TOKEN

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "opa": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "ใส่ค่าของคุณ",
        "OPA_TOKEN": "ใส่ค่าของคุณ",
        "OPA_BINARY": "ใส่ค่าของคุณ",
        "REGAL_BINARY": "ใส่ค่าของคุณ",
        "CONFTEST_BINARY": "ใส่ค่าของคุณ",
        "OPA_MCP_ALLOWED_PATHS": "ใส่ค่าของคุณ",
        "GITHUB_TOKEN": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add opa --env OPA_URL='ใส่ค่าของคุณ' --env OPA_TOKEN='ใส่ค่าของคุณ' --env OPA_BINARY='ใส่ค่าของคุณ' --env REGAL_BINARY='ใส่ค่าของคุณ' --env CONFTEST_BINARY='ใส่ค่าของคุณ' --env OPA_MCP_ALLOWED_PATHS='ใส่ค่าของคุณ' --env GITHUB_TOKEN='ใส่ค่าของคุณ' -- npx -y @orygn/opa-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "opa": {
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "ใส่ค่าของคุณ",
        "OPA_TOKEN": "ใส่ค่าของคุณ",
        "OPA_BINARY": "ใส่ค่าของคุณ",
        "REGAL_BINARY": "ใส่ค่าของคุณ",
        "CONFTEST_BINARY": "ใส่ค่าของคุณ",
        "OPA_MCP_ALLOWED_PATHS": "ใส่ค่าของคุณ",
        "GITHUB_TOKEN": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "opa": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@orygn/opa-mcp"
      ],
      "env": {
        "OPA_URL": "ใส่ค่าของคุณ",
        "OPA_TOKEN": "ใส่ค่าของคุณ",
        "OPA_BINARY": "ใส่ค่าของคุณ",
        "REGAL_BINARY": "ใส่ค่าของคุณ",
        "CONFTEST_BINARY": "ใส่ค่าของคุณ",
        "OPA_MCP_ALLOWED_PATHS": "ใส่ค่าของคุณ",
        "GITHUB_TOKEN": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • OPA_URL env
    Base URL of a running OPA server. Required only for opa_* runtime tools, not for rego_* language tools.
  • OPA_TOKEN ความลับ env
    Bearer token for OPA running with --authentication=token.
  • OPA_BINARY env
    Path to the opa binary. Defaults to 'opa' on PATH.
  • REGAL_BINARY env
    Path to the regal binary (optional; used by rego_lint, rego_security_audit and rego_fix). Defaults to 'regal' on PATH.
  • CONFTEST_BINARY env
    Path to the conftest binary (optional, used by conftest_* tools). Defaults to 'conftest' on PATH.
  • OPA_MCP_ALLOWED_PATHS env
    Comma-separated list of root directories tools may read/write. When unset, file-based tools refuse to access the disk.
  • GITHUB_TOKEN ความลับ env
    GitHub personal access token with the "gist" scope. Required only for rego_playground_share.

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub OrygnsCode ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 32558 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 73% ของอีก 32558 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 32558 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

OPA MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: OPA_TOKEN, GITHUB_TOKEN

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.9.1) เข้า registry 14 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js, Docker ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, FactLot

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

โดย formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

รันบนเครื่อง★ 440MITอัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

Remote Desktop Commander

โดย desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

รันบนคลาวด์★ 211อัปเดต เมื่อวาน
ติดตั้ง

FactLot

โดย 9mp96ygnbk-alt

Cited CRE facts and deterministic calculators for agents: rent, CAM, debt sizing, IRR, parcel IDs.

บนเครื่องหรือคลาวด์อัปเดต วันนี้
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

OPA MCP Server

A Model Context Protocol (MCP) server that turns any MCP-compatible client (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Zed, and others) into a first-class Open Policy Agent and Rego authoring environment.

+--------------------+ MCP/stdio  +-----------------+ spawn/HTTP +---------------------+

| Claude · Cursor · |----------> | @orygn/opa-mcp |----------> | opa · regal | | VS Code · ... |<---------- | |<---------- | conftest · REST API | +--------------------+ 52 tools +-----------------+ +---------------------+

Status: v0.9.1. Tool surface, error codes, and

environment variables follow SemVer from

v0.1.0 forward.

Upgrading to 0.9.0: a tool refuses an argument it does not declare,

and the error names it; it used to be dropped. A policy or query that does

not compile is INVALID_REGO in every tool that runs opa, where several

returned EVAL_ERROR. rego_explain_decision returns the trace as

readable lines, not OPA's raw events. conftest_test reports a run that

evaluated no rule as passed: false, and rego_generate_test_skeleton

writes todo_test_ stubs, which opa test skips until they are filled in.

Responses are compact JSON.

Upgrading to 0.8.0: opa_exec loads dataPaths as opa eval --data

does, so a directory that also holds test fixtures, or JSON and YAML that

is not data, can now fail to load; pass it as bundle to load it as

before. A policy that does not load is INVALID_REGO in opa_exec and

the conftest tools, where it was EVAL_ERROR and UNKNOWN_ERROR.

Upgrading to 0.7.0: Node.js 22 or later is required. The bundled OPA

is 1.21, which reads YAML against the 1.2 schema: bare yes, no, on

and off in data files are strings now, not booleans. If you supply your

own binary via OPA_BINARY or PATH, only the Node requirement applies.

Upgrading to 0.6.0: rego_bench reports iterations, nsPerOp,

allocsPerOp and bytesPerOp. The fields opa prints (N, T, Bytes,

MemAllocs, MemBytes, Extra) were top-level and now sit under raw

for a single run, so anything that read them from the top level has to

look there. With count above one, raw is omitted: every document is in

runs, and fastest indexes the one the top-level figures come from.

Upgrading to 0.4.0: subprocesses no longer inherit the server's

environment. A policy that read a variable through opa.runtime().env

will no longer see it; name the variable in OPA_MCP_PASSTHROUGH_ENV if

it is genuinely needed. See the security section for why.

Upgrading to 0.3.0: the bundled OPA is now 1.19, so Rego v0 policies

no longer parse (if is required before a rule body, contains before a

partial set). Run rego_migrate_v1 to convert them, or pass

v0Compatible: true to load one as it is. If you supply your own binary via

OPA_BINARY or PATH, nothing changes.


Table of contents

  • What you can do with it
  • Why this MCP
  • Install
  • Configuration
  • Tool reference
  • Prompts
  • Resources
  • Cookbook
  • Architecture
  • Security
  • Troubleshooting
  • Development
  • Versioning & support
  • License

What you can do with it

Once an MCP client is connected, an agent can:

  • Author Rego. Generate, format, and refactor policies. The server runs the real opa fmt and opa parse so output is byte-identical to what you'd get on the command line, and regal (optional) surfaces idiomatic suggestions.
  • Evaluate against data. Run a query against a policy and an input document. Optional --explain, --profile, and --coverage flags surface execution traces, hot rules, and per-line coverage.
  • Debug a deny. rego_explain_decision walks the agent through every rule that fired (and every one that didn't), so it can answer "why was this rejected" without you reading the trace by hand.
  • Manage policies on a running OPA. List, get, put, delete policies on an OPA server through its REST API. Works against a local opa run --server or a production deployment with bearer-token auth.
  • Build & sign bundles. Package a directory of policies into a deployable bundle, optionally signing it. Output is a regular .tar.gz the agent can hand to your delivery system.
  • Lint. rego_lint runs Regal across a directory or a single file and returns each finding with its category, level and location.

A walk-through of a typical session lives in Cookbook.

Why this MCP

OPA already has a perfectly good CLI and REST API. So why an MCP wrapper?

  • Schema-shaped tool surface. An agent calling rego_eval gets a validated input schema, a structured output envelope, and stable error codes, instead of parsing free-form CLI text and inventing its own failure taxonomy. That alone makes Rego usable to an agent the way a language server makes a language usable to an IDE.
  • Higher-level helpers. rego_explain_decision, rego_generate_test_skeleton, rego_describe_policy, and rego_suggest_fix compose the lower-level primitives into the tasks agents are actually asked to do. They don't exist in the OPA CLI.
  • Curated knowledge. The bundled MCP resources expose the OPA built-in function catalog, the official Rego style guide (formatted for LLMs), and a curated pattern library covering RBAC, ABAC, Kubernetes admission, IaC gates, API authz, and rate limiting, so the agent has authoritative context without needing to scrape it.
  • Safety boundaries the agent can rely on. Path allow-list, subprocess timeouts, and response-size caps. Defaults are conservative; running the server doesn't quietly grant the agent more reach than the operator intended.

If you've ever watched an agent fight opa eval's argument order, you'll recognize the gap this fills.

Install

The server runs locally over stdio. Pick the install path that matches your client.

Claude Desktop

Edit claude_desktop_config.json directly (or copy from examples/claude-desktop.json):

{

"mcpServers": { "opa": { "command": "npx", "args": ["-y", "@orygn/opa-mcp"], "env": { "OPA_BINARY": "/usr/local/bin/opa", "REGAL_BINARY": "/usr/local/bin/regal", "OPA_URL": "http://localhost:8181", "OPA_MCP_ALLOWED_PATHS": "/path/to/your/policies" } } } }

Replace the /usr/local/bin/... paths with your real ones. See the

first-time install gotcha

below. Windows users substitute C:\\path\\to\\opa.exe.

Or download opa-mcp.mcpb from the latest release and double-click it.

Claude Code (CLI)

Register the server for the current project with claude mcp add:

claude mcp add \

--env OPA_BINARY=/usr/local/bin/opa \ --env REGAL_BINARY=/usr/local/bin/regal \ --env OPA_MCP_ALLOWED_PATHS=/path/to/your/policies \ opa -- npx -y @orygn/opa-mcp

This writes the config into .mcp.json at your project root and is picked up automatically on every claude session in that directory. Add --scope user to register it globally instead.

Replace the paths with your real absolute paths (same caveat as

Claude Desktop above). On Windows use C:\path\to\opa.exe syntax.

Persistent context and auto-checks for policy repos. If you work in an OPA policy repo regularly, two extra files remove repetitive setup from every session:

  • examples/CLAUDE.md -- copy to your repo root or .claude/CLAUDE.md. Claude Code loads it every session, so the agent always knows which tools to use and what conventions apply.
  • examples/claude-code-hook.json -- merge the hooks block into .claude/settings.json. Runs opa check after Claude writes or edits a .rego file and hands any error back to Claude, without a manual tool call.
Cursor

Drop examples/cursor.json into either .cursor/mcp.json (project-scoped) or ~/.cursor/mcp.json (user-scoped).

VS Code (GitHub Copilot Chat)

Drop examples/vscode.json into .vscode/mcp.json, or paste the servers block into your user settings.json under mcp.servers.

Windsurf, Zed, and others

See examples/ for a full set of drop-in configs.

Manual install (any MCP client)
npm install -g @orygn/opa-mcp

opa-mcp --version

then point your client at the opa-mcp binary.

Docker
docker pull orygn/opa-mcp:latest

docker run --rm -i \ -v /path/to/your/policies:/policies:ro \ -e OPA_MCP_ALLOWED_PATHS=/policies \ orygn/opa-mcp

The image is multi-arch (linux/amd64, linux/arm64), bundles pinned versions of opa and regal, and runs as a non-root user. No host install of OPA or Regal is required.

⚠ If every tool call returns OPA_BINARY_NOT_FOUND

The npm package carries its own opa for the five platforms it is built for, so a client PATH without opa on it does not matter there. The MCPB has no bundled copy, and on any other platform neither does npm: then the server boots but every tool call returns OPA_BINARY_NOT_FOUND. Neither the npm package nor the MCPB bundles regal or conftest, and the Docker image ships regal but not conftest, so their tools need a PATH entry or an explicit path either way.

Fix: add OPA_BINARY and REGAL_BINARY env entries to your client config with the absolute path to each binary. The example configs under examples/ ship with placeholder paths you replace. Find the real paths with:

which opa && which regal                                    # macOS / Linux
Get-Command opa, regal | Select-Object Source              # Windows

This does not affect the Docker install path, which ships opa and regal in the image and bypasses PATH entirely. The MCPB bundle carries neither, and unlike the npm install has no bundled fallback: set OPA_BINARY or put opa on PATH. See Troubleshooting for full detail.

Configuration

The server reads its configuration from environment variables. Every variable is optional; defaults are sensible for a local OPA on http://localhost:8181.

| Variable | Default | Purpose

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx