@orygn/opa-mcp 0.0.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +150 -0
- package/LICENSE +21 -0
- package/README.md +622 -2
- package/dist/config.d.ts +58 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +72 -0
- package/dist/config.js.map +1 -0
- package/dist/lib/errors.d.ts +18 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +25 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/logger.d.ts +10 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +57 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/opa-cli.d.ts +226 -0
- package/dist/lib/opa-cli.d.ts.map +1 -0
- package/dist/lib/opa-cli.js +283 -0
- package/dist/lib/opa-cli.js.map +1 -0
- package/dist/lib/opa-client.d.ts +47 -0
- package/dist/lib/opa-client.d.ts.map +1 -0
- package/dist/lib/opa-client.js +101 -0
- package/dist/lib/opa-client.js.map +1 -0
- package/dist/lib/output.d.ts +17 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +21 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/regal-cli.d.ts +79 -0
- package/dist/lib/regal-cli.d.ts.map +1 -0
- package/dist/lib/regal-cli.js +122 -0
- package/dist/lib/regal-cli.js.map +1 -0
- package/dist/lib/security.d.ts +16 -0
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +64 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/subprocess.d.ts +26 -0
- package/dist/lib/subprocess.d.ts.map +1 -0
- package/dist/lib/subprocess.js +72 -0
- package/dist/lib/subprocess.js.map +1 -0
- package/dist/lib/tool-helpers.d.ts +46 -0
- package/dist/lib/tool-helpers.d.ts.map +1 -0
- package/dist/lib/tool-helpers.js +73 -0
- package/dist/lib/tool-helpers.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +147 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +107 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/patterns.d.ts +9 -0
- package/dist/resources/patterns.d.ts.map +1 -0
- package/dist/resources/patterns.js +375 -0
- package/dist/resources/patterns.js.map +1 -0
- package/dist/resources/style-guide.d.ts +6 -0
- package/dist/resources/style-guide.d.ts.map +1 -0
- package/dist/resources/style-guide.js +187 -0
- package/dist/resources/style-guide.js.map +1 -0
- package/dist/server.d.ts +34 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +125 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/authoring/capabilities.d.ts +11 -0
- package/dist/tools/authoring/capabilities.d.ts.map +1 -0
- package/dist/tools/authoring/capabilities.js +57 -0
- package/dist/tools/authoring/capabilities.js.map +1 -0
- package/dist/tools/authoring/check.d.ts +18 -0
- package/dist/tools/authoring/check.d.ts.map +1 -0
- package/dist/tools/authoring/check.js +71 -0
- package/dist/tools/authoring/check.js.map +1 -0
- package/dist/tools/authoring/deps.d.ts +8 -0
- package/dist/tools/authoring/deps.d.ts.map +1 -0
- package/dist/tools/authoring/deps.js +51 -0
- package/dist/tools/authoring/deps.js.map +1 -0
- package/dist/tools/authoring/format.d.ts +8 -0
- package/dist/tools/authoring/format.d.ts.map +1 -0
- package/dist/tools/authoring/format.js +44 -0
- package/dist/tools/authoring/format.js.map +1 -0
- package/dist/tools/authoring/index.d.ts +11 -0
- package/dist/tools/authoring/index.d.ts.map +1 -0
- package/dist/tools/authoring/index.js +17 -0
- package/dist/tools/authoring/index.js.map +1 -0
- package/dist/tools/authoring/inspect.d.ts +10 -0
- package/dist/tools/authoring/inspect.d.ts.map +1 -0
- package/dist/tools/authoring/inspect.js +47 -0
- package/dist/tools/authoring/inspect.js.map +1 -0
- package/dist/tools/authoring/lint.d.ts +18 -0
- package/dist/tools/authoring/lint.d.ts.map +1 -0
- package/dist/tools/authoring/lint.js +111 -0
- package/dist/tools/authoring/lint.js.map +1 -0
- package/dist/tools/authoring/parse.d.ts +7 -0
- package/dist/tools/authoring/parse.d.ts.map +1 -0
- package/dist/tools/authoring/parse.js +43 -0
- package/dist/tools/authoring/parse.js.map +1 -0
- package/dist/tools/bundles/build.d.ts +8 -0
- package/dist/tools/bundles/build.d.ts.map +1 -0
- package/dist/tools/bundles/build.js +87 -0
- package/dist/tools/bundles/build.js.map +1 -0
- package/dist/tools/bundles/index.d.ts +10 -0
- package/dist/tools/bundles/index.d.ts.map +1 -0
- package/dist/tools/bundles/index.js +7 -0
- package/dist/tools/bundles/index.js.map +1 -0
- package/dist/tools/bundles/sign.d.ts +8 -0
- package/dist/tools/bundles/sign.d.ts.map +1 -0
- package/dist/tools/bundles/sign.js +47 -0
- package/dist/tools/bundles/sign.js.map +1 -0
- package/dist/tools/evaluation/_shared.d.ts +55 -0
- package/dist/tools/evaluation/_shared.d.ts.map +1 -0
- package/dist/tools/evaluation/_shared.js +102 -0
- package/dist/tools/evaluation/_shared.js.map +1 -0
- package/dist/tools/evaluation/bench.d.ts +9 -0
- package/dist/tools/evaluation/bench.d.ts.map +1 -0
- package/dist/tools/evaluation/bench.js +76 -0
- package/dist/tools/evaluation/bench.js.map +1 -0
- package/dist/tools/evaluation/compile.d.ts +11 -0
- package/dist/tools/evaluation/compile.d.ts.map +1 -0
- package/dist/tools/evaluation/compile.js +19 -0
- package/dist/tools/evaluation/compile.js.map +1 -0
- package/dist/tools/evaluation/eval.d.ts +10 -0
- package/dist/tools/evaluation/eval.d.ts.map +1 -0
- package/dist/tools/evaluation/eval.js +35 -0
- package/dist/tools/evaluation/eval.js.map +1 -0
- package/dist/tools/evaluation/index.d.ts +11 -0
- package/dist/tools/evaluation/index.d.ts.map +1 -0
- package/dist/tools/evaluation/index.js +11 -0
- package/dist/tools/evaluation/index.js.map +1 -0
- package/dist/tools/evaluation/test.d.ts +28 -0
- package/dist/tools/evaluation/test.d.ts.map +1 -0
- package/dist/tools/evaluation/test.js +74 -0
- package/dist/tools/evaluation/test.js.map +1 -0
- package/dist/tools/helpers/describe-policy.d.ts +26 -0
- package/dist/tools/helpers/describe-policy.d.ts.map +1 -0
- package/dist/tools/helpers/describe-policy.js +76 -0
- package/dist/tools/helpers/describe-policy.js.map +1 -0
- package/dist/tools/helpers/explain-decision.d.ts +41 -0
- package/dist/tools/helpers/explain-decision.d.ts.map +1 -0
- package/dist/tools/helpers/explain-decision.js +75 -0
- package/dist/tools/helpers/explain-decision.js.map +1 -0
- package/dist/tools/helpers/generate-test-skeleton.d.ts +8 -0
- package/dist/tools/helpers/generate-test-skeleton.d.ts.map +1 -0
- package/dist/tools/helpers/generate-test-skeleton.js +93 -0
- package/dist/tools/helpers/generate-test-skeleton.js.map +1 -0
- package/dist/tools/helpers/index.d.ts +12 -0
- package/dist/tools/helpers/index.d.ts.map +1 -0
- package/dist/tools/helpers/index.js +11 -0
- package/dist/tools/helpers/index.js.map +1 -0
- package/dist/tools/helpers/suggest-fix.d.ts +15 -0
- package/dist/tools/helpers/suggest-fix.d.ts.map +1 -0
- package/dist/tools/helpers/suggest-fix.js +119 -0
- package/dist/tools/helpers/suggest-fix.js.map +1 -0
- package/dist/tools/index.d.ts +31 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/server-management/_shared.d.ts +9 -0
- package/dist/tools/server-management/_shared.d.ts.map +1 -0
- package/dist/tools/server-management/_shared.js +41 -0
- package/dist/tools/server-management/_shared.js.map +1 -0
- package/dist/tools/server-management/data.d.ts +4 -0
- package/dist/tools/server-management/data.d.ts.map +1 -0
- package/dist/tools/server-management/data.js +90 -0
- package/dist/tools/server-management/data.js.map +1 -0
- package/dist/tools/server-management/decisions.d.ts +4 -0
- package/dist/tools/server-management/decisions.d.ts.map +1 -0
- package/dist/tools/server-management/decisions.js +87 -0
- package/dist/tools/server-management/decisions.js.map +1 -0
- package/dist/tools/server-management/index.d.ts +11 -0
- package/dist/tools/server-management/index.d.ts.map +1 -0
- package/dist/tools/server-management/index.js +11 -0
- package/dist/tools/server-management/index.js.map +1 -0
- package/dist/tools/server-management/policies.d.ts +4 -0
- package/dist/tools/server-management/policies.d.ts.map +1 -0
- package/dist/tools/server-management/policies.js +94 -0
- package/dist/tools/server-management/policies.js.map +1 -0
- package/dist/tools/server-management/status.d.ts +4 -0
- package/dist/tools/server-management/status.d.ts.map +1 -0
- package/dist/tools/server-management/status.js +82 -0
- package/dist/tools/server-management/status.js.map +1 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +86 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@orygn/opa-mcp` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
The public surface, for the purposes of SemVer, is:
|
|
9
|
+
|
|
10
|
+
- the set of registered MCP tools, prompts, and resources
|
|
11
|
+
- the input and output schemas of those tools
|
|
12
|
+
- the set of recognized environment variables
|
|
13
|
+
- the CLI entry point (`opa-mcp`) and its supported flags
|
|
14
|
+
|
|
15
|
+
Internal helpers (`src/lib/**`), type names not re-exported, and log formats are
|
|
16
|
+
not part of the public surface and may change in minor releases.
|
|
17
|
+
|
|
18
|
+
## [Unreleased]
|
|
19
|
+
|
|
20
|
+
## [0.1.1] - 2026-05-09
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- `rego_lint` no longer fires `directory-package-mismatch` as a false
|
|
25
|
+
positive on inline `source`. The rule's verdict depends on the
|
|
26
|
+
on-disk path, but inline source is written to a randomized temp file
|
|
27
|
+
whose path can never match the source's declared package, so the rule
|
|
28
|
+
was guaranteed to fire. It is now auto-disabled when `source` is
|
|
29
|
+
used. Re-enable via the `enable` parameter if your workflow actually
|
|
30
|
+
needs it.
|
|
31
|
+
- `rego_lint` violation locations no longer leak the temp-file path on
|
|
32
|
+
inline source. `location.file` is reported as `<inline>` for
|
|
33
|
+
inline-source calls; row and column are preserved.
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Startup self-check probes the configured `opa` and `regal` binaries
|
|
38
|
+
in the background and writes a warning entry to the log file when
|
|
39
|
+
either is unreachable, with an install-hint pointing at the
|
|
40
|
+
`OPA_BINARY` and `REGAL_BINARY` environment variables. The check is
|
|
41
|
+
fire-and-forget and does not delay the MCP `initialize` handshake.
|
|
42
|
+
Most often hit under Claude Desktop, which spawns MCP servers with a
|
|
43
|
+
reduced PATH on macOS and Windows.
|
|
44
|
+
- `mcpName: "io.github.OrygnsCode/opa-mcp"` in `package.json`. This is
|
|
45
|
+
the npm-side ownership marker the official MCP Registry requires
|
|
46
|
+
before it accepts a published package; it was missing in 0.1.0.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- README architecture diagram switched from Unicode box-drawing
|
|
51
|
+
characters to plain ASCII (`+`, `-`, `|`) so it renders uniformly on
|
|
52
|
+
npm's web UI; the previous Unicode corners showed visible gaps in
|
|
53
|
+
npm's font.
|
|
54
|
+
|
|
55
|
+
### Security
|
|
56
|
+
|
|
57
|
+
- Pinned the transitive `hono` dependency to `>= 4.12.18` via a
|
|
58
|
+
`package.json` `overrides` block. This clears three advisories
|
|
59
|
+
(GHSA series for JSX SSR style injection, JWT NumericDate
|
|
60
|
+
validation, and Vary-header handling in cache middleware) reported
|
|
61
|
+
against the version pulled by `@modelcontextprotocol/sdk`. None of
|
|
62
|
+
the affected code paths execute in this server (we run stdio only,
|
|
63
|
+
not the HTTP transport that uses hono), but pinning eliminates the
|
|
64
|
+
`npm audit` noise on user installs.
|
|
65
|
+
|
|
66
|
+
### Distribution
|
|
67
|
+
|
|
68
|
+
- Listed on the official MCP Registry at
|
|
69
|
+
`io.github.OrygnsCode/opa-mcp`.
|
|
70
|
+
|
|
71
|
+
## [0.1.0] - initial public release
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
#### Tools (32)
|
|
76
|
+
|
|
77
|
+
**Authoring (7).** `rego_format`, `rego_check`, `rego_lint`,
|
|
78
|
+
`rego_parse_ast`, `rego_inspect`, `rego_capabilities`, `rego_deps`.
|
|
79
|
+
Operate on Rego source without a running OPA server.
|
|
80
|
+
|
|
81
|
+
**Evaluation (7).** `rego_eval` plus `_with_explain`, `_with_profile`,
|
|
82
|
+
`_with_coverage` variants; `rego_test`, `rego_bench`,
|
|
83
|
+
`rego_compile_query`. Run policies against inputs with optional
|
|
84
|
+
trace, profile, and coverage.
|
|
85
|
+
|
|
86
|
+
**Bundles (2).** `opa_bundle_build`, `opa_bundle_sign`. Build and
|
|
87
|
+
sign deployable bundles.
|
|
88
|
+
|
|
89
|
+
**Server management (12).** `opa_list_policies`, `opa_get_policy`,
|
|
90
|
+
`opa_put_policy`, `opa_delete_policy`, `opa_get_data`, `opa_put_data`,
|
|
91
|
+
`opa_patch_data`, `opa_query_decision`, `opa_compile_query`,
|
|
92
|
+
`opa_health`, `opa_status`, `opa_config`. Manage a running OPA over
|
|
93
|
+
its REST API.
|
|
94
|
+
|
|
95
|
+
**Helpers (4).** `rego_explain_decision` produces a structured
|
|
96
|
+
trace and per-rule fired/not-fired summary; `rego_generate_test_skeleton`
|
|
97
|
+
emits a `*_test.rego` stub from a policy AST; `rego_describe_policy`
|
|
98
|
+
returns a structured summary of package, imports, and rules;
|
|
99
|
+
`rego_suggest_fix` maps known diagnostic codes to mechanical fix
|
|
100
|
+
suggestions.
|
|
101
|
+
|
|
102
|
+
#### Prompts (3)
|
|
103
|
+
|
|
104
|
+
`policy_authoring_assistant`, `policy_review_checklist`,
|
|
105
|
+
`decision_debugging_workflow`. Workflow templates that direct the
|
|
106
|
+
agent through writing, reviewing, or debugging a policy using the
|
|
107
|
+
tools above.
|
|
108
|
+
|
|
109
|
+
#### Resources (3)
|
|
110
|
+
|
|
111
|
+
`opa://builtins`. Categorized OPA builtin function reference,
|
|
112
|
+
derived at read time from `opa capabilities --current` and annotated
|
|
113
|
+
with security-sensitive functions.
|
|
114
|
+
|
|
115
|
+
`opa://style-guide`. Condensed Rego style guide covering
|
|
116
|
+
`rego.v1`, package layout, naming, default-deny, comprehensions vs
|
|
117
|
+
`every`, schema annotations, and tests.
|
|
118
|
+
|
|
119
|
+
`opa://patterns`. Curated pattern library with six worked
|
|
120
|
+
examples: RBAC, ABAC, Kubernetes admission, Terraform IaC gates, API
|
|
121
|
+
authorization, rate limiting. Each pattern includes a working policy,
|
|
122
|
+
a test, and common pitfalls.
|
|
123
|
+
|
|
124
|
+
#### Distribution
|
|
125
|
+
|
|
126
|
+
- npm package `@orygn/opa-mcp`.
|
|
127
|
+
- Multi-arch Docker image `orygn/opa-mcp` bundling pinned `opa`
|
|
128
|
+
0.69.0 and `regal` 0.30.0 binaries.
|
|
129
|
+
- MCPB bundle (`opa-mcp.mcpb`) attached to GitHub releases.
|
|
130
|
+
- Smithery descriptor for one-click client installs.
|
|
131
|
+
|
|
132
|
+
#### Configuration
|
|
133
|
+
|
|
134
|
+
Environment variables: `OPA_URL`, `OPA_TOKEN`, `OPA_BINARY`,
|
|
135
|
+
`REGAL_BINARY`, `OPA_MCP_ALLOWED_PATHS`, `OPA_MCP_LOG_FILE`,
|
|
136
|
+
`OPA_MCP_LOG_LEVEL`, `OPA_MCP_MAX_RESPONSE_BYTES`,
|
|
137
|
+
`OPA_MCP_TIMEOUT_MS`, `OPA_MCP_HTTP_TIMEOUT_MS`. File-based tools
|
|
138
|
+
fail-secure when `OPA_MCP_ALLOWED_PATHS` is unset.
|
|
139
|
+
|
|
140
|
+
#### Testing
|
|
141
|
+
|
|
142
|
+
50 unit tests (mocked subprocess) plus 20 integration tests
|
|
143
|
+
(real `opa` 0.69.0 and `regal` 0.30.0 binaries) covering both CLI
|
|
144
|
+
wrappers end-to-end. CI matrix: Ubuntu, macOS, and Windows on Node
|
|
145
|
+
20 and 22, plus CodeQL security scanning and weekly Dependabot updates
|
|
146
|
+
for npm, GitHub Actions, and Docker base images.
|
|
147
|
+
|
|
148
|
+
[Unreleased]: https://github.com/OrygnsCode/opa-mcp-server/compare/v0.1.1...HEAD
|
|
149
|
+
[0.1.1]: https://github.com/OrygnsCode/opa-mcp-server/releases/tag/v0.1.1
|
|
150
|
+
[0.1.0]: https://github.com/OrygnsCode/opa-mcp-server/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orygn LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|