@moxn/mcp-kb 0.4.1 → 0.6.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.
package/README.md CHANGED
@@ -42,26 +42,66 @@ On first run, the client will:
42
42
  Subsequent runs use stored credentials automatically, and the client will attempt
43
43
  automatic refresh/re-authentication if the server returns an auth challenge (401/403).
44
44
 
45
+ #### Headless: static API key (`MOXN_API_KEY`)
46
+
47
+ For CI, servers, or bots — anywhere a browser login isn't possible — set
48
+ `MOXN_API_KEY` to a key minted from your workspace's Members/API Keys page
49
+ (starts with `moxn_`). When set, the proxy sends it as `Authorization: Bearer
50
+ <key>` and never runs the OAuth flow: no browser opens, and the credential
51
+ store on disk is never read or written. It takes precedence over any stored
52
+ OAuth session.
53
+
54
+ A rejected key is **terminal** — the proxy does not retry or attempt to
55
+ refresh a static key (there's nothing to refresh). It fails the call with a
56
+ clear error naming `MOXN_API_KEY`; fix the key or unset the env var to fall
57
+ back to OAuth.
58
+
45
59
  ### Environment Variables
46
60
 
47
61
  | Variable | Description |
48
62
  |----------|-------------|
49
- | `MOXN_TOKEN` | Skip OAuth flow and use this token directly |
63
+ | `MOXN_API_KEY` | Static API key (`moxn_...`) — skips OAuth entirely, no browser, no credential-store I/O. Wins over stored OAuth credentials. |
64
+ | `MOXN_TOKEN` | Skip OAuth flow and use this bearer token directly (testing/CI; unlike `MOXN_API_KEY` this is an ad hoc token, not a managed key) |
50
65
  | `MOXN_WORKSPACE` | Default workspace (alternative to `--workspace` flag) |
51
66
  | `MOXN_BASE_URL` | Override API URL (for local development) |
52
67
  | `MOXN_AUTH_SERVER` | Override auth server URL (for local development) |
53
68
  | `MOXN_CLIENT_ID` | Use a pre-registered OAuth client ID (when dynamic registration is unavailable) |
54
69
  | `MOXN_CLIENT_SECRET` | Optional client secret for `MOXN_CLIENT_ID` |
70
+ | `MOXN_CHECKOUT_ROOT` | Directory that holds `.moxn/checkouts/` for `pull` and `push`. Defaults to the client's first MCP root, else the working directory |
71
+
72
+ ### Connecting without this package (direct HTTP + static key)
73
+
74
+ The Moxn MCP server also speaks HTTP directly at
75
+ `https://<workspace>.moxn.dev/api/mcp/http`, so a static key lets any MCP
76
+ client that supports custom headers skip this stdio proxy entirely.
77
+
78
+ **Claude Code** (custom header on a remote HTTP server):
79
+
80
+ ```bash
81
+ claude mcp add --transport http moxn-kb \
82
+ https://your-workspace-slug.moxn.dev/api/mcp/http \
83
+ --header "Authorization: Bearer moxn_your_key_here"
84
+ ```
85
+
86
+ **Claude.ai custom connector:** set the server URL to
87
+ `https://your-workspace-slug.moxn.dev/api/mcp/http` and add a custom header
88
+ `x-api-key: moxn_your_key_here` (used when the client can't set
89
+ `Authorization` directly — if both are present, `Authorization` wins). Use the
90
+ API key **instead of**, not alongside, connecting the connector via OAuth: if
91
+ the connector also completes Claude.ai's OAuth flow, its `Authorization:
92
+ Bearer` header wins outright server-side, and the `x-api-key` header is
93
+ silently ignored.
55
94
 
56
95
  ## Available Tools
57
96
 
58
- Once connected, Claude Code has access to these Knowledge Base tools:
97
+ The proxy forwards the server's tool list (`find`, `search`, `read`, `documents`, `edit`, and the rest), so that list is always the deployment's own.
98
+
99
+ It also serves two tools locally:
100
+
101
+ - **pull** - Write a markdown document to `.moxn/checkouts/` and return its path, not its body. The agent searches and edits the file with its own file tools.
102
+ - **push** - Commit that file's body back to the branch it was pulled from, guarded by the pulled revision, then refresh it from the server. Tags and metadata are left alone; editing the file's front-matter is refused.
59
103
 
60
- - **find** - List documents, sections, or folders
61
- - **read** - Read document/section content
62
- - **documents** - Create, update, delete documents; manage branches and tags
63
- - **sections** - Create, update, delete, reorder sections
64
- - **search** - Search content across the knowledge base
104
+ A body moved this way never passes through the model. The caller cannot choose a path: paths derive from the document id and branch, and symlinks and hard links are refused, so a prompt-injected document cannot turn `push` into an upload of a local file. The checkout lands under the client's first MCP root, else the working directory; set `MOXN_CHECKOUT_ROOT` to override. Over a direct HTTP connection these tools do not exist.
65
105
 
66
106
  ## Development
67
107
 
package/dist/auth.d.ts CHANGED
@@ -7,9 +7,25 @@
7
7
  * for why that sharing is load-bearing). This module keeps the proxy-specific
8
8
  * pieces: argv/env parsing, the stderr log prefix, and base-URL construction.
9
9
  */
10
- import { type AuthConfig, type GetAuthOptions as SharedGetAuthOptions } from '@moxn/auth';
11
- export type { AuthConfig };
10
+ import { type AuthConfig as SharedAuthConfig, type GetAuthOptions as SharedGetAuthOptions } from '@moxn/auth';
11
+ export interface AuthConfig extends SharedAuthConfig {
12
+ /**
13
+ * Which credential rail produced this config. OAuth tokens can be silently
14
+ * refreshed or re-minted on a 401; a static API key is either valid or it
15
+ * isn't, so the proxy needs this to know a 401 on the key rail is terminal
16
+ * rather than a cue to retry (see mcpFetch in proxy.ts).
17
+ */
18
+ rail: 'api-key' | 'oauth';
19
+ }
12
20
  export type GetAuthOptions = Omit<SharedGetAuthOptions, 'workspace' | 'interactive'>;
21
+ /**
22
+ * Read the static-key rail from the environment. Setting MOXN_API_KEY runs
23
+ * the proxy headlessly: no browser, no reads/writes of the OAuth credential
24
+ * store. Wins over stored OAuth credentials — an explicit env var beats
25
+ * ambient state, matching kb-cli's MOXN_API_KEY precedence
26
+ * (packages/kb-cli/src/auth.ts).
27
+ */
28
+ export declare function resolveApiKey(): string | undefined;
13
29
  /**
14
30
  * Parse CLI arguments to extract workspace
15
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,cAAc,IAAI,oBAAoB,EAC5C,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,aAAa,CAAC,CAAC;AAErF;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAYnD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAyBvD;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAkB/E;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQtD"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,UAAU,IAAI,gBAAgB,EACnC,KAAK,cAAc,IAAI,oBAAoB,EAC5C,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD;;;;;OAKG;IACH,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,aAAa,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAElD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAYnD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAyBvD;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAwB/E;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQtD"}
package/dist/auth.js CHANGED
@@ -8,6 +8,16 @@
8
8
  * pieces: argv/env parsing, the stderr log prefix, and base-URL construction.
9
9
  */
10
10
  import { getAuth as getAuthShared, } from '@moxn/auth';
11
+ /**
12
+ * Read the static-key rail from the environment. Setting MOXN_API_KEY runs
13
+ * the proxy headlessly: no browser, no reads/writes of the OAuth credential
14
+ * store. Wins over stored OAuth credentials — an explicit env var beats
15
+ * ambient state, matching kb-cli's MOXN_API_KEY precedence
16
+ * (packages/kb-cli/src/auth.ts).
17
+ */
18
+ export function resolveApiKey() {
19
+ return process.env.MOXN_API_KEY || undefined;
20
+ }
11
21
  /**
12
22
  * Parse CLI arguments to extract workspace
13
23
  */
@@ -66,13 +76,18 @@ export async function getAuth(options = {}) {
66
76
  console.error('Example: moxn-mcp-kb --workspace=smoggy-azure-hummingbird');
67
77
  process.exit(1);
68
78
  }
79
+ const apiKey = resolveApiKey();
80
+ if (apiKey) {
81
+ return { token: apiKey, workspace, rail: 'api-key' };
82
+ }
69
83
  // The proxy is long-lived: its first real request may bootstrap auth via
70
84
  // the interactive browser flow (interactive: true, the default).
71
- return getAuthShared({
85
+ const config = await getAuthShared({
72
86
  ...options,
73
87
  workspace,
74
88
  log: (message) => console.error(`[moxn-mcp-kb] ${message}`),
75
89
  });
90
+ return { ...config, rail: 'oauth' };
76
91
  }
77
92
  /**
78
93
  * Build the base URL for the MCP API
package/dist/auth.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,OAAO,IAAI,aAAa,GAGzB,MAAM,YAAY,CAAC;AAMpB;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAChF,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAChD,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,O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CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC9B,gEAAgE;QAChE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1D,OAAO,GAAG,IAAI,IAAI,SAAS,eAAe,CAAC;IAC7C,CAAC;IACD,iEAAiE;IACjE,OAAO,WAAW,SAAS,wBAAwB,CAAC;AACtD,CAAC"}
@@ -0,0 +1,86 @@
1
+ export interface ToolResult {
2
+ content: Array<{
3
+ type: 'text';
4
+ text: string;
5
+ }>;
6
+ isError?: boolean;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface CheckoutEnv {
10
+ workspace: string;
11
+ /** The deployment this connection talks to; document ids are not portable. */
12
+ baseUrl: string;
13
+ /** The directory that holds `.moxn/`. Resolved per call: roots can change. */
14
+ root: () => Promise<string>;
15
+ callTool: (name: string, args: Record<string, unknown>) => Promise<ToolResult>;
16
+ }
17
+ export declare const checkoutTools: ({
18
+ name: string;
19
+ description: string;
20
+ inputSchema: {
21
+ type: string;
22
+ additionalProperties: boolean;
23
+ required: string[];
24
+ properties: {
25
+ documentId: {
26
+ type: string;
27
+ format: string;
28
+ description: string;
29
+ };
30
+ branchName: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ commitId: {
35
+ type: string;
36
+ format: string;
37
+ description: string;
38
+ };
39
+ overwrite: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ commitMessage?: undefined;
44
+ };
45
+ };
46
+ } | {
47
+ name: string;
48
+ description: string;
49
+ inputSchema: {
50
+ type: string;
51
+ additionalProperties: boolean;
52
+ required: string[];
53
+ properties: {
54
+ documentId: {
55
+ type: string;
56
+ format: string;
57
+ description: string;
58
+ };
59
+ branchName: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ commitMessage: {
64
+ type: string;
65
+ description: string;
66
+ };
67
+ commitId?: undefined;
68
+ overwrite?: undefined;
69
+ };
70
+ };
71
+ })[];
72
+ export declare function isCheckoutTool(name: string): boolean;
73
+ /**
74
+ * Where `.moxn/` lives: an explicit override, else the client's first MCP root
75
+ * (the directory the agent's own file tools can reach without prompting), else
76
+ * the working directory. A client launched from `/` has no project at all, so
77
+ * that case lands in the home directory rather than at the filesystem root.
78
+ */
79
+ export declare function resolveCheckoutRoot(deps: {
80
+ override?: string;
81
+ listRoots: () => Promise<string[]>;
82
+ cwd: string;
83
+ home: string;
84
+ }): Promise<string>;
85
+ export declare function runCheckoutTool(name: string, args: Record<string, unknown> | undefined, env: CheckoutEnv): Promise<ToolResult>;
86
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AA2CA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChF;AA0BD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4DzB,CAAC;AAIF,wBAAgB,cAAc,CAAC,IA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