You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/external/opa/README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,31 @@ The OPA plugin is composed of two components:
11
11
12
12
### OPA Server
13
13
To define a policy file you need to go into opaserver/rego and create a sample policy file for you.
14
-
Example -`example.rego` is present.
14
+
Example -`policy.rego` is present.
15
15
Once you have this file created in this location, when building the server, the opa binaries will be downloaded and a container will be build.
16
16
In the `run_server.sh` file, the opa server will run as a background service in the container with the rego policy file.
17
17
18
18
### OPA Plugin
19
-
The OPA plugin runs as an external plugin with pre/post tool invocations. So everytime, a tool invocation is made, and if OPAPluginFilter has been defined in config.yaml file, the tool invocation will pass through this OPA Plugin.
19
+
The OPA plugin runs as an external plugin with pre/post tool invocations. So everytime a tool invocation is made, and if OPAPluginFilter has been defined in config.yaml file, the tool invocation will pass through this OPA Plugin.
20
20
21
+
## Configuration
22
+
23
+
### MCP Server Container
24
+
25
+
The following enviornment variables can be used to customize the server container deployment.
26
+
27
+
-`API_SERVER_SCRIPT`: Path to the server script (optional, auto-detected)
28
+
-`PLUGINS_CONFIG_PATH`: Path to the plugin config (optional, default: ./resources/plugins/config.yaml)
29
+
-`CHUK_MCP_CONFIG_PATH`: Path to the chuck-mcp-runtime config (optional, default: ./resources/runtime/config.yaml)
30
+
-`POLICY_PATH`: Path to the repo policy file (optional, default: ./opaserver/rego/policy.rego)
31
+
32
+
### MCP Runtime
33
+
34
+
Changes to the MCP runtime configurations can be made in `resources/runtime/config.yaml`.
35
+
36
+
### OPA Plugin Configuration
37
+
38
+
The OPA plugin and loader configuration can be customized in `resources/plugins/config.yaml`.
21
39
22
40
## Installation
23
41
@@ -64,7 +82,7 @@ Under `extensions`, you can specify which policy to run and what endpoint to cal
64
82
In the `config` key in `config.yaml` for the OPA plugin, the following attribute must be set to configure the OPA server endpoint:
65
83
`opa_base_url` : It is the base url on which opa server is running.
66
84
67
-
3. Now suppose you have a sample policy in `example.rego` file that allows a tool invocation only when "IBM" key word is present in the repo_path. Add the sample policy file or policy rego file that you defined, in `plugins/external/opa/opaserver/rego`.
85
+
3. Now suppose you have a sample policy in `policy.rego` file that allows a tool invocation only when "IBM" key word is present in the repo_path. Add the sample policy file or policy rego file that you defined, in `plugins/external/opa/opaserver/rego`.
68
86
69
87
3. Once you have your plugin defined in `config.yaml` and policy added in the rego file, run the following commands to build your OPA Plugin external MCP server using:
70
88
* `make build`: This will build a docker image named `opapluginfilter`
0 commit comments