Rego语言服务器

OPA MCP是一个为Rego语言提供语言服务器功能的工具,支持查询定义、诊断和文档显示等功能。

  • by mheers
  • Open Policy Agent
  • 本地部署
  • 更新于
在 GitHub 查看 mheers/opa-mcp

使用说明

OPA MCP

Exposes a rego language server for MCP

Pre-requisites

Install mcp language server:

go install github.com/isaacphi/mcp-language-server@latest

Install regal from github.com/StyraInc/regal

Demo queries

  • whats the definition of amount_allowed?
  • give me diagnostics of the simple.rego file
  • display the metadata and documentation of amount_allowed

Problems

  • rename all symbols from "allow" to "allowed"
    • method not supported: textDocument/references (code: -32601)
  • give me all references of the "user" function
    • method not supported: textDocument/references (code: -32601)