api-documentation-mcp 0.1.0 → 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.
- package/README.md +61 -17
- package/dist/index.js +2091 -922
- package/package.json +19 -5
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# api-documentation-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line and MCP access to the API Documentation desktop app. Every command reads and writes the same local workspace database the app uses, so an agent or a script can create workspaces, folders, requests, environments, and variables, and send requests, without anyone clicking through the app. The app picks changes up while it is open.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The desktop app must be installed and opened at least once on this computer.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Use with an AI client (MCP)
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
11
|
"mcpServers": {
|
|
12
12
|
"api-documentation": {
|
|
13
13
|
"command": "npx",
|
|
14
|
-
"args": ["-y", "api-documentation-mcp"]
|
|
14
|
+
"args": ["-y", "api-documentation-mcp@latest"]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -20,28 +20,72 @@ Add this to your MCP client configuration:
|
|
|
20
20
|
For Codex:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
codex mcp add api-documentation -- npx -y api-documentation-mcp
|
|
23
|
+
codex mcp add api-documentation -- npx -y api-documentation-mcp@latest
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Requires Node.js 22 or newer.
|
|
26
|
+
Requires Node.js 22 or newer. Start with `list_commands` to see every command and its parameters.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Version 0.2.0 is not on npm yet. Until it is published, point the client at a local build: `node /path/to/mcp/dist/index.js` after `npm run build`. The `npx` form above installs the published version.
|
|
29
|
+
|
|
30
|
+
## Use from the command line
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
api-documentation-mcp commands # every command, read-only or write, destructive or not
|
|
34
|
+
api-documentation-mcp commands --json --filter env # JSON, filtered
|
|
35
|
+
api-documentation-mcp call workspace.list
|
|
36
|
+
api-documentation-mcp call workspace.create '{"name":"Payments"}'
|
|
37
|
+
api-documentation-mcp run script.json # JSON array or JSON lines of {"command","params"}
|
|
38
|
+
cat steps.jsonl | api-documentation-mcp run - # from stdin
|
|
39
|
+
```
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
`run` executes steps in order and prints one JSON line per step. A failed step is reported and the run continues. Exit code is 1 when any step failed.
|
|
42
|
+
|
|
43
|
+
## Data location
|
|
31
44
|
|
|
32
45
|
- Linux: `~/.config/api-documentation-bit`
|
|
33
46
|
- macOS: `~/Library/Application Support/api-documentation-bit`
|
|
34
47
|
- Windows: `%APPDATA%\api-documentation-bit`
|
|
35
48
|
|
|
36
|
-
Set `API_DOCS_USER_DATA_DIR`
|
|
49
|
+
Set `API_DOCS_USER_DATA_DIR` if the app uses a custom data folder.
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
| Group | Commands |
|
|
54
|
+
|---|---|
|
|
55
|
+
| workspace | `workspace.list`, `workspace.create`, `workspace.rename`, `workspace.delete`, `tree.get` |
|
|
56
|
+
| collection | `folder.create`, `folder.rename`, `folder.delete`, `node.move` |
|
|
57
|
+
| request | `request.search`, `request.get`, `request.create`, `request.update`, `request.duplicate`, `request.deprecate`, `request.delete`, `request.send` |
|
|
58
|
+
| environment | `environment.list`, `environment.create`, `environment.rename`, `environment.duplicate`, `environment.delete`, `environment.activate`, `variable.set`, `variable.delete` |
|
|
59
|
+
| changes | `changes.preview`, `changes.apply` |
|
|
60
|
+
| meta | `commands.list` |
|
|
37
61
|
|
|
38
|
-
|
|
62
|
+
Destructive commands (`*.delete`) require `"confirm": true`. Only set it after the user confirms.
|
|
39
63
|
|
|
40
|
-
|
|
41
|
-
- `get_collection_tree`
|
|
42
|
-
- `search_requests`
|
|
43
|
-
- `get_request`
|
|
44
|
-
- `preview_changes`
|
|
45
|
-
- `apply_changes`
|
|
64
|
+
Collection edits go through `changes.preview` and then `changes.apply`. Apply refuses a preview when the workspace changed after it, so nothing newer is overwritten.
|
|
46
65
|
|
|
47
|
-
`
|
|
66
|
+
MCP clients do not get the direct collection writes (`folder.*`, `node.move`, `request.create`, `request.update`, `request.duplicate`, `request.deprecate`, `request.delete`). They stay in the CLI for scripts. Sending a request from an MCP client needs `dryRun: true` first, then `confirmUrl` set to the URL it showed.
|
|
67
|
+
|
|
68
|
+
## Limits and safety
|
|
69
|
+
|
|
70
|
+
- Secret values are never returned. `environment.list` shows them as `<secret>`. Request params, headers, body, auth, responses, and docs all go through `request.create` and `request.update`. Literal tokens in a request are shown as `<redacted>`, but `{{variable}}` references are shown as written, so an agent can see that auth uses `{{accessToken}}`.
|
|
71
|
+
- A secret variable is created empty when `variable.set` gets `"secret": true` with no value. Its value is entered in the desktop app. An existing secret cannot be changed from the CLI.
|
|
72
|
+
- Variable writes are checked against what was read. `variable.get` returns a `revision`. `variable.set` and `variable.delete` take `expectedRevision` and refuse the write if the variable changed since then. The revision of a secret covers its stored form, so a secret the app sets again also counts as a change. MCP clients must pass `expectedRevision`, using `null` for a variable that does not exist yet.
|
|
73
|
+
- Cloud workspaces are read from the CLI but not created, renamed, or deleted from it. Cloud copies also refuse edits: change them in the desktop app and push from there, so nothing is left unpushed.
|
|
74
|
+
- Viewer workspaces refuse writes.
|
|
75
|
+
- Accounts: the desktop app writes the signed-in account id to `app_settings`. Workspaces the CLI creates get that account, and the CLI shows and edits only the active account's workspaces plus workspaces that predate accounts. With no account signed in, every workspace is visible.
|
|
76
|
+
- Writes to the workspace database are not coordinated with the app. The CLI's own writes are atomic, but an edit the app saves during a CLI write can overwrite it. Keep the app idle while the CLI writes, then check the result in the app.
|
|
77
|
+
- `request.send` sends JSON, text, XML, YAML, GraphQL, and urlencoded bodies, with bearer, basic, and API-key auth. Multipart and file bodies must be sent from the app. Path parameters are not substituted yet.
|
|
78
|
+
- Variables from the active environment (or the one you pass) and globals are filled in. A variable with no value stops the send and names what is missing.
|
|
79
|
+
|
|
80
|
+
## Legacy tool names
|
|
81
|
+
|
|
82
|
+
These tools keep working for clients configured earlier: `list_workspaces`, `get_collection_tree`, `search_requests`, `get_request`, `preview_changes`, `apply_changes`.
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
npm ci
|
|
88
|
+
npm run typecheck
|
|
89
|
+
npm test
|
|
90
|
+
npm run build
|
|
91
|
+
```
|