@upstash/context7-mcp 1.0.13 → 1.0.15
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 +674 -88
- package/dist/index.js +131 -51
- package/dist/lib/api.js +31 -11
- package/dist/lib/encryption.js +35 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Context7 MCP - Up-to-date Code Docs For Any Prompt
|
|
2
2
|
|
|
3
|
-
[](https://context7.com) [](https://smithery.ai/server/@upstash/context7-mcp)
|
|
3
|
+
[](https://context7.com) [](https://smithery.ai/server/@upstash/context7-mcp)
|
|
4
4
|
|
|
5
|
-
[](https://cursor.com/en/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D) [<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/Install%20in%20VS%20Code-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22context7%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40upstash%2Fcontext7-mcp%40latest%22%5D%7D)
|
|
6
|
+
|
|
7
|
+
[](./docs/README.zh-TW.md) [](./docs/README.zh-CN.md) [](./docs/README.ja.md) [](./docs/README.ko.md) [](./docs/README.es.md) [](./docs/README.fr.md) [-purple>)](./docs/README.pt-BR.md) [](./docs/README.it.md) [](./docs/README.id-ID.md) [](./docs/README.de.md) [](./docs/README.ru.md) [](./docs/README.uk.md) [](./docs/README.tr.md) [](./docs/README.ar.md) [](./docs/README.vi.md)
|
|
6
8
|
|
|
7
9
|
## ❌ Without Context7
|
|
8
10
|
|
|
@@ -19,11 +21,11 @@ Context7 MCP pulls up-to-date, version-specific documentation and code examples
|
|
|
19
21
|
Add `use context7` to your prompt in Cursor:
|
|
20
22
|
|
|
21
23
|
```txt
|
|
22
|
-
Create a
|
|
24
|
+
Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to `/login`. use context7
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
```txt
|
|
26
|
-
|
|
28
|
+
Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
Context7 fetches up-to-date code examples and documentation right into your LLM's context.
|
|
@@ -43,7 +45,8 @@ Check out our [project addition guide](./docs/adding-projects.md) to learn how t
|
|
|
43
45
|
### Requirements
|
|
44
46
|
|
|
45
47
|
- Node.js >= v18.0.0
|
|
46
|
-
- Cursor,
|
|
48
|
+
- Cursor, Claude Code, VSCode, Windsurf or another MCP Client
|
|
49
|
+
- Context7 API Key (Optional for higher rate limits) (Get yours by creating an account at [context7.com/console](https://context7.com/console))
|
|
47
50
|
|
|
48
51
|
<details>
|
|
49
52
|
<summary><b>Installing via Smithery</b></summary>
|
|
@@ -69,13 +72,16 @@ Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file i
|
|
|
69
72
|
|
|
70
73
|
#### Cursor Remote Server Connection
|
|
71
74
|
|
|
72
|
-
[](https://cursor.com/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D)
|
|
75
|
+
[](https://cursor.com/en/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D)
|
|
73
76
|
|
|
74
77
|
```json
|
|
75
78
|
{
|
|
76
79
|
"mcpServers": {
|
|
77
80
|
"context7": {
|
|
78
|
-
"url": "https://mcp.context7.com/mcp"
|
|
81
|
+
"url": "https://mcp.context7.com/mcp",
|
|
82
|
+
"headers": {
|
|
83
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
84
|
+
}
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
@@ -83,61 +89,50 @@ Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file i
|
|
|
83
89
|
|
|
84
90
|
#### Cursor Local Server Connection
|
|
85
91
|
|
|
86
|
-
[](https://cursor.com/install-mcp?name=context7&config=eyJjb21tYW5kIjoibnB4IC15IEB1cHN0YXNoL2NvbnRleHQ3LW1jcCJ9)
|
|
92
|
+
[](https://cursor.com/en/install-mcp?name=context7&config=eyJjb21tYW5kIjoibnB4IC15IEB1cHN0YXNoL2NvbnRleHQ3LW1jcCJ9)
|
|
87
93
|
|
|
88
94
|
```json
|
|
89
95
|
{
|
|
90
96
|
"mcpServers": {
|
|
91
97
|
"context7": {
|
|
92
98
|
"command": "npx",
|
|
93
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
99
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
```
|
|
98
104
|
|
|
105
|
+
</details>
|
|
106
|
+
|
|
99
107
|
<details>
|
|
100
|
-
<summary>
|
|
108
|
+
<summary><b>Install in Claude Code</b></summary>
|
|
101
109
|
|
|
102
|
-
[
|
|
110
|
+
Run this command. See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp) for more info.
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"command": "bunx",
|
|
109
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
112
|
+
#### Claude Code Remote Server Connection
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: YOUR_API_KEY"
|
|
113
116
|
```
|
|
114
117
|
|
|
115
|
-
|
|
118
|
+
Or using SSE transport:
|
|
116
119
|
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
```sh
|
|
121
|
+
claude mcp add --transport sse context7 https://mcp.context7.com/sse --header "CONTEXT7_API_KEY: YOUR_API_KEY"
|
|
122
|
+
```
|
|
119
123
|
|
|
120
|
-
|
|
124
|
+
#### Claude Code Local Server Connection
|
|
121
125
|
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
"mcpServers": {
|
|
125
|
-
"context7": {
|
|
126
|
-
"command": "deno",
|
|
127
|
-
"args": ["run", "--allow-env", "--allow-net", "npm:@upstash/context7-mcp"]
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
126
|
+
```sh
|
|
127
|
+
claude mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
|
|
131
128
|
```
|
|
132
129
|
|
|
133
130
|
</details>
|
|
134
131
|
|
|
135
|
-
</details>
|
|
136
|
-
|
|
137
132
|
<details>
|
|
138
133
|
<summary><b>Install in Windsurf</b></summary>
|
|
139
134
|
|
|
140
|
-
Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.
|
|
135
|
+
Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/cascade/mcp) for more info.
|
|
141
136
|
|
|
142
137
|
#### Windsurf Remote Server Connection
|
|
143
138
|
|
|
@@ -145,7 +140,10 @@ Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.
|
|
|
145
140
|
{
|
|
146
141
|
"mcpServers": {
|
|
147
142
|
"context7": {
|
|
148
|
-
"serverUrl": "https://mcp.context7.com/
|
|
143
|
+
"serverUrl": "https://mcp.context7.com/mcp",
|
|
144
|
+
"headers": {
|
|
145
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
146
|
+
}
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
}
|
|
@@ -158,7 +156,7 @@ Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.
|
|
|
158
156
|
"mcpServers": {
|
|
159
157
|
"context7": {
|
|
160
158
|
"command": "npx",
|
|
161
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
159
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
162
160
|
}
|
|
163
161
|
}
|
|
164
162
|
}
|
|
@@ -181,7 +179,10 @@ Add this to your VS Code MCP config file. See [VS Code MCP docs](https://code.vi
|
|
|
181
179
|
"servers": {
|
|
182
180
|
"context7": {
|
|
183
181
|
"type": "http",
|
|
184
|
-
"url": "https://mcp.context7.com/mcp"
|
|
182
|
+
"url": "https://mcp.context7.com/mcp",
|
|
183
|
+
"headers": {
|
|
184
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
185
|
+
}
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
}
|
|
@@ -195,7 +196,7 @@ Add this to your VS Code MCP config file. See [VS Code MCP docs](https://code.vi
|
|
|
195
196
|
"context7": {
|
|
196
197
|
"type": "stdio",
|
|
197
198
|
"command": "npx",
|
|
198
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
199
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
}
|
|
@@ -203,6 +204,20 @@ Add this to your VS Code MCP config file. See [VS Code MCP docs](https://code.vi
|
|
|
203
204
|
|
|
204
205
|
</details>
|
|
205
206
|
|
|
207
|
+
<details>
|
|
208
|
+
<summary>
|
|
209
|
+
<b>Install in Cline</b>
|
|
210
|
+
</summary>
|
|
211
|
+
|
|
212
|
+
You can easily install Context7 through the [Cline MCP Server Marketplace](https://cline.bot/mcp-marketplace) by following these instructions:
|
|
213
|
+
|
|
214
|
+
1. Open **Cline**.
|
|
215
|
+
2. Click the hamburger menu icon (☰) to enter the **MCP Servers** section.
|
|
216
|
+
3. Use the search bar within the **Marketplace** tab to find _Context7_.
|
|
217
|
+
4. Click the **Install** button.
|
|
218
|
+
|
|
219
|
+
</details>
|
|
220
|
+
|
|
206
221
|
<details>
|
|
207
222
|
<summary><b>Install in Zed</b></summary>
|
|
208
223
|
|
|
@@ -214,7 +229,7 @@ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Contex
|
|
|
214
229
|
"Context7": {
|
|
215
230
|
"command": {
|
|
216
231
|
"path": "npx",
|
|
217
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
232
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
218
233
|
},
|
|
219
234
|
"settings": {}
|
|
220
235
|
}
|
|
@@ -225,59 +240,319 @@ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Contex
|
|
|
225
240
|
</details>
|
|
226
241
|
|
|
227
242
|
<details>
|
|
228
|
-
<summary><b>Install in
|
|
243
|
+
<summary><b>Install in Augment Code</b></summary>
|
|
229
244
|
|
|
230
|
-
|
|
245
|
+
To configure Context7 MCP in Augment Code, you can use either the graphical interface or manual configuration.
|
|
231
246
|
|
|
232
|
-
|
|
247
|
+
### **A. Using the Augment Code UI**
|
|
233
248
|
|
|
234
|
-
|
|
235
|
-
|
|
249
|
+
1. Click the hamburger menu.
|
|
250
|
+
2. Select **Settings**.
|
|
251
|
+
3. Navigate to the **Tools** section.
|
|
252
|
+
4. Click the **+ Add MCP** button.
|
|
253
|
+
5. Enter the following command:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
npx -y @upstash/context7-mcp@latest
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
6. Name the MCP: **Context7**.
|
|
260
|
+
7. Click the **Add** button.
|
|
261
|
+
|
|
262
|
+
Once the MCP server is added, you can start using Context7's up-to-date code documentation features directly within Augment Code.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### **B. Manual Configuration**
|
|
267
|
+
|
|
268
|
+
1. Press Cmd/Ctrl Shift P or go to the hamburger menu in the Augment panel
|
|
269
|
+
2. Select Edit Settings
|
|
270
|
+
3. Under Advanced, click Edit in settings.json
|
|
271
|
+
4. Add the server configuration to the `mcpServers` array in the `augment.advanced` object
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
"augment.advanced": {
|
|
275
|
+
"mcpServers": [
|
|
276
|
+
{
|
|
277
|
+
"name": "context7",
|
|
278
|
+
"command": "npx",
|
|
279
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|
|
236
283
|
```
|
|
237
284
|
|
|
238
|
-
|
|
285
|
+
Once the MCP server is added, restart your editor. If you receive any errors, check the syntax to make sure closing brackets or commas are not missing.
|
|
239
286
|
|
|
240
|
-
|
|
241
|
-
|
|
287
|
+
</details>
|
|
288
|
+
|
|
289
|
+
<details>
|
|
290
|
+
<summary><b>Install in Roo Code</b></summary>
|
|
291
|
+
|
|
292
|
+
Add this to your Roo Code MCP configuration file. See [Roo Code MCP docs](https://docs.roocode.com/features/mcp/using-mcp-in-roo) for more info.
|
|
293
|
+
|
|
294
|
+
#### Roo Code Remote Server Connection
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"mcpServers": {
|
|
299
|
+
"context7": {
|
|
300
|
+
"type": "streamable-http",
|
|
301
|
+
"url": "https://mcp.context7.com/mcp"
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Roo Code Local Server Connection
|
|
308
|
+
|
|
309
|
+
```json
|
|
310
|
+
{
|
|
311
|
+
"mcpServers": {
|
|
312
|
+
"context7": {
|
|
313
|
+
"command": "npx",
|
|
314
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
242
318
|
```
|
|
243
319
|
|
|
244
320
|
</details>
|
|
245
321
|
|
|
322
|
+
<details>
|
|
323
|
+
<summary><b>Install in Gemini CLI</b></summary>
|
|
324
|
+
|
|
325
|
+
See [Gemini CLI Configuration](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html) for details.
|
|
326
|
+
|
|
327
|
+
1. Open the Gemini CLI settings file. The location is `~/.gemini/settings.json` (where `~` is your home directory).
|
|
328
|
+
2. Add the following to the `mcpServers` object in your `settings.json` file:
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"mcpServers": {
|
|
333
|
+
"context7": {
|
|
334
|
+
"httpUrl": "https://mcp.context7.com/mcp",
|
|
335
|
+
"headers": {
|
|
336
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Or, for a local server:
|
|
344
|
+
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"mcpServers": {
|
|
348
|
+
"context7": {
|
|
349
|
+
"command": "npx",
|
|
350
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
If the `mcpServers` object does not exist, create it.
|
|
357
|
+
|
|
358
|
+
</details>
|
|
359
|
+
|
|
246
360
|
<details>
|
|
247
361
|
<summary><b>Install in Claude Desktop</b></summary>
|
|
248
362
|
|
|
249
|
-
|
|
363
|
+
#### Remote Server Connection
|
|
364
|
+
|
|
365
|
+
Open Claude Desktop and navigate to Settings > Connectors > Add Custom Connector. Enter the name as `Context7` and the remote MCP server URL as `https://mcp.context7.com/mcp`.
|
|
366
|
+
|
|
367
|
+
#### Local Server Connection
|
|
368
|
+
|
|
369
|
+
Open Claude Desktop developer settings and edit your `claude_desktop_config.json` file to add the following configuration. See [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user) for more info.
|
|
370
|
+
|
|
371
|
+
```json
|
|
372
|
+
{
|
|
373
|
+
"mcpServers": {
|
|
374
|
+
"context7": {
|
|
375
|
+
"command": "npx",
|
|
376
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
</details>
|
|
383
|
+
|
|
384
|
+
<details>
|
|
385
|
+
<summary><b>Install in Opencode</b></summary>
|
|
386
|
+
|
|
387
|
+
Add this to your Opencode configuration file. See [Opencode MCP docs](https://opencode.ai/docs/mcp-servers) docs for more info.
|
|
388
|
+
|
|
389
|
+
#### Opencode Remote Server Connection
|
|
390
|
+
|
|
391
|
+
```json
|
|
392
|
+
"mcp": {
|
|
393
|
+
"context7": {
|
|
394
|
+
"type": "remote",
|
|
395
|
+
"url": "https://mcp.context7.com/mcp",
|
|
396
|
+
"headers": {
|
|
397
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
398
|
+
},
|
|
399
|
+
"enabled": true
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
#### Opencode Local Server Connection
|
|
405
|
+
|
|
406
|
+
```json
|
|
407
|
+
{
|
|
408
|
+
"mcp": {
|
|
409
|
+
"context7": {
|
|
410
|
+
"type": "local",
|
|
411
|
+
"command": ["npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
|
|
412
|
+
"enabled": true
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
</details>
|
|
419
|
+
<details>
|
|
420
|
+
<summary><b>Install in OpenAI Codex</b></summary>
|
|
421
|
+
|
|
422
|
+
See [OpenAI Codex](https://github.com/openai/codex) for more information.
|
|
423
|
+
|
|
424
|
+
Add the following configuration to your OpenAI Codex MCP server settings:
|
|
425
|
+
|
|
426
|
+
```toml
|
|
427
|
+
[mcp_servers.context7]
|
|
428
|
+
args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
429
|
+
command = "npx"
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
</details>
|
|
433
|
+
|
|
434
|
+
<details>
|
|
435
|
+
<summary><b>Install in JetBrains AI Assistant</b></summary>
|
|
436
|
+
|
|
437
|
+
See [JetBrains AI Assistant Documentation](https://www.jetbrains.com/help/ai-assistant/configure-an-mcp-server.html) for more details.
|
|
438
|
+
|
|
439
|
+
1. In JetBrains IDEs go to `Settings` -> `Tools` -> `AI Assistant` -> `Model Context Protocol (MCP)`
|
|
440
|
+
2. Click `+ Add`.
|
|
441
|
+
3. Click on `Command` in the top-left corner of the dialog and select the As JSON option from the list
|
|
442
|
+
4. Add this configuration and click `OK`
|
|
443
|
+
|
|
444
|
+
```json
|
|
445
|
+
{
|
|
446
|
+
"mcpServers": {
|
|
447
|
+
"context7": {
|
|
448
|
+
"command": "npx",
|
|
449
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
5. Click `Apply` to save changes.
|
|
456
|
+
6. The same way context7 could be added for JetBrains Junie in `Settings` -> `Tools` -> `Junie` -> `MCP Settings`
|
|
457
|
+
|
|
458
|
+
</details>
|
|
459
|
+
|
|
460
|
+
<details>
|
|
461
|
+
|
|
462
|
+
<summary><b>Install in Kiro</b></summary>
|
|
463
|
+
|
|
464
|
+
See [Kiro Model Context Protocol Documentation](https://kiro.dev/docs/mcp/configuration/) for details.
|
|
465
|
+
|
|
466
|
+
1. Navigate `Kiro` > `MCP Servers`
|
|
467
|
+
2. Add a new MCP server by clicking the `+ Add` button.
|
|
468
|
+
3. Paste the configuration given below:
|
|
250
469
|
|
|
251
470
|
```json
|
|
252
471
|
{
|
|
253
472
|
"mcpServers": {
|
|
254
473
|
"Context7": {
|
|
255
474
|
"command": "npx",
|
|
256
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
475
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
|
|
476
|
+
"env": {},
|
|
477
|
+
"disabled": false,
|
|
478
|
+
"autoApprove": []
|
|
257
479
|
}
|
|
258
480
|
}
|
|
259
481
|
}
|
|
260
482
|
```
|
|
261
483
|
|
|
484
|
+
4. Click `Save` to apply the changes.
|
|
485
|
+
|
|
262
486
|
</details>
|
|
263
487
|
|
|
264
488
|
<details>
|
|
265
|
-
<summary><b>Install in
|
|
489
|
+
<summary><b>Install in Trae</b></summary>
|
|
266
490
|
|
|
267
|
-
|
|
491
|
+
Use the Add manually feature and fill in the JSON configuration information for that MCP server.
|
|
492
|
+
For more details, visit the [Trae documentation](https://docs.trae.ai/ide/model-context-protocol?_lang=en).
|
|
493
|
+
|
|
494
|
+
#### Trae Remote Server Connection
|
|
495
|
+
|
|
496
|
+
```json
|
|
497
|
+
{
|
|
498
|
+
"mcpServers": {
|
|
499
|
+
"context7": {
|
|
500
|
+
"url": "https://mcp.context7.com/mcp"
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
#### Trae Local Server Connection
|
|
268
507
|
|
|
269
508
|
```json
|
|
270
509
|
{
|
|
271
510
|
"mcpServers": {
|
|
272
511
|
"context7": {
|
|
273
512
|
"command": "npx",
|
|
274
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
513
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
275
514
|
}
|
|
276
515
|
}
|
|
277
516
|
}
|
|
278
517
|
```
|
|
279
518
|
|
|
280
|
-
|
|
519
|
+
</details>
|
|
520
|
+
|
|
521
|
+
<details>
|
|
522
|
+
<summary><b>Using Bun or Deno</b></summary>
|
|
523
|
+
|
|
524
|
+
Use these alternatives to run the local Context7 MCP server with other runtimes. These examples work for any client that supports launching a local MCP server via command + args.
|
|
525
|
+
|
|
526
|
+
#### Bun
|
|
527
|
+
|
|
528
|
+
```json
|
|
529
|
+
{
|
|
530
|
+
"mcpServers": {
|
|
531
|
+
"context7": {
|
|
532
|
+
"command": "bunx",
|
|
533
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
#### Deno
|
|
540
|
+
|
|
541
|
+
```json
|
|
542
|
+
{
|
|
543
|
+
"mcpServers": {
|
|
544
|
+
"context7": {
|
|
545
|
+
"command": "deno",
|
|
546
|
+
"args": [
|
|
547
|
+
"run",
|
|
548
|
+
"--allow-env=NO_DEPRECATION,TRACE_DEPRECATION",
|
|
549
|
+
"--allow-net",
|
|
550
|
+
"npm:@upstash/context7-mcp"
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
```
|
|
281
556
|
|
|
282
557
|
</details>
|
|
283
558
|
|
|
@@ -341,6 +616,13 @@ If you prefer to run the MCP server in a Docker container:
|
|
|
341
616
|
|
|
342
617
|
</details>
|
|
343
618
|
|
|
619
|
+
<details>
|
|
620
|
+
<summary><b>Install Using the Desktop Extension</b></summary>
|
|
621
|
+
|
|
622
|
+
Install the [context7.dxt](dxt/context7.dxt) file under the dxt folder and add it to your client. For more information please check out [the desktop extensions docs](https://github.com/anthropics/dxt#desktop-extensions-dxt).
|
|
623
|
+
|
|
624
|
+
</details>
|
|
625
|
+
|
|
344
626
|
<details>
|
|
345
627
|
<summary><b>Install in Windows</b></summary>
|
|
346
628
|
|
|
@@ -351,7 +633,7 @@ The configuration on Windows is slightly different compared to Linux or macOS (_
|
|
|
351
633
|
"mcpServers": {
|
|
352
634
|
"github.com/upstash/context7-mcp": {
|
|
353
635
|
"command": "cmd",
|
|
354
|
-
"args": ["/c", "npx", "-y", "@upstash/context7-mcp
|
|
636
|
+
"args": ["/c", "npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
|
|
355
637
|
"disabled": false,
|
|
356
638
|
"autoApprove": []
|
|
357
639
|
}
|
|
@@ -362,57 +644,252 @@ The configuration on Windows is slightly different compared to Linux or macOS (_
|
|
|
362
644
|
</details>
|
|
363
645
|
|
|
364
646
|
<details>
|
|
365
|
-
<summary><b>Install in
|
|
647
|
+
<summary><b>Install in Amazon Q Developer CLI</b></summary>
|
|
366
648
|
|
|
367
|
-
|
|
649
|
+
Add this to your Amazon Q Developer CLI configuration file. See [Amazon Q Developer CLI docs](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-configuration.html) for more details.
|
|
368
650
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
651
|
+
```json
|
|
652
|
+
{
|
|
653
|
+
"mcpServers": {
|
|
654
|
+
"context7": {
|
|
655
|
+
"command": "npx",
|
|
656
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
</details>
|
|
663
|
+
|
|
664
|
+
<details>
|
|
665
|
+
<summary><b>Install in Warp</b></summary>
|
|
666
|
+
|
|
667
|
+
See [Warp Model Context Protocol Documentation](https://docs.warp.dev/knowledge-and-collaboration/mcp#adding-an-mcp-server) for details.
|
|
668
|
+
|
|
669
|
+
1. Navigate `Settings` > `AI` > `Manage MCP servers`.
|
|
670
|
+
2. Add a new MCP server by clicking the `+ Add` button.
|
|
671
|
+
3. Paste the configuration given below:
|
|
373
672
|
|
|
374
673
|
```json
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
674
|
+
{
|
|
675
|
+
"Context7": {
|
|
676
|
+
"command": "npx",
|
|
677
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
|
|
678
|
+
"env": {},
|
|
679
|
+
"working_directory": null,
|
|
680
|
+
"start_on_launch": true
|
|
681
|
+
}
|
|
383
682
|
}
|
|
384
683
|
```
|
|
385
684
|
|
|
386
|
-
|
|
685
|
+
4. Click `Save` to apply the changes.
|
|
387
686
|
|
|
388
687
|
</details>
|
|
389
688
|
|
|
390
689
|
<details>
|
|
391
|
-
<summary><b>Install in Roo Code</b></summary>
|
|
392
690
|
|
|
393
|
-
|
|
691
|
+
<summary><b>Install in Copilot Coding Agent</b></summary>
|
|
394
692
|
|
|
395
|
-
|
|
693
|
+
## Using Context7 with Copilot Coding Agent
|
|
694
|
+
|
|
695
|
+
Add the following configuration to the `mcp` section of your Copilot Coding Agent configuration file Repository->Settings->Copilot->Coding agent->MCP configuration:
|
|
696
|
+
|
|
697
|
+
```json
|
|
698
|
+
{
|
|
699
|
+
"mcpServers": {
|
|
700
|
+
"context7": {
|
|
701
|
+
"type": "http",
|
|
702
|
+
"url": "https://mcp.context7.com/mcp",
|
|
703
|
+
"headers": {
|
|
704
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
705
|
+
},
|
|
706
|
+
"tools": ["get-library-docs", "resolve-library-id"]
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
For more information, see the [official GitHub documentation](https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp).
|
|
713
|
+
|
|
714
|
+
</details>
|
|
715
|
+
|
|
716
|
+
<details>
|
|
717
|
+
<summary><b>Install in LM Studio</b></summary>
|
|
718
|
+
|
|
719
|
+
See [LM Studio MCP Support](https://lmstudio.ai/blog/lmstudio-v0.3.17) for more information.
|
|
720
|
+
|
|
721
|
+
#### One-click install:
|
|
722
|
+
|
|
723
|
+
[](https://lmstudio.ai/install-mcp?name=context7&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB1cHN0YXNoL2NvbnRleHQ3LW1jcCJdfQ%3D%3D)
|
|
724
|
+
|
|
725
|
+
#### Manual set-up:
|
|
726
|
+
|
|
727
|
+
1. Navigate to `Program` (right side) > `Install` > `Edit mcp.json`.
|
|
728
|
+
2. Paste the configuration given below:
|
|
729
|
+
|
|
730
|
+
```json
|
|
731
|
+
{
|
|
732
|
+
"mcpServers": {
|
|
733
|
+
"Context7": {
|
|
734
|
+
"command": "npx",
|
|
735
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
3. Click `Save` to apply the changes.
|
|
742
|
+
4. Toggle the MCP server on/off from the right hand side, under `Program`, or by clicking the plug icon at the bottom of the chat box.
|
|
743
|
+
|
|
744
|
+
</details>
|
|
745
|
+
|
|
746
|
+
<details>
|
|
747
|
+
<summary><b>Install in Visual Studio 2022</b></summary>
|
|
748
|
+
|
|
749
|
+
You can configure Context7 MCP in Visual Studio 2022 by following the [Visual Studio MCP Servers documentation](https://learn.microsoft.com/visualstudio/ide/mcp-servers?view=vs-2022).
|
|
750
|
+
|
|
751
|
+
Add this to your Visual Studio MCP config file (see the [Visual Studio docs](https://learn.microsoft.com/visualstudio/ide/mcp-servers?view=vs-2022) for details):
|
|
752
|
+
|
|
753
|
+
```json
|
|
754
|
+
{
|
|
755
|
+
"mcp": {
|
|
756
|
+
"servers": {
|
|
757
|
+
"context7": {
|
|
758
|
+
"type": "http",
|
|
759
|
+
"url": "https://mcp.context7.com/mcp"
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
Or, for a local server:
|
|
767
|
+
|
|
768
|
+
```json
|
|
769
|
+
{
|
|
770
|
+
"mcp": {
|
|
771
|
+
"servers": {
|
|
772
|
+
"context7": {
|
|
773
|
+
"type": "stdio",
|
|
774
|
+
"command": "npx",
|
|
775
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
For more information and troubleshooting, refer to the [Visual Studio MCP Servers documentation](https://learn.microsoft.com/visualstudio/ide/mcp-servers?view=vs-2022).
|
|
783
|
+
|
|
784
|
+
</details>
|
|
785
|
+
|
|
786
|
+
<details>
|
|
787
|
+
<summary><b>Install in Crush</b></summary>
|
|
788
|
+
|
|
789
|
+
Add this to your Crush configuration file. See [Crush MCP docs](https://github.com/charmbracelet/crush#mcps) for more info.
|
|
790
|
+
|
|
791
|
+
#### Crush Remote Server Connection (HTTP)
|
|
792
|
+
|
|
793
|
+
```json
|
|
794
|
+
{
|
|
795
|
+
"$schema": "https://charm.land/crush.json",
|
|
796
|
+
"mcp": {
|
|
797
|
+
"context7": {
|
|
798
|
+
"type": "http",
|
|
799
|
+
"url": "https://mcp.context7.com/mcp",
|
|
800
|
+
"headers": {
|
|
801
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
#### Crush Remote Server Connection (SSE)
|
|
809
|
+
|
|
810
|
+
```json
|
|
811
|
+
{
|
|
812
|
+
"$schema": "https://charm.land/crush.json",
|
|
813
|
+
"mcp": {
|
|
814
|
+
"context7": {
|
|
815
|
+
"type": "sse",
|
|
816
|
+
"url": "https://mcp.context7.com/sse",
|
|
817
|
+
"headers": {
|
|
818
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
#### Crush Local Server Connection
|
|
826
|
+
|
|
827
|
+
```json
|
|
828
|
+
{
|
|
829
|
+
"$schema": "https://charm.land/crush.json",
|
|
830
|
+
"mcp": {
|
|
831
|
+
"context7": {
|
|
832
|
+
"type": "stdio",
|
|
833
|
+
"command": "npx",
|
|
834
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
</details>
|
|
841
|
+
|
|
842
|
+
<details>
|
|
843
|
+
<summary><b>Install in BoltAI</b></summary>
|
|
844
|
+
|
|
845
|
+
Open the "Settings" page of the app, navigate to "Plugins," and enter the following JSON:
|
|
846
|
+
|
|
847
|
+
```json
|
|
848
|
+
{
|
|
849
|
+
"mcpServers": {
|
|
850
|
+
"context7": {
|
|
851
|
+
"command": "npx",
|
|
852
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
Once saved, enter in the chat `get-library-docs` followed by your Context7 documentation ID (e.g., `get-library-docs /nuxt/ui`). More information is available on [BoltAI's Documentation site](https://docs.boltai.com/docs/plugins/mcp-servers). For BoltAI on iOS, [see this guide](https://docs.boltai.com/docs/boltai-mobile/mcp-servers).
|
|
859
|
+
|
|
860
|
+
</details>
|
|
861
|
+
|
|
862
|
+
<details>
|
|
863
|
+
<summary><b>Install in Rovo Dev CLI</b></summary>
|
|
864
|
+
|
|
865
|
+
Edit your Rovo Dev CLI MCP config by running the command below -
|
|
866
|
+
|
|
867
|
+
```bash
|
|
868
|
+
acli rovodev mcp
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
Example config -
|
|
872
|
+
|
|
873
|
+
#### Remote Server Connection
|
|
396
874
|
|
|
397
875
|
```json
|
|
398
876
|
{
|
|
399
877
|
"mcpServers": {
|
|
400
878
|
"context7": {
|
|
401
|
-
"type": "streamable-http",
|
|
402
879
|
"url": "https://mcp.context7.com/mcp"
|
|
403
880
|
}
|
|
404
881
|
}
|
|
405
882
|
}
|
|
406
883
|
```
|
|
407
884
|
|
|
408
|
-
####
|
|
885
|
+
#### Local Server Connection
|
|
409
886
|
|
|
410
887
|
```json
|
|
411
888
|
{
|
|
412
889
|
"mcpServers": {
|
|
413
890
|
"context7": {
|
|
414
891
|
"command": "npx",
|
|
415
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
892
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
416
893
|
}
|
|
417
894
|
}
|
|
418
895
|
}
|
|
@@ -420,28 +897,87 @@ Add this to your Roo Code MCP configuration file. See [Roo Code MCP docs](https:
|
|
|
420
897
|
|
|
421
898
|
</details>
|
|
422
899
|
|
|
423
|
-
|
|
900
|
+
<details>
|
|
901
|
+
<summary><b>Install in Zencoder</b></summary>
|
|
902
|
+
|
|
903
|
+
To configure Context7 MCP in Zencoder, follow these steps:
|
|
904
|
+
|
|
905
|
+
1. Go to the Zencoder menu (...)
|
|
906
|
+
2. From the dropdown menu, select Agent tools
|
|
907
|
+
3. Click on the Add custom MCP
|
|
908
|
+
4. Add the name and server configuration from below, and make sure to hit the Install button
|
|
909
|
+
|
|
910
|
+
```json
|
|
911
|
+
{
|
|
912
|
+
"command": "npx",
|
|
913
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
914
|
+
}
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
Once the MCP server is added, you can easily continue using it.
|
|
918
|
+
|
|
919
|
+
</details>
|
|
920
|
+
|
|
921
|
+
<details>
|
|
922
|
+
<summary><b>Install in Qodo Gen</b></summary>
|
|
424
923
|
|
|
425
|
-
|
|
924
|
+
See [Qodo Gen docs](https://docs.qodo.ai/qodo-documentation/qodo-gen/qodo-gen-chat/agentic-mode/agentic-tools-mcps) for more details.
|
|
426
925
|
|
|
427
|
-
|
|
926
|
+
1. Open Qodo Gen chat panel in VSCode or IntelliJ.
|
|
927
|
+
2. Click Connect more tools.
|
|
928
|
+
3. Click + Add new MCP.
|
|
929
|
+
4. Add the following configuration:
|
|
428
930
|
|
|
429
|
-
|
|
931
|
+
#### Qodo Gen Local Server Connection
|
|
430
932
|
|
|
431
933
|
```json
|
|
432
934
|
{
|
|
433
935
|
"mcpServers": {
|
|
434
936
|
"context7": {
|
|
435
937
|
"command": "npx",
|
|
436
|
-
"args": ["-y", "@upstash/context7-mcp"]
|
|
437
|
-
"env": {
|
|
438
|
-
"DEFAULT_MINIMUM_TOKENS": "6000"
|
|
439
|
-
}
|
|
938
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
|
|
440
939
|
}
|
|
441
940
|
}
|
|
442
941
|
}
|
|
443
942
|
```
|
|
444
943
|
|
|
944
|
+
#### Qodo Gen Remote Server Connection
|
|
945
|
+
|
|
946
|
+
```json
|
|
947
|
+
{
|
|
948
|
+
"mcpServers": {
|
|
949
|
+
"context7": {
|
|
950
|
+
"url": "https://mcp.context7.com/mcp"
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
</details>
|
|
957
|
+
|
|
958
|
+
<details>
|
|
959
|
+
<summary><b>Install in Perplexity Desktop</b></summary>
|
|
960
|
+
|
|
961
|
+
See [Local and Remote MCPs for Perplexity](https://www.perplexity.ai/help-center/en/articles/11502712-local-and-remote-mcps-for-perplexity) for more information.
|
|
962
|
+
|
|
963
|
+
1. Navigate `Perplexity` > `Settings`
|
|
964
|
+
2. Select `Connectors`.
|
|
965
|
+
3. Click `Add Connector`.
|
|
966
|
+
4. Select `Advanced`.
|
|
967
|
+
5. Enter Server Name: `Context7`
|
|
968
|
+
6. Paste the following JSON in the text area:
|
|
969
|
+
|
|
970
|
+
```json
|
|
971
|
+
{
|
|
972
|
+
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
|
|
973
|
+
"command": "npx",
|
|
974
|
+
"env": {}
|
|
975
|
+
}
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
7. Click `Save`.
|
|
979
|
+
</details>
|
|
980
|
+
|
|
445
981
|
## 🔨 Available Tools
|
|
446
982
|
|
|
447
983
|
Context7 MCP provides the following tools that LLMs can use:
|
|
@@ -453,7 +989,31 @@ Context7 MCP provides the following tools that LLMs can use:
|
|
|
453
989
|
- `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
|
|
454
990
|
- `context7CompatibleLibraryID` (required): Exact Context7-compatible library ID (e.g., `/mongodb/docs`, `/vercel/next.js`)
|
|
455
991
|
- `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
|
|
456
|
-
- `tokens` (optional, default 10000): Max number of tokens to return. Values less than the
|
|
992
|
+
- `tokens` (optional, default 10000): Max number of tokens to return. Values less than the default value of 10000 are automatically increased to 10000.
|
|
993
|
+
|
|
994
|
+
## 🛟 Tips
|
|
995
|
+
|
|
996
|
+
### Add a Rule
|
|
997
|
+
|
|
998
|
+
> If you don’t want to add `use context7` to every prompt, you can define a simple rule in your `.windsurfrules` file in Windsurf or from `Cursor Settings > Rules` section in Cursor (or the equivalent in your MCP client) to auto-invoke Context7 on any code question:
|
|
999
|
+
>
|
|
1000
|
+
> ```toml
|
|
1001
|
+
> [[calls]]
|
|
1002
|
+
> match = "when the user requests code examples, setup or configuration steps, or library/API documentation"
|
|
1003
|
+
> tool = "context7"
|
|
1004
|
+
> ```
|
|
1005
|
+
>
|
|
1006
|
+
> From then on you’ll get Context7’s docs in any related conversation without typing anything extra. You can add your use cases to the match part.
|
|
1007
|
+
|
|
1008
|
+
### Use Library Id
|
|
1009
|
+
|
|
1010
|
+
> If you already know exactly which library you want to use, add its Context7 ID to your prompt. That way, Context7 MCP server can skip the library-matching step and directly continue with retrieving docs.
|
|
1011
|
+
>
|
|
1012
|
+
> ```txt
|
|
1013
|
+
> implement basic authentication with supabase. use library /supabase/supabase for api and docs
|
|
1014
|
+
> ```
|
|
1015
|
+
>
|
|
1016
|
+
> The slash syntax tells the MCP tool exactly which library to load docs for.
|
|
457
1017
|
|
|
458
1018
|
## 💻 Development
|
|
459
1019
|
|
|
@@ -469,6 +1029,32 @@ Build:
|
|
|
469
1029
|
bun run build
|
|
470
1030
|
```
|
|
471
1031
|
|
|
1032
|
+
Run the server:
|
|
1033
|
+
|
|
1034
|
+
```bash
|
|
1035
|
+
bun run dist/index.js
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
### CLI Arguments
|
|
1039
|
+
|
|
1040
|
+
`context7-mcp` accepts the following CLI flags:
|
|
1041
|
+
|
|
1042
|
+
- `--transport <stdio|http>` – Transport to use (`stdio` by default). Note that HTTP transport automatically provides both HTTP and SSE endpoints.
|
|
1043
|
+
- `--port <number>` – Port to listen on when using `http` transport (default `3000`).
|
|
1044
|
+
- `--api-key <key>` – API key for authentication. You can get your API key by creating an account at [context7.com/console](https://context7.com/console).
|
|
1045
|
+
|
|
1046
|
+
Example with http transport and port 8080:
|
|
1047
|
+
|
|
1048
|
+
```bash
|
|
1049
|
+
bun run dist/index.js --transport http --port 8080
|
|
1050
|
+
```
|
|
1051
|
+
|
|
1052
|
+
Another example with stdio transport:
|
|
1053
|
+
|
|
1054
|
+
```bash
|
|
1055
|
+
bun run dist/index.js --transport stdio --api-key YOUR_API_KEY
|
|
1056
|
+
```
|
|
1057
|
+
|
|
472
1058
|
<details>
|
|
473
1059
|
<summary><b>Local Configuration Example</b></summary>
|
|
474
1060
|
|
|
@@ -477,7 +1063,7 @@ bun run build
|
|
|
477
1063
|
"mcpServers": {
|
|
478
1064
|
"context7": {
|
|
479
1065
|
"command": "npx",
|
|
480
|
-
"args": ["tsx", "/path/to/folder/context7-mcp/src/index.ts"]
|
|
1066
|
+
"args": ["tsx", "/path/to/folder/context7-mcp/src/index.ts", "--api-key", "YOUR_API_KEY"]
|
|
481
1067
|
}
|
|
482
1068
|
}
|
|
483
1069
|
}
|
|
@@ -570,7 +1156,7 @@ Context7 projects are community-contributed and while we strive to maintain high
|
|
|
570
1156
|
|
|
571
1157
|
Stay updated and join our community:
|
|
572
1158
|
|
|
573
|
-
- 📢 Follow us on [X](https://x.com/
|
|
1159
|
+
- 📢 Follow us on [X](https://x.com/context7ai) for the latest news and updates
|
|
574
1160
|
- 🌐 Visit our [Website](https://context7.com)
|
|
575
1161
|
- 💬 Join our [Discord Community](https://upstash.com/discord)
|
|
576
1162
|
|