@oddessentials/odd-docs 2.0.4 → 2.1.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 +119 -27
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# odd-docs
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@oddessentials/odd-docs)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
> **License Notice:** This project is source-available under the [Odd Essentials License (OEL)](./LICENSE). Commercial use requires a separate license. See [LICENSE](./LICENSE) for full terms.
|
|
8
|
+
|
|
3
9
|
`odd-docs` is a documentation generation utility within the **oddessentials-mcp** ecosystem. It produces deterministic, structured documentation for MCP-compatible tools, servers, or repositories by inspecting manifests, schemas, and related metadata.
|
|
4
10
|
|
|
5
11
|
It can be used in two distinct execution modes:
|
|
@@ -11,6 +17,31 @@ Although both modes generate documentation automatically, they differ fundamenta
|
|
|
11
17
|
|
|
12
18
|
---
|
|
13
19
|
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- **Node.js ≥22.0.0** (see [.nvmrc](./.nvmrc))
|
|
23
|
+
- npm or npx
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Show version
|
|
31
|
+
npx @oddessentials/odd-docs --version
|
|
32
|
+
|
|
33
|
+
# Generate documentation for the current directory
|
|
34
|
+
npx @oddessentials/odd-docs generate .
|
|
35
|
+
|
|
36
|
+
# Validate without generating
|
|
37
|
+
npx @oddessentials/odd-docs validate .
|
|
38
|
+
|
|
39
|
+
# Start a local preview server
|
|
40
|
+
npx @oddessentials/odd-docs serve .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
14
45
|
## What odd-docs does
|
|
15
46
|
|
|
16
47
|
At a high level, `odd-docs`:
|
|
@@ -41,7 +72,16 @@ npx @oddessentials/odd-docs --help
|
|
|
41
72
|
|
|
42
73
|
---
|
|
43
74
|
|
|
44
|
-
##
|
|
75
|
+
## Global Options
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
odd-docs --version, -V # Show version number
|
|
79
|
+
odd-docs --help # Show help for any command
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## CLI Commands
|
|
45
85
|
|
|
46
86
|
### Command structure
|
|
47
87
|
|
|
@@ -57,73 +97,106 @@ odd-docs <command> <path> [options]
|
|
|
57
97
|
|
|
58
98
|
---
|
|
59
99
|
|
|
60
|
-
###
|
|
100
|
+
### generate
|
|
101
|
+
|
|
102
|
+
Generate documentation for an MCP repository.
|
|
61
103
|
|
|
62
104
|
```bash
|
|
63
|
-
odd-docs generate <repo-path>
|
|
105
|
+
odd-docs generate <repo-path> [options]
|
|
64
106
|
```
|
|
65
107
|
|
|
66
|
-
|
|
108
|
+
**Options:**
|
|
67
109
|
|
|
68
|
-
|
|
69
|
-
|
|
110
|
+
| Option | Default | Description |
|
|
111
|
+
| ----------------------- | ---------------- | -------------------------------------- |
|
|
112
|
+
| `-f, --format <format>` | `md` | Output format: `md`, `html`, or `both` |
|
|
113
|
+
| `-o, --output <dir>` | `docs/generated` | Output directory for generated files |
|
|
114
|
+
| `--introspect <url>` | — | MCP server URL for live introspection |
|
|
70
115
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
--format md|html|both
|
|
75
|
-
--output <directory>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Example:
|
|
116
|
+
**Example:**
|
|
79
117
|
|
|
80
118
|
```bash
|
|
81
119
|
odd-docs generate . --format both --output docs/generated
|
|
82
120
|
```
|
|
83
121
|
|
|
84
|
-
Outputs
|
|
122
|
+
**Outputs:**
|
|
85
123
|
|
|
86
124
|
- One or more `.md` and/or `.html` files
|
|
87
125
|
- A machine-readable intermediate representation (IR) JSON file
|
|
88
126
|
|
|
127
|
+
**Exit codes:**
|
|
128
|
+
|
|
129
|
+
- `0` — Success
|
|
130
|
+
- `1` — Error (missing manifest, invalid schema, etc.)
|
|
131
|
+
|
|
89
132
|
When run manually, **all generated files persist on disk** until you remove them.
|
|
90
133
|
|
|
91
134
|
---
|
|
92
135
|
|
|
93
|
-
###
|
|
136
|
+
### validate
|
|
137
|
+
|
|
138
|
+
Validate documentation inputs without writing output files.
|
|
94
139
|
|
|
95
140
|
```bash
|
|
96
|
-
odd-docs validate <repo-path>
|
|
141
|
+
odd-docs validate <repo-path> [options]
|
|
97
142
|
```
|
|
98
143
|
|
|
99
|
-
|
|
144
|
+
**Options:**
|
|
145
|
+
|
|
146
|
+
| Option | Description |
|
|
147
|
+
| -------------- | --------------------------------------------- |
|
|
148
|
+
| `-s, --strict` | Fail on unknown safety-affecting capabilities |
|
|
149
|
+
|
|
150
|
+
**Validation checks:**
|
|
100
151
|
|
|
101
152
|
- Required manifest fields
|
|
102
153
|
- Schema presence and consistency
|
|
103
154
|
- Capability declarations
|
|
104
155
|
- Structural correctness
|
|
105
156
|
|
|
106
|
-
|
|
107
|
-
|
|
157
|
+
**Exit codes:**
|
|
158
|
+
|
|
159
|
+
- `0` — Validation passed
|
|
160
|
+
- `1` — Validation failed or error encountered
|
|
161
|
+
|
|
162
|
+
Suitable for CI pipelines.
|
|
108
163
|
|
|
109
164
|
---
|
|
110
165
|
|
|
111
|
-
###
|
|
166
|
+
### serve
|
|
167
|
+
|
|
168
|
+
Start a local development server for generated documentation.
|
|
112
169
|
|
|
113
170
|
```bash
|
|
114
|
-
odd-docs serve <repo-path>
|
|
171
|
+
odd-docs serve <repo-path> [options]
|
|
115
172
|
```
|
|
116
173
|
|
|
117
|
-
|
|
174
|
+
**Options:**
|
|
175
|
+
|
|
176
|
+
| Option | Default | Description |
|
|
177
|
+
| -------------------------- | ---------------- | --------------------------------------------------------------- |
|
|
178
|
+
| `-p, --port <port>` | `3000` | Port to listen on |
|
|
179
|
+
| `-H, --host <host>` | `localhost` | Host to bind (localhost for safety) |
|
|
180
|
+
| `-o, --output <dir>` | `docs/generated` | Documentation output directory |
|
|
181
|
+
| `--no-watch` | — | Disable file watching |
|
|
182
|
+
| `--watch-mode <mode>` | `auto` | Watch mode: `auto` or `poll` (use `poll` for Docker/NFS) |
|
|
183
|
+
| `--reload <mode>` | `ws` | Reload mechanism: `ws`, `sse`, `poll`, `none` |
|
|
184
|
+
| `--no-open` | — | Do not open browser on start |
|
|
185
|
+
| `--introspect <target>` | — | MCP target: `http://host:port` or `stdio:<cmd>` |
|
|
186
|
+
| `--enable-mutations` | — | Enable mutation API endpoints (requires token) |
|
|
187
|
+
| `--mutation-token <token>` | — | Token for mutation endpoints (or `ODD_DOCS_MUTATION_TOKEN` env) |
|
|
188
|
+
|
|
189
|
+
**Behavior:**
|
|
118
190
|
|
|
119
191
|
- Generates documentation if it does not already exist
|
|
120
192
|
- Starts a local HTTP server for viewing the docs
|
|
121
|
-
-
|
|
193
|
+
- Watches source files and regenerates on change (unless `--no-watch`)
|
|
194
|
+
- Auto-switches to SSE for non-localhost bindings (safer for K8s)
|
|
122
195
|
|
|
123
|
-
|
|
196
|
+
**Exit codes:**
|
|
124
197
|
|
|
125
|
-
-
|
|
126
|
-
-
|
|
198
|
+
- `0` — Clean shutdown (SIGINT/SIGTERM)
|
|
199
|
+
- `1` — Error starting server
|
|
127
200
|
|
|
128
201
|
This mode is intended for local development and inspection.
|
|
129
202
|
|
|
@@ -206,3 +279,22 @@ They differ in **who owns execution and filesystem lifecycle**.
|
|
|
206
279
|
- Temporary directories created under MCP control are always ephemeral
|
|
207
280
|
|
|
208
281
|
Choose the execution mode based on **ownership and persistence requirements**, not on automation level.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## License
|
|
286
|
+
|
|
287
|
+
This project is source-available under the [Odd Essentials License (OEL)](./LICENSE).
|
|
288
|
+
|
|
289
|
+
**Commercial use is prohibited** without a separate license from Odd Essentials, LLC.
|
|
290
|
+
See [LICENSE](./LICENSE) for full terms.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Resources
|
|
295
|
+
|
|
296
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
297
|
+
- [Code of Conduct](./CODE_OF_CONDUCT.md)
|
|
298
|
+
- [Changelog](./CHANGELOG.md)
|
|
299
|
+
- [Deployment Guide](./docs/deployment.md)
|
|
300
|
+
- [Specification](./docs/spec.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oddessentials/odd-docs",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "MCP-native documentation generator for clients, servers, and tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"clean": "rimraf dist",
|
|
23
23
|
"ci": "npm run lint && npm run format:check && npm run typecheck && npm run build && npm run test",
|
|
24
24
|
"release:dry-run": "semantic-release --dry-run",
|
|
25
|
-
"prepare": "husky"
|
|
25
|
+
"prepare": "husky",
|
|
26
|
+
"postinstall": "git config core.hooksPath .husky || true"
|
|
26
27
|
},
|
|
27
28
|
"keywords": [
|
|
28
29
|
"mcp",
|
|
@@ -58,7 +59,9 @@
|
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@commitlint/cli": "^19.0.0",
|
|
60
61
|
"@commitlint/config-conventional": "^19.0.0",
|
|
62
|
+
"@oddessentials/repo-standards": "^4.3.0",
|
|
61
63
|
"@semantic-release/changelog": "^6.0.3",
|
|
64
|
+
"@semantic-release/exec": "^7.1.0",
|
|
62
65
|
"@semantic-release/git": "^10.0.1",
|
|
63
66
|
"@semantic-release/github": "^12.0.2",
|
|
64
67
|
"@types/node": "^22.0.0",
|