oth-mcp 0.1.4 → 0.1.5
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/README.md +40 -2
- package/dist/auth.js +5 -2
- package/dist/index.js +0 -0
- package/dist/tools.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,12 +13,15 @@ The server is designed for minimal token usage. Instead of embedding the full AP
|
|
|
13
13
|
|
|
14
14
|
## Setup
|
|
15
15
|
|
|
16
|
+
**Defaults with no env set:** `OTH_ENV=dev` → base URL `https://doccla-dev.oth.io`, credentials read from Keychain account `oth-dev`. Override `OTH_ENV` (`dev`, `stag`, `demo`, `local`) to target another environment — the Keychain account name follows as `oth-<env>`.
|
|
17
|
+
|
|
16
18
|
### 1. Configure credentials
|
|
17
19
|
|
|
18
20
|
**macOS Keychain (preferred)** — no plaintext on disk:
|
|
19
21
|
|
|
20
22
|
```bash
|
|
21
|
-
#
|
|
23
|
+
# Account name is oth-<env>, so repeat per env you use
|
|
24
|
+
# (oth-dev, oth-stag, oth-demo, oth-local):
|
|
22
25
|
security add-generic-password -a "oth-dev" -s "oth-mcp-username" -w
|
|
23
26
|
security add-generic-password -a "oth-dev" -s "oth-mcp-password" -w
|
|
24
27
|
```
|
|
@@ -31,12 +34,47 @@ export OTH_PASSWORD="your-password"
|
|
|
31
34
|
export OTH_ENV="dev" # optional, defaults to dev
|
|
32
35
|
```
|
|
33
36
|
|
|
34
|
-
### 2. Add to Claude Code
|
|
37
|
+
### 2. Add to Claude Code (no env default dev)
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
40
|
claude mcp add oth -- npx -y oth-mcp
|
|
38
41
|
```
|
|
39
42
|
|
|
43
|
+
Pass env vars with `-e KEY=VALUE` (repeatable). Example pointing at a local opentele stack with inline creds:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
claude mcp add oth \
|
|
47
|
+
-e OTH_ENV=local \
|
|
48
|
+
-e OTH_USERNAME=admin \
|
|
49
|
+
-e OTH_PASSWORD=admin_23 \
|
|
50
|
+
-- npx -y oth-mcp
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Omit `OTH_USERNAME`/`OTH_PASSWORD` if you've stored them in Keychain under `oth-local`. Use `-e OTH_BASE_URL=http://host.docker.internal:7100` if the default `http://localhost:7100` isn't reachable.
|
|
54
|
+
|
|
55
|
+
### Local OTH (docker)
|
|
56
|
+
|
|
57
|
+
To point the MCP at a local opentele stack run via docker:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# in the opentele repo:
|
|
61
|
+
cd dev && docker compose up -d --wait
|
|
62
|
+
|
|
63
|
+
# then launch the MCP with:
|
|
64
|
+
export OTH_ENV=local # → http://localhost:7100
|
|
65
|
+
export OTH_USERNAME=admin
|
|
66
|
+
export OTH_PASSWORD=admin_23 # or any dev account — see opentele docs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or store local creds in Keychain under the `oth-local` account:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
security add-generic-password -a "oth-local" -s "oth-mcp-username" -w
|
|
73
|
+
security add-generic-password -a "oth-local" -s "oth-mcp-password" -w
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Set `OTH_BASE_URL` to override the host/port (e.g. `http://host.docker.internal:7100`) if you're not on the default.
|
|
77
|
+
|
|
40
78
|
## Tools
|
|
41
79
|
|
|
42
80
|
### `oth_get`
|
package/dist/auth.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
const execFileAsync = promisify(execFile);
|
|
4
|
+
const ENV_URLS = {
|
|
5
|
+
local: "http://localhost:7100",
|
|
6
|
+
};
|
|
4
7
|
function envBaseUrl(env) {
|
|
5
|
-
return `https://doccla-${env}.oth.io`;
|
|
8
|
+
return ENV_URLS[env] ?? `https://doccla-${env}.oth.io`;
|
|
6
9
|
}
|
|
7
10
|
const REFRESH_BUFFER_SECONDS = 60;
|
|
8
11
|
const AUTH_ERROR_MESSAGES = {
|
|
@@ -27,7 +30,7 @@ export class AuthManager {
|
|
|
27
30
|
return this.env;
|
|
28
31
|
}
|
|
29
32
|
get baseUrl() {
|
|
30
|
-
return envBaseUrl(this.env);
|
|
33
|
+
return process.env.OTH_BASE_URL ?? envBaseUrl(this.env);
|
|
31
34
|
}
|
|
32
35
|
get isAuthenticated() {
|
|
33
36
|
return this.state !== null;
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/tools.js
CHANGED
|
@@ -133,9 +133,9 @@ Read the oth://api-guide resource for full endpoint reference.`,
|
|
|
133
133
|
},
|
|
134
134
|
inputSchema: {
|
|
135
135
|
environment: z
|
|
136
|
-
.enum(["dev", "stag", "demo"])
|
|
136
|
+
.enum(["dev", "stag", "demo", "local"])
|
|
137
137
|
.optional()
|
|
138
|
-
.describe("Target environment. Omit to show current state."),
|
|
138
|
+
.describe("Target environment. Omit to show current state. 'local' targets http://localhost:7100 (opentele docker stack); set OTH_BASE_URL to override."),
|
|
139
139
|
},
|
|
140
140
|
}, async ({ environment }) => {
|
|
141
141
|
if (environment) {
|