doc2mcp 0.1.13 → 0.1.14
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 +181 -25
- package/dist/index.js +2 -3
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="https://raw.githubusercontent.com/gautammanak1/doc2mcp/main/public/doc2mcp-cli-banner.png" alt="doc2mcp — turn any docs site into a hosted MCP server from your terminal" width="100%" />
|
|
4
|
+
|
|
5
|
+
# doc2mcp
|
|
6
|
+
|
|
7
|
+
**Turn any documentation site into a hosted [MCP](https://modelcontextprotocol.io) server — straight from your terminal.**
|
|
8
|
+
|
|
9
|
+
Point it at a docs URL, and doc2mcp crawls, analyzes, and serves it as a token-secured MCP endpoint that Cursor, Claude, VS Code, Windsurf, and OpenAI agents can search, read, and cite.
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/doc2mcp)
|
|
12
|
+
[](https://www.npmjs.com/package/doc2mcp)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](https://github.com/gautammanak1/doc2mcp/blob/main/LICENSE)
|
|
15
|
+
|
|
16
|
+
[Website](https://doc2mcp.site) · [Playground](https://doc2mcp.site/playground) · [Docs](https://doc2mcp.site/docs) · [CLI guide](https://doc2mcp.site/docs/cli)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
4
21
|
|
|
5
22
|
## Install
|
|
6
23
|
|
|
@@ -8,36 +25,169 @@ Generate documentation MCP servers from your terminal.
|
|
|
8
25
|
npm install -g doc2mcp
|
|
9
26
|
```
|
|
10
27
|
|
|
28
|
+
> [!IMPORTANT]
|
|
29
|
+
> Install with **`-g`** (global). The `doc2mcp` command only lands on your `PATH` when installed globally.
|
|
30
|
+
> If you ran `npm i doc2mcp` (without `-g`) and see `command not found: doc2mcp`, either reinstall with `-g`
|
|
31
|
+
> or run it through your package runner: `npx doc2mcp <docs-url>`.
|
|
32
|
+
|
|
33
|
+
Other package managers:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pnpm add -g doc2mcp # pnpm
|
|
37
|
+
yarn global add doc2mcp # yarn
|
|
38
|
+
bun add -g doc2mcp # bun
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Requires **Node.js 18+**.
|
|
42
|
+
|
|
11
43
|
## Quick start
|
|
12
44
|
|
|
13
45
|
```bash
|
|
14
|
-
# 1. Authorize (opens browser)
|
|
46
|
+
# 1. Authorize the CLI (opens your browser, creates a token-backed session)
|
|
15
47
|
doc2mcp login
|
|
16
48
|
|
|
17
|
-
# 2. Convert docs
|
|
18
|
-
doc2mcp https://docs.
|
|
49
|
+
# 2. Convert any docs site into a hosted MCP server
|
|
50
|
+
doc2mcp https://docs.stripe.com
|
|
19
51
|
|
|
20
|
-
# 3.
|
|
52
|
+
# 3. When it's ready, pick your editor — the MCP is installed for you
|
|
53
|
+
# ✔ Cursor ✔ VS Code ✔ Claude Desktop ✔ Windsurf
|
|
21
54
|
```
|
|
22
55
|
|
|
56
|
+
That's it. The same hosted pipeline powers the [website](https://doc2mcp.site) and the
|
|
57
|
+
[Playground](https://doc2mcp.site/playground), so a project you create in the CLI shows up in your
|
|
58
|
+
dashboard and marketplace too.
|
|
59
|
+
|
|
23
60
|
## Commands
|
|
24
61
|
|
|
25
|
-
| Command |
|
|
62
|
+
| Command | What it does |
|
|
26
63
|
| --- | --- |
|
|
27
|
-
| `doc2mcp
|
|
28
|
-
| `doc2mcp
|
|
29
|
-
| `doc2mcp
|
|
30
|
-
| `doc2mcp
|
|
31
|
-
| `doc2mcp
|
|
32
|
-
| `doc2mcp <
|
|
64
|
+
| [`doc2mcp <docs-url>`](#doc2mcp-docs-url) | Crawl a docs site and generate a hosted MCP server |
|
|
65
|
+
| [`doc2mcp login`](#doc2mcp-login) | Authorize the CLI in your browser |
|
|
66
|
+
| [`doc2mcp logout`](#doc2mcp-logout) | Remove stored credentials from this machine |
|
|
67
|
+
| [`doc2mcp whoami`](#doc2mcp-whoami) | Show the account you're signed in as |
|
|
68
|
+
| [`doc2mcp list`](#doc2mcp-list) | List the MCP projects on your account |
|
|
69
|
+
| [`doc2mcp install <projectId>`](#doc2mcp-install-projectid) | Install an existing MCP into your editors |
|
|
70
|
+
| `doc2mcp --version` | Print the installed CLI version |
|
|
71
|
+
| `doc2mcp --help` | Show usage and all commands |
|
|
72
|
+
|
|
73
|
+
---
|
|
33
74
|
|
|
34
|
-
|
|
75
|
+
### `doc2mcp <docs-url>`
|
|
76
|
+
|
|
77
|
+
Crawl a documentation site and generate a hosted, token-secured MCP server. This is the default
|
|
78
|
+
command — the core of the tool.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
doc2mcp https://docs.stripe.com
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
What happens:
|
|
85
|
+
|
|
86
|
+
1. The job runs the hosted pipeline: **crawl → analyze → generate**.
|
|
87
|
+
2. Live progress streams in your terminal until the project is `ready`.
|
|
88
|
+
3. You're prompted to install the MCP into any detected editors.
|
|
89
|
+
|
|
90
|
+
Tips:
|
|
91
|
+
|
|
92
|
+
- Point at the **docs** URL (`https://docs.stripe.com`), not the marketing homepage.
|
|
93
|
+
- The URL must start with `http://` or `https://`.
|
|
94
|
+
- Conversions count against your plan's monthly limit (free includes 5/month), shared with the
|
|
95
|
+
website, Playground, and chat.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### `doc2mcp login`
|
|
100
|
+
|
|
101
|
+
Authorize the CLI using a browser-based device flow — no copy-pasting tokens by hand.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
doc2mcp login
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
1. A short code is shown and your browser opens to the authorization page.
|
|
108
|
+
2. Approve access while signed in to [doc2mcp.site](https://doc2mcp.site).
|
|
109
|
+
3. The CLI receives a personal access token and stores it at `~/.doc2mcp/config.json`.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### `doc2mcp logout`
|
|
114
|
+
|
|
115
|
+
Remove the stored credentials from this machine.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
doc2mcp logout
|
|
119
|
+
```
|
|
35
120
|
|
|
36
|
-
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `doc2mcp whoami`
|
|
124
|
+
|
|
125
|
+
Print the account the CLI is currently signed in as.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
doc2mcp whoami
|
|
129
|
+
# → Signed in as you@example.com
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### `doc2mcp list`
|
|
135
|
+
|
|
136
|
+
List the MCP projects on your account, with their status and project IDs (use an ID with `install`).
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
doc2mcp list
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### `doc2mcp install <projectId>`
|
|
145
|
+
|
|
146
|
+
Install an MCP you already created into your local editors — without re-running the conversion.
|
|
147
|
+
Great for putting an existing project on a new machine.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
doc2mcp install prj_123abc
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
You'll be prompted to choose which detected clients to write to:
|
|
154
|
+
|
|
155
|
+
| Editor | Config written |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| **Cursor** | `~/.cursor/mcp.json` (`mcpServers`) |
|
|
158
|
+
| **VS Code** | user `mcp.json` (`servers`) |
|
|
159
|
+
| **Claude Desktop** | `claude_desktop_config.json` (`mcpServers`) |
|
|
160
|
+
| **Windsurf** | `~/.codeium/windsurf/mcp_config.json` (`mcpServers`) |
|
|
161
|
+
|
|
162
|
+
Existing config is merged, not overwritten.
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
| Setting | Default | Notes |
|
|
37
167
|
| --- | --- | --- |
|
|
38
|
-
|
|
|
168
|
+
| Credentials file | `~/.doc2mcp/config.json` | Stores your API URL, token, and user info |
|
|
169
|
+
| `DOC2MCP_API_URL` | `https://doc2mcp.site` | Override the API base URL (use for local dev / self-hosting) |
|
|
170
|
+
|
|
171
|
+
## Troubleshooting
|
|
172
|
+
|
|
173
|
+
| Symptom | Fix |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| `command not found: doc2mcp` | You installed locally. Reinstall with `npm i -g doc2mcp`, or use `npx doc2mcp <url>`. |
|
|
176
|
+
| Browser doesn't open on `login` | Copy the printed URL into your browser manually, then approve. |
|
|
177
|
+
| `login` can't reach the server | Confirm you're online; for self-hosting set `DOC2MCP_API_URL` to your instance. |
|
|
178
|
+
| "Limit reached" | You've hit your plan's monthly conversion limit (shared across CLI, web, and Playground). |
|
|
179
|
+
| Editor doesn't pick up the MCP | Fully restart the editor after install so it reloads MCP config. |
|
|
180
|
+
|
|
181
|
+
## How it works
|
|
39
182
|
|
|
40
|
-
|
|
183
|
+
doc2mcp runs the same hosted pipeline as the web app:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
docs URL ─▶ crawl ─▶ analyze ─▶ generate ─▶ hosted MCP endpoint (token-secured)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Your editor connects over MCP and can search, read, and **cite** the real documentation — no
|
|
190
|
+
hallucinated APIs. Read more in the [docs](https://doc2mcp.site/docs).
|
|
41
191
|
|
|
42
192
|
## Local development
|
|
43
193
|
|
|
@@ -47,16 +197,22 @@ pnpm install
|
|
|
47
197
|
pnpm build
|
|
48
198
|
node dist/index.js --help
|
|
49
199
|
|
|
50
|
-
# Point at local Next app
|
|
200
|
+
# Point the CLI at a local Next.js app
|
|
51
201
|
DOC2MCP_API_URL=http://localhost:3000 node dist/index.js login
|
|
52
202
|
```
|
|
53
203
|
|
|
54
|
-
|
|
204
|
+
Publishing is automated: bump the `version` in `cli/package.json` and push to `main` — the
|
|
205
|
+
`Publish CLI` GitHub Actions workflow publishes the new version to npm (it no-ops if the version
|
|
206
|
+
already exists).
|
|
55
207
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
208
|
+
## Links
|
|
209
|
+
|
|
210
|
+
- 📦 npm: https://www.npmjs.com/package/doc2mcp
|
|
211
|
+
- 🌐 Website: https://doc2mcp.site
|
|
212
|
+
- 🕹️ Playground: https://doc2mcp.site/playground
|
|
213
|
+
- 📚 Docs: https://doc2mcp.site/docs
|
|
214
|
+
- 🧭 CLI guide: https://doc2mcp.site/docs/cli
|
|
215
|
+
|
|
216
|
+
## License
|
|
61
217
|
|
|
62
|
-
|
|
218
|
+
[MIT](https://github.com/gautammanak1/doc2mcp/blob/main/LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
|
|
4
3
|
// src/index.ts
|
|
5
4
|
import { Command } from "commander";
|
|
@@ -15,7 +14,7 @@ import { dirname } from "path";
|
|
|
15
14
|
// src/config.ts
|
|
16
15
|
import { homedir } from "os";
|
|
17
16
|
import { join } from "path";
|
|
18
|
-
var DEFAULT_API_URL = "https://doc2mcp.
|
|
17
|
+
var DEFAULT_API_URL = "https://doc2mcp.site";
|
|
19
18
|
function getConfigPath() {
|
|
20
19
|
return join(homedir(), ".doc2mcp", "config.json");
|
|
21
20
|
}
|
|
@@ -535,7 +534,7 @@ async function runList() {
|
|
|
535
534
|
|
|
536
535
|
// src/index.ts
|
|
537
536
|
var program = new Command();
|
|
538
|
-
program.name("doc2mcp").description("Generate documentation MCP servers from your terminal").version("0.1.
|
|
537
|
+
program.name("doc2mcp").description("Generate documentation MCP servers from your terminal").version("0.1.14", "-v, --version", "Print the installed CLI version");
|
|
539
538
|
program.command("login").description("Authorize the CLI via browser").action(async () => {
|
|
540
539
|
await runLogin();
|
|
541
540
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doc2mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.14",
|
|
4
|
+
"description": "Turn any documentation site into a hosted MCP server from your terminal — for Cursor, Claude, VS Code, Windsurf, and OpenAI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"doc2mcp": "./dist/index.js"
|
|
8
8
|
},
|
|
9
|
+
"homepage": "https://doc2mcp.site",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/gautammanak1/doc2mcp.git",
|
|
13
|
+
"directory": "cli"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/gautammanak1/doc2mcp/issues"
|
|
17
|
+
},
|
|
9
18
|
"files": [
|
|
10
19
|
"dist",
|
|
11
20
|
"README.md"
|
|
@@ -20,10 +29,19 @@
|
|
|
20
29
|
},
|
|
21
30
|
"keywords": [
|
|
22
31
|
"mcp",
|
|
32
|
+
"model-context-protocol",
|
|
23
33
|
"documentation",
|
|
34
|
+
"docs",
|
|
24
35
|
"cli",
|
|
25
36
|
"cursor",
|
|
26
|
-
"
|
|
37
|
+
"claude",
|
|
38
|
+
"windsurf",
|
|
39
|
+
"vscode",
|
|
40
|
+
"openai",
|
|
41
|
+
"ai",
|
|
42
|
+
"agents",
|
|
43
|
+
"rag",
|
|
44
|
+
"llm"
|
|
27
45
|
],
|
|
28
46
|
"license": "MIT",
|
|
29
47
|
"dependencies": {
|