metheus-governance-mcp-cli 0.2.0

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.
@@ -0,0 +1,3 @@
1
+ # Copy this file to .env.npm.local and put your real npm publish token.
2
+ # Do NOT commit .env.npm.local.
3
+ NPM_TOKEN=__PASTE_NPM_TOKEN_HERE__
package/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # metheus-governance-mcp-cli
2
+
3
+ Metheus Governance MCP helper CLI.
4
+
5
+ - `setup`: register `metheus-governance-mcp` into Codex/Claude (if installed)
6
+ - `proxy`: stdio MCP bridge to Metheus HTTPS gateway
7
+ - `auth`: save/check/clear local Metheus token used by proxy
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g metheus-governance-mcp-cli
13
+ ```
14
+
15
+ ## Setup
16
+
17
+ ```bash
18
+ metheus-governance-mcp setup --project-id <project_uuid> --ctxpack-key "<ctxpack_key>" --base-url https://metheus.gesiaplatform.com
19
+ ```
20
+
21
+ `project-id` can be omitted if your current folder (or parent) has `.metheus_ctxpack_sync.json`.
22
+
23
+ ## Use in MCP
24
+
25
+ `setup` auto-registers this server for `codex` and `claude` when those CLIs are available.
26
+
27
+ ## Auth flow (recommended)
28
+
29
+ 1. Auto login and save token once (default flow: `device -> callback -> manual hint`):
30
+
31
+ ```bash
32
+ metheus-governance-mcp auth login --base-url https://metheus.gesiaplatform.com
33
+ ```
34
+
35
+ Optional flags:
36
+
37
+ ```bash
38
+ metheus-governance-mcp auth login --callback-port 43819 --open-browser true
39
+ metheus-governance-mcp auth login --flow device
40
+ metheus-governance-mcp auth login --flow callback --callback-port 43819
41
+ metheus-governance-mcp auth login --client-id metheus-cli --realm master --keycloak-url https://oauth3.gesia.io
42
+ ```
43
+
44
+ Keycloak client requirement for auto login:
45
+ - Device flow:
46
+ - Enable OAuth 2.0 Device Authorization Grant for the client.
47
+ - Callback flow:
48
+ - Add localhost callback URI to redirect list (example): `http://127.0.0.1/*`
49
+ - If callback URI is not configured, CLI can still work via `--flow device`.
50
+
51
+ Manual fallback:
52
+
53
+ ```bash
54
+ metheus-governance-mcp auth login --manual true --base-url https://metheus.gesiaplatform.com
55
+ ```
56
+
57
+ 2. Check token status:
58
+
59
+ ```bash
60
+ metheus-governance-mcp auth status
61
+ ```
62
+
63
+ 3. If token is rotated, set directly:
64
+
65
+ ```bash
66
+ metheus-governance-mcp auth set --token "<access_token>"
67
+ ```
68
+
69
+ 4. Remove local token:
70
+
71
+ ```bash
72
+ metheus-governance-mcp auth clear
73
+ ```
74
+
75
+ `proxy` priority:
76
+ - 1) `METHEUS_TOKEN`
77
+ - 2) `MCP_AUTH_TOKEN`
78
+ - 3) local file `~/.metheus/governance-mcp-auth.json`
79
+
80
+ You can still use env token directly:
81
+
82
+ ```bash
83
+ export METHEUS_TOKEN="<access_token>"
84
+ ```
85
+
86
+ PowerShell:
87
+
88
+ ```powershell
89
+ $env:METHEUS_TOKEN="<access_token>"
90
+ ```
91
+
92
+ ## npm publish token (where to store)
93
+
94
+ Use this local file in this folder:
95
+
96
+ - `tools/governance-mcp-cli/.env.npm.local` (create from `.env.npm.local.example`)
97
+
98
+ Template:
99
+
100
+ ```env
101
+ NPM_TOKEN=__PASTE_NPM_TOKEN_HERE__
102
+ ```
103
+
104
+ Load token before publish:
105
+
106
+ PowerShell:
107
+
108
+ ```powershell
109
+ $env:NPM_TOKEN = (Get-Content .\.env.npm.local | Where-Object { $_ -match '^NPM_TOKEN=' } | ForEach-Object { $_.Split('=',2)[1] } | Select-Object -First 1).Trim()
110
+ npm publish --access public
111
+ ```
112
+
113
+ bash/zsh:
114
+
115
+ ```bash
116
+ export NPM_TOKEN="$(grep '^NPM_TOKEN=' ./.env.npm.local | head -n1 | cut -d'=' -f2-)"
117
+ npm publish --access public
118
+ ```
119
+
120
+ ## Release commands
121
+
122
+ ```bash
123
+ npm run check
124
+ npm run publish:dry
125
+ ```
126
+
127
+ Actual publish:
128
+
129
+ ```bash
130
+ npm run publish:public
131
+ ```
132
+
133
+ If npm account uses 2FA, pass OTP:
134
+
135
+ ```bash
136
+ node release.mjs --otp <6-digit-code>
137
+ ```
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "../cli.mjs";
3
+