@upstash/context7-mcp 1.0.0 → 1.0.1-canary-20251124144836

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
@@ -1,96 +1,1539 @@
1
- # Context7 MCP Server
1
+ ![Cover](public/cover.png)
2
2
 
3
- In this repository, we provide an MCP Server for [Context7](https://context7.com), which offers access to high-quality documentation for popular libraries.
3
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](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)
4
4
 
5
- This lets you use Cursor, Windsurf, Claude Desktop, or any MCP Client, to use natural language to search and access documentation for libraries, e.g.:
5
+ # Context7 MCP - Up-to-date Code Docs For Any Prompt
6
6
 
7
- - "What are the main features of React hooks?"
8
- - "How do I implement authentication with Next.js?"
9
- - "Rate limiting with Redis"
10
- - "Get examples of using React Query"
7
+ [![Website](https://img.shields.io/badge/Website-context7.com-blue)](https://context7.com) [![smithery badge](https://smithery.ai/badge/@upstash/context7-mcp)](https://smithery.ai/server/@upstash/context7-mcp) [![NPM Version](https://img.shields.io/npm/v/%40upstash%2Fcontext7-mcp?color=red)](https://www.npmjs.com/package/@upstash/context7-mcp) [![MIT licensed](https://img.shields.io/npm/l/%40upstash%2Fcontext7-mcp)](./LICENSE)
11
8
 
12
- ## Usage
9
+ [![繁體中文](https://img.shields.io/badge/docs-繁體中文-yellow)](./i18n/README.zh-TW.md) [![简体中文](https://img.shields.io/badge/docs-简体中文-yellow)](./i18n/README.zh-CN.md) [![日本語](https://img.shields.io/badge/docs-日本語-b7003a)](./i18n/README.ja.md) [![한국어 문서](https://img.shields.io/badge/docs-한국어-green)](./i18n/README.ko.md) [![Documentación en Español](https://img.shields.io/badge/docs-Español-orange)](./i18n/README.es.md) [![Documentation en Français](https://img.shields.io/badge/docs-Français-blue)](./i18n/README.fr.md) [![Documentação em Português (Brasil)](<https://img.shields.io/badge/docs-Português%20(Brasil)-purple>)](./i18n/README.pt-BR.md) [![Documentazione in italiano](https://img.shields.io/badge/docs-Italian-red)](./i18n/README.it.md) [![Dokumentasi Bahasa Indonesia](https://img.shields.io/badge/docs-Bahasa%20Indonesia-pink)](./i18n/README.id-ID.md) [![Dokumentation auf Deutsch](https://img.shields.io/badge/docs-Deutsch-darkgreen)](./i18n/README.de.md) [![Документация на русском языке](https://img.shields.io/badge/docs-Русский-darkblue)](./i18n/README.ru.md) [![Українська документація](https://img.shields.io/badge/docs-Українська-lightblue)](./i18n/README.uk.md) [![Türkçe Doküman](https://img.shields.io/badge/docs-Türkçe-blue)](./i18n/README.tr.md) [![Arabic Documentation](https://img.shields.io/badge/docs-Arabic-white)](./i18n/README.ar.md) [![Tiếng Việt](https://img.shields.io/badge/docs-Tiếng%20Việt-red)](./i18n/README.vi.md)
10
+
11
+ ## ❌ Without Context7
12
+
13
+ LLMs rely on outdated or generic information about the libraries you use. You get:
14
+
15
+ - ❌ Code examples are outdated and based on year-old training data
16
+ - ❌ Hallucinated APIs that don't even exist
17
+ - ❌ Generic answers for old package versions
18
+
19
+ ## ✅ With Context7
20
+
21
+ Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.
22
+
23
+ Add `use context7` to your prompt (or [set up a rule](#️-installation) to auto-invoke):
24
+
25
+ ```txt
26
+ Create a Next.js middleware that checks for a valid JWT in cookies
27
+ and redirects unauthenticated users to `/login`. use context7
28
+ ```
29
+
30
+ ```txt
31
+ Configure a Cloudflare Worker script to cache
32
+ JSON API responses for five minutes. use context7
33
+ ```
34
+
35
+ Context7 fetches up-to-date code examples and documentation right into your LLM's context.
36
+
37
+ - 1️⃣ Write your prompt naturally
38
+ - 2️⃣ Tell the LLM to `use context7` (or [set up a rule](#️-installation) once)
39
+ - 3️⃣ Get working code answers
40
+
41
+ No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.
42
+
43
+ > [!NOTE]
44
+ > This repository hosts the source code of Context7 MCP server. The supporting components — API backend, parsing engine, and crawling engine — are private and not part of this release.
45
+
46
+ ## 📚 Adding Projects
47
+
48
+ Check out our [project addition guide](https://context7.com/docs/adding-libraries) to learn how to add (or update) your favorite libraries to Context7.
49
+
50
+ ## 🛠️ Installation
13
51
 
14
52
  ### Requirements
15
53
 
16
- - Node.js >= v18.0.0
17
- - Cursor, Windsurf, Claude Desktop or another MCP Client
54
+ - Node.js >= v18.0.0
55
+ - Cursor, Claude Code, VSCode, Windsurf or another MCP Client
56
+ - Context7 API Key (Optional) for higher rate limits and private repositories (Get yours by creating an account at [context7.com/dashboard](https://context7.com/dashboard))
57
+
58
+ > [!TIP]
59
+ > **Recommended Post-Setup: Add a Rule to Auto-Invoke Context7**
60
+ >
61
+ > After installing Context7 (see instructions below), enhance your workflow by adding a rule so you don't have to type `use context7` in every prompt. Define a simple rule in your MCP client's rule section to automatically invoke Context7 on any code question:
62
+ >
63
+ > - For Windsurf, in `.windsurfrules` file
64
+ > - For Cursor, from `Cursor Settings > Rules` section
65
+ > - For Claude Code, in `CLAUDE.md` file
66
+ > - Or the equivalent in your MCP client
67
+ >
68
+ > **Example Rule:**
69
+ >
70
+ > ```txt
71
+ > Always use context7 when I need code generation, setup or configuration steps, or
72
+ > library/API documentation. This means you should automatically use the Context7 MCP
73
+ > tools to resolve library id and get library docs without me having to explicitly ask.
74
+ > ```
75
+ >
76
+ > From then on, you'll get Context7's docs in any related conversation without typing anything extra. You can alter the rule to match your use cases.
77
+
78
+ <details>
79
+ <summary><b>Installing via Smithery</b></summary>
80
+
81
+ To install Context7 MCP Server for any client automatically via [Smithery](https://smithery.ai/server/@upstash/context7-mcp):
82
+
83
+ ```bash
84
+ npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>
85
+ ```
86
+
87
+ You can find your Smithery key in the [Smithery.ai webpage](https://smithery.ai/server/@upstash/context7-mcp).
88
+
89
+ </details>
90
+
91
+ <details>
92
+ <summary><b>Install in Cursor</b></summary>
93
+
94
+ Go to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server`
95
+
96
+ Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file is the recommended approach. You may also install in a specific project by creating `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.
97
+
98
+ > Since Cursor 1.0, you can click the install button below for instant one-click installation.
99
+
100
+ #### Cursor Remote Server Connection
101
+
102
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D)
103
+
104
+ ```json
105
+ {
106
+ "mcpServers": {
107
+ "context7": {
108
+ "url": "https://mcp.context7.com/mcp",
109
+ "headers": {
110
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ #### Cursor Local Server Connection
118
+
119
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=context7&config=eyJjb21tYW5kIjoibnB4IC15IEB1cHN0YXNoL2NvbnRleHQ3LW1jcCJ9)
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "context7": {
125
+ "command": "npx",
126
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ </details>
133
+
134
+ <details>
135
+ <summary><b>Install in Claude Code</b></summary>
136
+
137
+ Run this command. See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/claude-code/mcp) for more info.
138
+
139
+ #### Claude Code Remote Server Connection
140
+
141
+ ```sh
142
+ claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: YOUR_API_KEY"
143
+ ```
144
+
145
+ #### Claude Code Local Server Connection
146
+
147
+ ```sh
148
+ claude mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
149
+ ```
150
+
151
+ </details>
152
+
153
+ <details>
154
+ <summary><b>Install in Amp</b></summary>
155
+
156
+ Run this command in your terminal. See [Amp MCP docs](https://ampcode.com/manual#mcp) for more info.
157
+
158
+ #### Without API Key (Basic Usage)
159
+
160
+ ```sh
161
+ amp mcp add context7 https://mcp.context7.com/mcp
162
+ ```
163
+
164
+ #### With API Key (Higher Rate Limits & Private Repos)
165
+
166
+ ```sh
167
+ amp mcp add context7 --header "CONTEXT7_API_KEY=YOUR_API_KEY" https://mcp.context7.com/mcp
168
+ ```
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary><b>Install in Windsurf</b></summary>
174
+
175
+ Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/cascade/mcp) for more info.
176
+
177
+ #### Windsurf Remote Server Connection
178
+
179
+ ```json
180
+ {
181
+ "mcpServers": {
182
+ "context7": {
183
+ "serverUrl": "https://mcp.context7.com/mcp",
184
+ "headers": {
185
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
186
+ }
187
+ }
188
+ }
189
+ }
190
+ ```
191
+
192
+ #### Windsurf Local Server Connection
193
+
194
+ ```json
195
+ {
196
+ "mcpServers": {
197
+ "context7": {
198
+ "command": "npx",
199
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ </details>
206
+
207
+ <details>
208
+ <summary><b>Install in VS Code</b></summary>
209
+
210
+ [<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Context7%20MCP&color=0098FF">](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)
211
+ [<img alt="Install in VS Code Insiders (npx)" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Context7%20MCP&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%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)
212
+
213
+ Add this to your VS Code MCP config file. See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.
214
+
215
+ #### VS Code Remote Server Connection
216
+
217
+ ```json
218
+ "mcp": {
219
+ "servers": {
220
+ "context7": {
221
+ "type": "http",
222
+ "url": "https://mcp.context7.com/mcp",
223
+ "headers": {
224
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ #### VS Code Local Server Connection
232
+
233
+ ```json
234
+ "mcp": {
235
+ "servers": {
236
+ "context7": {
237
+ "type": "stdio",
238
+ "command": "npx",
239
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
240
+ }
241
+ }
242
+ }
243
+ ```
244
+
245
+ </details>
246
+
247
+ <details>
248
+ <summary>
249
+ <b>Install in Cline</b>
250
+ </summary>
251
+
252
+ You can easily install Context7 through the [Cline MCP Server Marketplace](https://cline.bot/mcp-marketplace) by following these instructions:
253
+
254
+ 1. Open **Cline**.
255
+ 2. Click the hamburger menu icon (☰) to enter the **MCP Servers** section.
256
+ 3. Use the search bar within the **Marketplace** tab to find _Context7_.
257
+ 4. Click the **Install** button.
258
+
259
+ Or you can directly edit MCP servers configuration:
260
+
261
+ 1. Open **Cline**.
262
+ 2. Click the hamburger menu icon (☰) to enter the **MCP Servers** section.
263
+ 3. Choose **Remote Servers** tab.
264
+ 4. Click the **Edit Configuration** button.
265
+ 5. Add context7 to `mcpServers`:
266
+
267
+ ```json
268
+ {
269
+ "mcpServers": {
270
+ "context7": {
271
+ "url": "https://mcp.context7.com/mcp",
272
+ "type": "streamableHttp",
273
+ "headers": {
274
+ "Authorization": "Bearer YOUR_API_KEY"
275
+ }
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ </details>
282
+
283
+ <details>
284
+ <summary><b>Install in Zed</b></summary>
285
+
286
+ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Context7) or you can add this to your Zed `settings.json`. See [Zed Context Server docs](https://zed.dev/docs/assistant/context-servers) for more info.
287
+
288
+ ```json
289
+ {
290
+ "context_servers": {
291
+ "Context7": {
292
+ "source": "custom",
293
+ "command": "npx",
294
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
295
+ }
296
+ }
297
+ }
298
+ ```
299
+
300
+ </details>
301
+
302
+ <details>
303
+ <summary><b>Install in Augment Code</b></summary>
304
+
305
+ To configure Context7 MCP in Augment Code, you can use either the graphical interface or manual configuration.
306
+
307
+ ### **A. Using the Augment Code UI**
308
+
309
+ 1. Click the hamburger menu.
310
+ 2. Select **Settings**.
311
+ 3. Navigate to the **Tools** section.
312
+ 4. Click the **+ Add MCP** button.
313
+ 5. Enter the following command:
314
+
315
+ ```
316
+ npx -y @upstash/context7-mcp@latest
317
+ ```
318
+
319
+ 6. Name the MCP: **Context7**.
320
+ 7. Click the **Add** button.
321
+
322
+ Once the MCP server is added, you can start using Context7's up-to-date code documentation features directly within Augment Code.
323
+
324
+ ---
325
+
326
+ ### **B. Manual Configuration**
327
+
328
+ 1. Press Cmd/Ctrl Shift P or go to the hamburger menu in the Augment panel
329
+ 2. Select Edit Settings
330
+ 3. Under Advanced, click Edit in settings.json
331
+ 4. Add the server configuration to the `mcpServers` array in the `augment.advanced` object
332
+
333
+ ```json
334
+ "augment.advanced": {
335
+ "mcpServers": [
336
+ {
337
+ "name": "context7",
338
+ "command": "npx",
339
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
340
+ }
341
+ ]
342
+ }
343
+ ```
344
+
345
+ 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.
346
+
347
+ </details>
348
+
349
+ <details>
350
+ <summary><b>Install in Kilo Code</b></summary>
351
+
352
+ You can configure the Context7 MCP server in **Kilo Code** using either the UI or by editing your project's MCP configuration file.
353
+
354
+ Kilo Code supports two configuration levels:
355
+
356
+ - **Global MCP Configuration** — stored in `mcp_settings.json`
357
+ - **Project-level MCP Configuration** — stored in `.kilocode/mcp.json` (recommended)
358
+
359
+ If a server is defined in both places, the **project-level configuration overrides the global one**.
360
+
361
+ ---
362
+
363
+ ## Configure via Kilo Code UI
364
+
365
+ 1. Open **Kilo Code**.
366
+ 2. Click the **Settings** icon in the top-right corner.
367
+ 3. Navigate to **Settings → MCP Servers**.
368
+ 4. Click **Add Server**.
369
+ 5. Choose **HTTP Server** (Streamable HTTP Transport).
370
+ 6. Enter the details:
371
+
372
+ **URL**
373
+ `https://mcp.context7.com/mcp`
374
+
375
+ **Headers → Add Header**
376
+
377
+ - **Key:** `Authorization`
378
+ - **Value:** `Bearer YOUR_API_KEY`
379
+
380
+ 7. Click **Save**.
381
+ 8. Ensure the server toggle is **enabled**.
382
+ 9. If needed, click **Refresh MCP Servers** to reload the configuration.
383
+
384
+ ---
385
+
386
+ ## Manual Configuration (`.kilocode/mcp.json`)
387
+
388
+ To configure the server at the project level (recommended for team environments), create the following file:
389
+
390
+ **`.kilocode/mcp.json`:**
391
+
392
+ ```json
393
+ {
394
+ "mcpServers": {
395
+ "context7": {
396
+ "type": "streamable-http",
397
+ "url": "https://mcp.context7.com/mcp",
398
+ "headers": {
399
+ "Authorization": "Bearer YOUR_API_KEY"
400
+ },
401
+ "alwaysAllow": [],
402
+ "disabled": false
403
+ }
404
+ }
405
+ }
406
+ ```
407
+
408
+ Replace YOUR_API_KEY with your actual Context7 API key.
409
+
410
+ After saving the file:
411
+
412
+ - Open Settings → MCP Servers
413
+
414
+ - Click Refresh MCP Servers
415
+
416
+ Kilo Code will automatically detect and load the configuration.
417
+
418
+ </details>
419
+
420
+ <details>
421
+ <summary><b>Install in Google Antigravity</b></summary>
422
+
423
+ Add this to your Antigravity MCP config file. See [Antigravity MCP docs](https://antigravity.google/docs/mcp) for more info.
424
+
425
+ #### Google Antigravity Remote Server Connection
426
+
427
+ ```json
428
+ {
429
+ "mcpServers": {
430
+ "context7": {
431
+ "serverUrl": "https://mcp.context7.com/mcp",
432
+ "headers": {
433
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
434
+ }
435
+ }
436
+ }
437
+ }
438
+ ```
439
+
440
+ #### Google Antigravity Local Server Connection
441
+
442
+ ```json
443
+ {
444
+ "mcpServers": {
445
+ "context7": {
446
+ "command": "npx",
447
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
448
+ }
449
+ }
450
+ }
451
+ ```
452
+
453
+ </details>
454
+
455
+ <details>
456
+ <summary><b>Install in Roo Code</b></summary>
457
+
458
+ 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.
459
+
460
+ #### Roo Code Remote Server Connection
461
+
462
+ ```json
463
+ {
464
+ "mcpServers": {
465
+ "context7": {
466
+ "type": "streamable-http",
467
+ "url": "https://mcp.context7.com/mcp",
468
+ "headers": {
469
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
470
+ }
471
+ }
472
+ }
473
+ }
474
+ ```
475
+
476
+ #### Roo Code Local Server Connection
477
+
478
+ ```json
479
+ {
480
+ "mcpServers": {
481
+ "context7": {
482
+ "command": "npx",
483
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
484
+ }
485
+ }
486
+ }
487
+ ```
488
+
489
+ </details>
490
+
491
+ <details>
492
+ <summary><b>Install in Gemini CLI</b></summary>
493
+
494
+ See [Gemini CLI Configuration](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html) for details.
495
+
496
+ 1. Open the Gemini CLI settings file. The location is `~/.gemini/settings.json` (where `~` is your home directory).
497
+ 2. Add the following to the `mcpServers` object in your `settings.json` file:
498
+
499
+ ```json
500
+ {
501
+ "mcpServers": {
502
+ "context7": {
503
+ "httpUrl": "https://mcp.context7.com/mcp",
504
+ "headers": {
505
+ "CONTEXT7_API_KEY": "YOUR_API_KEY",
506
+ "Accept": "application/json, text/event-stream"
507
+ }
508
+ }
509
+ }
510
+ }
511
+ ```
512
+
513
+ Or, for a local server:
514
+
515
+ ```json
516
+ {
517
+ "mcpServers": {
518
+ "context7": {
519
+ "command": "npx",
520
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
521
+ }
522
+ }
523
+ }
524
+ ```
525
+
526
+ If the `mcpServers` object does not exist, create it.
527
+
528
+ </details>
529
+
530
+ <details>
531
+ <summary><b>Install in Qwen Coder</b></summary>
532
+
533
+ See [Qwen Coder MCP Configuration](https://qwenlm.github.io/qwen-code-docs/en/tools/mcp-server/#how-to-set-up-your-mcp-server) for details.
534
+
535
+ 1. Open the Qwen Coder settings file. The location is `~/.qwen/settings.json` (where `~` is your home directory).
536
+ 2. Add the following to the `mcpServers` object in your `settings.json` file:
537
+
538
+ ```json
539
+ {
540
+ "mcpServers": {
541
+ "context7": {
542
+ "httpUrl": "https://mcp.context7.com/mcp",
543
+ "headers": {
544
+ "CONTEXT7_API_KEY": "YOUR_API_KEY",
545
+ "Accept": "application/json, text/event-stream"
546
+ }
547
+ }
548
+ }
549
+ }
550
+ ```
551
+
552
+ Or, for a local server:
553
+
554
+ ```json
555
+ {
556
+ "mcpServers": {
557
+ "context7": {
558
+ "command": "npx",
559
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
560
+ }
561
+ }
562
+ }
563
+ ```
564
+
565
+ If the `mcpServers` object does not exist, create it.
566
+
567
+ </details>
568
+
569
+ <details>
570
+ <summary><b>Install in Claude Desktop</b></summary>
571
+
572
+ #### Remote Server Connection
573
+
574
+ 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`.
575
+
576
+ #### Local Server Connection
577
+
578
+ 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.
579
+
580
+ ```json
581
+ {
582
+ "mcpServers": {
583
+ "context7": {
584
+ "command": "npx",
585
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
586
+ }
587
+ }
588
+ }
589
+ ```
590
+
591
+ </details>
592
+
593
+ <details>
594
+ <summary><b>Install in Opencode</b></summary>
595
+
596
+ Add this to your Opencode configuration file. See [Opencode MCP docs](https://opencode.ai/docs/mcp-servers) for more info.
597
+
598
+ #### Opencode Remote Server Connection
599
+
600
+ ```json
601
+ "mcp": {
602
+ "context7": {
603
+ "type": "remote",
604
+ "url": "https://mcp.context7.com/mcp",
605
+ "headers": {
606
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
607
+ },
608
+ "enabled": true
609
+ }
610
+ }
611
+ ```
612
+
613
+ #### Opencode Local Server Connection
614
+
615
+ ```json
616
+ {
617
+ "mcp": {
618
+ "context7": {
619
+ "type": "local",
620
+ "command": ["npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
621
+ "enabled": true
622
+ }
623
+ }
624
+ }
625
+ ```
626
+
627
+ </details>
628
+
629
+ <details>
630
+ <summary><b>Install in OpenAI Codex</b></summary>
631
+
632
+ See [OpenAI Codex](https://github.com/openai/codex) for more information.
633
+
634
+ Add the following configuration to your OpenAI Codex MCP server settings:
635
+
636
+ #### Local Server Connection
637
+
638
+ ```toml
639
+ [mcp_servers.context7]
640
+ args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
641
+ command = "npx"
642
+ startup_timeout_ms = 20_000
643
+ ```
644
+
645
+ #### Remote Server Connection
646
+
647
+ ```toml
648
+ [mcp_servers.context7]
649
+ url = "https://mcp.context7.com/mcp"
650
+ http_headers = { "CONTEXT7_API_KEY" = "YOUR_API_KEY" }
651
+ ```
652
+
653
+ > Optional troubleshooting — only if you see startup "request timed out" or "not found program". Most users can ignore this.
654
+ >
655
+ > - First try: increase `startup_timeout_ms` to `40_000` and retry.
656
+ > - Windows quick fix (absolute `npx` path + explicit env):
657
+ >
658
+ > ```toml
659
+ > [mcp_servers.context7]
660
+ > command = "C:\\Users\\yourname\\AppData\\Roaming\\npm\\npx.cmd"
661
+ > args = [
662
+ > "-y",
663
+ > "@upstash/context7-mcp",
664
+ > "--api-key",
665
+ > "YOUR_API_KEY"
666
+ > ]
667
+ > env = { SystemRoot="C:\\Windows", APPDATA="C:\\Users\\yourname\\AppData\\Roaming" }
668
+ > startup_timeout_ms = 40_000
669
+ > ```
670
+ >
671
+ > - macOS quick fix (use Node + installed package entry point):
672
+ >
673
+ > ```toml
674
+ > [mcp_servers.context7]
675
+ > command = "/Users/yourname/.nvm/versions/node/v22.14.0/bin/node"
676
+ > args = ["/Users/yourname/.nvm/versions/node/v22.14.0/lib/node_modules/@upstash/context7-mcp/dist/index.js",
677
+ > "--transport",
678
+ > "stdio",
679
+ > "--api-key",
680
+ > "YOUR_API_KEY"
681
+ > ]
682
+ > ```
683
+ >
684
+ > Notes: Replace `yourname` with your OS username. Explicitly setting `APPDATA` and `SystemRoot` is essential because these are required by `npx` on Windows but not set by certain versions of OpenAI Codex mcp clients by default.
685
+
686
+ </details>
687
+
688
+ <details>
689
+
690
+ <summary><b>Install in JetBrains AI Assistant</b></summary>
691
+
692
+ See [JetBrains AI Assistant Documentation](https://www.jetbrains.com/help/ai-assistant/configure-an-mcp-server.html) for more details.
693
+
694
+ 1. In JetBrains IDEs, go to `Settings` -> `Tools` -> `AI Assistant` -> `Model Context Protocol (MCP)`
695
+ 2. Click `+ Add`.
696
+ 3. Click on `Command` in the top-left corner of the dialog and select the As JSON option from the list
697
+ 4. Add this configuration and click `OK`
698
+
699
+ ```json
700
+ {
701
+ "mcpServers": {
702
+ "context7": {
703
+ "command": "npx",
704
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
705
+ }
706
+ }
707
+ }
708
+ ```
709
+
710
+ 5. Click `Apply` to save changes.
711
+ 6. The same way context7 could be added for JetBrains Junie in `Settings` -> `Tools` -> `Junie` -> `MCP Settings`
712
+
713
+ </details>
714
+
715
+ <details>
716
+
717
+ <summary><b>Install in Kiro</b></summary>
718
+
719
+ See [Kiro Model Context Protocol Documentation](https://kiro.dev/docs/mcp/configuration/) for details.
720
+
721
+ 1. Navigate `Kiro` > `MCP Servers`
722
+ 2. Add a new MCP server by clicking the `+ Add` button.
723
+ 3. Paste the configuration given below:
724
+
725
+ ```json
726
+ {
727
+ "mcpServers": {
728
+ "Context7": {
729
+ "command": "npx",
730
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
731
+ "env": {},
732
+ "disabled": false,
733
+ "autoApprove": []
734
+ }
735
+ }
736
+ }
737
+ ```
738
+
739
+ 4. Click `Save` to apply the changes.
740
+
741
+ </details>
742
+
743
+ <details>
744
+ <summary><b>Install in Trae</b></summary>
745
+
746
+ Use the Add manually feature and fill in the JSON configuration information for that MCP server.
747
+ For more details, visit the [Trae documentation](https://docs.trae.ai/ide/model-context-protocol?_lang=en).
748
+
749
+ #### Trae Remote Server Connection
750
+
751
+ ```json
752
+ {
753
+ "mcpServers": {
754
+ "context7": {
755
+ "url": "https://mcp.context7.com/mcp"
756
+ }
757
+ }
758
+ }
759
+ ```
760
+
761
+ #### Trae Local Server Connection
762
+
763
+ ```json
764
+ {
765
+ "mcpServers": {
766
+ "context7": {
767
+ "command": "npx",
768
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
769
+ }
770
+ }
771
+ }
772
+ ```
773
+
774
+ </details>
775
+
776
+ <details>
777
+ <summary><b>Using Bun or Deno</b></summary>
778
+
779
+ 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.
780
+
781
+ #### Bun
782
+
783
+ ```json
784
+ {
785
+ "mcpServers": {
786
+ "context7": {
787
+ "command": "bunx",
788
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
789
+ }
790
+ }
791
+ }
792
+ ```
793
+
794
+ #### Deno
795
+
796
+ ```json
797
+ {
798
+ "mcpServers": {
799
+ "context7": {
800
+ "command": "deno",
801
+ "args": [
802
+ "run",
803
+ "--allow-env=NO_DEPRECATION,TRACE_DEPRECATION",
804
+ "--allow-net",
805
+ "npm:@upstash/context7-mcp"
806
+ ]
807
+ }
808
+ }
809
+ }
810
+ ```
811
+
812
+ </details>
813
+
814
+ <details>
815
+ <summary><b>Using Docker</b></summary>
816
+
817
+ If you prefer to run the MCP server in a Docker container:
818
+
819
+ 1. **Build the Docker Image:**
820
+
821
+ First, create a `Dockerfile` in the project root (or anywhere you prefer):
822
+
823
+ <details>
824
+ <summary>Click to see Dockerfile content</summary>
825
+
826
+ ```Dockerfile
827
+ FROM node:18-alpine
828
+
829
+ WORKDIR /app
830
+
831
+ # Install the latest version globally
832
+ RUN npm install -g @upstash/context7-mcp
833
+
834
+ # Expose default port if needed (optional, depends on MCP client interaction)
835
+ # EXPOSE 3000
836
+
837
+ # Default command to run the server
838
+ CMD ["context7-mcp"]
839
+ ```
840
+
841
+ </details>
842
+
843
+ Then, build the image using a tag (e.g., `context7-mcp`). **Make sure Docker Desktop (or the Docker daemon) is running.** Run the following command in the same directory where you saved the `Dockerfile`:
844
+
845
+ ```bash
846
+ docker build -t context7-mcp .
847
+ ```
848
+
849
+ 2. **Configure Your MCP Client:**
850
+
851
+ Update your MCP client's configuration to use the Docker command.
852
+
853
+ _Example for a cline_mcp_settings.json:_
854
+
855
+ ```json
856
+ {
857
+ "mcpServers": {
858
+ "Сontext7": {
859
+ "autoApprove": [],
860
+ "disabled": false,
861
+ "timeout": 60,
862
+ "command": "docker",
863
+ "args": ["run", "-i", "--rm", "context7-mcp"],
864
+ "transportType": "stdio"
865
+ }
866
+ }
867
+ }
868
+ ```
869
+
870
+ _Note: This is an example configuration. Please refer to the specific examples for your MCP client (like Cursor, VS Code, etc.) earlier in this README to adapt the structure (e.g., `mcpServers` vs `servers`). Also, ensure the image name in `args` matches the tag used during the `docker build` command._
871
+
872
+ </details>
873
+
874
+ <details>
875
+ <summary><b>Install Using the Desktop Extension</b></summary>
876
+
877
+ Install the [context7.mcpb](mcpb/context7.mcpb) file under the mcpb folder and add it to your client. For more information, please check out [MCP bundles docs](https://github.com/anthropics/mcpb#mcp-bundles-mcpb).
878
+
879
+ </details>
880
+
881
+ <details>
882
+ <summary><b>Install in Windows</b></summary>
883
+
884
+ The configuration on Windows is slightly different compared to Linux or macOS (_`Cline` is used in the example_). The same principle applies to other editors; refer to the configuration of `command` and `args`.
885
+
886
+ ```json
887
+ {
888
+ "mcpServers": {
889
+ "github.com/upstash/context7-mcp": {
890
+ "command": "cmd",
891
+ "args": ["/c", "npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
892
+ "disabled": false,
893
+ "autoApprove": []
894
+ }
895
+ }
896
+ }
897
+ ```
898
+
899
+ </details>
900
+
901
+ <details>
902
+ <summary><b>Install in Amazon Q Developer CLI</b></summary>
903
+
904
+ 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.
905
+
906
+ ```json
907
+ {
908
+ "mcpServers": {
909
+ "context7": {
910
+ "command": "npx",
911
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
912
+ }
913
+ }
914
+ }
915
+ ```
916
+
917
+ </details>
918
+
919
+ <details>
920
+ <summary><b>Install in Warp</b></summary>
921
+
922
+ See [Warp Model Context Protocol Documentation](https://docs.warp.dev/knowledge-and-collaboration/mcp#adding-an-mcp-server) for details.
923
+
924
+ 1. Navigate `Settings` > `AI` > `Manage MCP servers`.
925
+ 2. Add a new MCP server by clicking the `+ Add` button.
926
+ 3. Paste the configuration given below:
927
+
928
+ ```json
929
+ {
930
+ "Context7": {
931
+ "command": "npx",
932
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
933
+ "env": {},
934
+ "working_directory": null,
935
+ "start_on_launch": true
936
+ }
937
+ }
938
+ ```
939
+
940
+ 4. Click `Save` to apply the changes.
941
+
942
+ </details>
943
+
944
+ <details>
945
+
946
+ <summary><b>Install in Copilot Coding Agent</b></summary>
947
+
948
+ ## Using Context7 with Copilot Coding Agent
949
+
950
+ Add the following configuration to the `mcp` section of your Copilot Coding Agent configuration file Repository->Settings->Copilot->Coding agent->MCP configuration:
951
+
952
+ ```json
953
+ {
954
+ "mcpServers": {
955
+ "context7": {
956
+ "type": "http",
957
+ "url": "https://mcp.context7.com/mcp",
958
+ "headers": {
959
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
960
+ },
961
+ "tools": ["get-library-docs", "resolve-library-id"]
962
+ }
963
+ }
964
+ }
965
+ ```
966
+
967
+ 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).
968
+
969
+ </details>
970
+
971
+ <details>
972
+ <summary><b>Install in Copilot CLI</b></summary>
973
+
974
+ 1. Open the Copilot CLI MCP config file. The location is `~/.copilot/mcp-config.json` (where `~` is your home directory).
975
+ 2. Add the following to the `mcpServers` object in your `mcp-config.json` file:
976
+
977
+ ```json
978
+ {
979
+ "mcpServers": {
980
+ "context7": {
981
+ "type": "http",
982
+ "url": "https://mcp.context7.com/mcp",
983
+ "headers": {
984
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
985
+ },
986
+ "tools": ["get-library-docs", "resolve-library-id"]
987
+ }
988
+ }
989
+ }
990
+ ```
991
+
992
+ Or, for a local server:
993
+
994
+ ```json
995
+ {
996
+ "mcpServers": {
997
+ "context7": {
998
+ "type": "local",
999
+ "command": "npx",
1000
+ "tools": ["get-library-docs", "resolve-library-id"],
1001
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1002
+ }
1003
+ }
1004
+ }
1005
+ ```
1006
+
1007
+ If the `mcp-config.json` file does not exist, create it.
1008
+
1009
+ </details>
1010
+
1011
+ <details>
1012
+ <summary><b>Install in LM Studio</b></summary>
1013
+
1014
+ See [LM Studio MCP Support](https://lmstudio.ai/blog/lmstudio-v0.3.17) for more information.
1015
+
1016
+ #### One-click install:
1017
+
1018
+ [![Add MCP Server context7 to LM Studio](https://files.lmstudio.ai/deeplink/mcp-install-light.svg)](https://lmstudio.ai/install-mcp?name=context7&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB1cHN0YXNoL2NvbnRleHQ3LW1jcCJdfQ%3D%3D)
1019
+
1020
+ #### Manual set-up:
1021
+
1022
+ 1. Navigate to `Program` (right side) > `Install` > `Edit mcp.json`.
1023
+ 2. Paste the configuration given below:
1024
+
1025
+ ```json
1026
+ {
1027
+ "mcpServers": {
1028
+ "Context7": {
1029
+ "command": "npx",
1030
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1031
+ }
1032
+ }
1033
+ }
1034
+ ```
1035
+
1036
+ 3. Click `Save` to apply the changes.
1037
+ 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.
1038
+
1039
+ </details>
1040
+
1041
+ <details>
1042
+ <summary><b>Install in Visual Studio 2022</b></summary>
1043
+
1044
+ 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).
1045
+
1046
+ 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):
1047
+
1048
+ ```json
1049
+ {
1050
+ "inputs": [],
1051
+ "servers": {
1052
+ "context7": {
1053
+ "type": "http",
1054
+ "url": "https://mcp.context7.com/mcp",
1055
+ "headers": {
1056
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ ```
1062
+
1063
+ Or, for a local server:
1064
+
1065
+ ```json
1066
+ {
1067
+ "mcp": {
1068
+ "servers": {
1069
+ "context7": {
1070
+ "type": "stdio",
1071
+ "command": "npx",
1072
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1073
+ }
1074
+ }
1075
+ }
1076
+ }
1077
+ ```
1078
+
1079
+ For more information and troubleshooting, refer to the [Visual Studio MCP Servers documentation](https://learn.microsoft.com/visualstudio/ide/mcp-servers?view=vs-2022).
1080
+
1081
+ </details>
1082
+
1083
+ <details>
1084
+ <summary><b>Install in Crush</b></summary>
1085
+
1086
+ Add this to your Crush configuration file. See [Crush MCP docs](https://github.com/charmbracelet/crush#mcps) for more info.
1087
+
1088
+ #### Crush Remote Server Connection (HTTP)
1089
+
1090
+ ```json
1091
+ {
1092
+ "$schema": "https://charm.land/crush.json",
1093
+ "mcp": {
1094
+ "context7": {
1095
+ "type": "http",
1096
+ "url": "https://mcp.context7.com/mcp",
1097
+ "headers": {
1098
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ ```
1104
+
1105
+ #### Crush Local Server Connection
1106
+
1107
+ ```json
1108
+ {
1109
+ "$schema": "https://charm.land/crush.json",
1110
+ "mcp": {
1111
+ "context7": {
1112
+ "type": "stdio",
1113
+ "command": "npx",
1114
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1115
+ }
1116
+ }
1117
+ }
1118
+ ```
1119
+
1120
+ </details>
1121
+
1122
+ <details>
1123
+ <summary><b>Install in BoltAI</b></summary>
1124
+
1125
+ Open the "Settings" page of the app, navigate to "Plugins," and enter the following JSON:
1126
+
1127
+ ```json
1128
+ {
1129
+ "mcpServers": {
1130
+ "context7": {
1131
+ "command": "npx",
1132
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1133
+ }
1134
+ }
1135
+ }
1136
+ ```
1137
+
1138
+ 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).
18
1139
 
19
- ### How to use locally
1140
+ </details>
20
1141
 
21
- #### Installing for Cursor
1142
+ <details>
1143
+ <summary><b>Install in Rovo Dev CLI</b></summary>
22
1144
 
23
- Add this command to the MCP list in Cursor. For more info, check the [Cursor MCP](https://docs.cursor.com/context/model-context-protocol) docs.
1145
+ Edit your Rovo Dev CLI MCP config by running the command below -
24
1146
 
25
1147
  ```bash
26
- npx -y @upstash/context7-mcp
1148
+ acli rovodev mcp
27
1149
  ```
28
1150
 
29
- #### Installing for Windsurf
1151
+ Example config -
30
1152
 
31
- Add this to your Windsurf MCP config file. For more info, check the [Windsurf MCP](https://docs.windsurf.com/windsurf/mcp) docs.
1153
+ #### Remote Server Connection
1154
+
1155
+ ```json
1156
+ {
1157
+ "mcpServers": {
1158
+ "context7": {
1159
+ "url": "https://mcp.context7.com/mcp"
1160
+ }
1161
+ }
1162
+ }
1163
+ ```
1164
+
1165
+ #### Local Server Connection
32
1166
 
33
1167
  ```json
34
1168
  {
35
1169
  "mcpServers": {
36
1170
  "context7": {
37
1171
  "command": "npx",
38
- "args": ["-y", "@upstash/context7-mcp"]
1172
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1173
+ }
1174
+ }
1175
+ }
1176
+ ```
1177
+
1178
+ </details>
1179
+
1180
+ <details>
1181
+ <summary><b>Install in Zencoder</b></summary>
1182
+
1183
+ To configure Context7 MCP in Zencoder, follow these steps:
1184
+
1185
+ 1. Go to the Zencoder menu (...)
1186
+ 2. From the dropdown menu, select Agent tools
1187
+ 3. Click on the Add custom MCP
1188
+ 4. Add the name and server configuration from below, and make sure to hit the Install button
1189
+
1190
+ ```json
1191
+ {
1192
+ "command": "npx",
1193
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1194
+ }
1195
+ ```
1196
+
1197
+ Once the MCP server is added, you can easily continue using it.
1198
+
1199
+ </details>
1200
+
1201
+ <details>
1202
+ <summary><b>Install in Qodo Gen</b></summary>
1203
+
1204
+ See [Qodo Gen docs](https://docs.qodo.ai/qodo-documentation/qodo-gen/qodo-gen-chat/agentic-mode/agentic-tools-mcps) for more details.
1205
+
1206
+ 1. Open Qodo Gen chat panel in VSCode or IntelliJ.
1207
+ 2. Click Connect more tools.
1208
+ 3. Click + Add new MCP.
1209
+ 4. Add the following configuration:
1210
+
1211
+ #### Qodo Gen Local Server Connection
1212
+
1213
+ ```json
1214
+ {
1215
+ "mcpServers": {
1216
+ "context7": {
1217
+ "command": "npx",
1218
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
1219
+ }
1220
+ }
1221
+ }
1222
+ ```
1223
+
1224
+ #### Qodo Gen Remote Server Connection
1225
+
1226
+ ```json
1227
+ {
1228
+ "mcpServers": {
1229
+ "context7": {
1230
+ "url": "https://mcp.context7.com/mcp"
39
1231
  }
40
1232
  }
41
1233
  }
42
1234
  ```
43
1235
 
44
- ### Tools
1236
+ </details>
1237
+
1238
+ <details>
1239
+ <summary><b>Install in Perplexity Desktop</b></summary>
1240
+
1241
+ 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.
1242
+
1243
+ 1. Navigate `Perplexity` > `Settings`
1244
+ 2. Select `Connectors`.
1245
+ 3. Click `Add Connector`.
1246
+ 4. Select `Advanced`.
1247
+ 5. Enter Server Name: `Context7`
1248
+ 6. Paste the following JSON in the text area:
1249
+
1250
+ ```json
1251
+ {
1252
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
1253
+ "command": "npx",
1254
+ "env": {}
1255
+ }
1256
+ ```
1257
+
1258
+ 7. Click `Save`.
1259
+ </details>
1260
+
1261
+ <details>
1262
+ <summary><b>Install in Factory</b></summary>
1263
+
1264
+ Factory's droid supports MCP servers through its CLI. See [Factory MCP docs](https://docs.factory.ai/cli/configuration/mcp) for more info.
1265
+
1266
+ #### Factory Remote Server Connection (HTTP)
1267
+
1268
+ Run this command in your terminal:
1269
+
1270
+ ```sh
1271
+ droid mcp add context7 https://mcp.context7.com/mcp --type http --header "CONTEXT7_API_KEY: YOUR_API_KEY"
1272
+ ```
1273
+
1274
+ Or without an API key (basic usage with rate limits):
1275
+
1276
+ ```sh
1277
+ droid mcp add context7 https://mcp.context7.com/mcp --type http
1278
+ ```
1279
+
1280
+ #### Factory Local Server Connection (Stdio)
1281
+
1282
+ Run this command in your terminal:
1283
+
1284
+ ```sh
1285
+ droid mcp add context7 "npx -y @upstash/context7-mcp" --env CONTEXT7_API_KEY=YOUR_API_KEY
1286
+ ```
1287
+
1288
+ Once configured, Context7 tools will be available in your droid sessions. Type `/mcp` within droid to manage servers, authenticate, and view available tools.
1289
+
1290
+ </details>
1291
+
1292
+ <details>
1293
+ <summary><b>Install in Emdash</b></summary>
1294
+
1295
+ [Emdash](https://github.com/generalaction/emdash) is an orchestration layer for running multiple coding agents in parallel. Provider-agnostic, worktree-isolated, and local-first. Emdash supports Context7 MCP to enable Context7 for your agents.
1296
+
1297
+ **What Emdash provides:**
1298
+
1299
+ - Global toggle: Settings → MCP → "Enable Context7 MCP"
1300
+ - Per-workspace enable: The Context7 button in the ProviderBar (off by default). First click enables it for that workspace. Clicking again disables it.
1301
+ - ProviderBar: The Context7 button shows status, a short explanation, and a link to docs
1302
+
1303
+ **What you still need to do:**
1304
+ Configure your coding agent (Codex, Claude Code, Cursor, etc.) to connect to Context7 MCP. Emdash does not modify your agent's config. See the respective MCP configuration sections above for your agent (e.g., OpenAI Codex, Claude Code, Cursor).
1305
+
1306
+ See the [Emdash repository](https://github.com/generalaction/emdash) for more information.
1307
+
1308
+ </details>
1309
+
1310
+ ## 🔨 Available Tools
1311
+
1312
+ Context7 MCP provides the following tools that LLMs can use:
1313
+
1314
+ - `resolve-library-id`: Resolves a general library name into a Context7-compatible library ID.
1315
+ - `libraryName` (required): The name of the library to search for
1316
+
1317
+ - `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
1318
+ - `context7CompatibleLibraryID` (required): Exact Context7-compatible library ID (e.g., `/mongodb/docs`, `/vercel/next.js`)
1319
+ - `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
1320
+ - `page` (optional, default 1): Page number for pagination (1-10). If the context is not sufficient, try page=2, page=3, etc. with the same topic.
1321
+
1322
+ ## 🛟 Tips
1323
+
1324
+ ### Add a Rule
1325
+
1326
+ To avoid typing `use context7` in every prompt, you can add a rule to your MCP client that automatically invokes Context7 for code-related questions. See the [recommended setup in the Installation section](#️-installation) for detailed instructions and example rules.
1327
+
1328
+ ### Use Library Id
1329
+
1330
+ 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.
1331
+
1332
+ ```txt
1333
+ Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.
1334
+ ```
1335
+
1336
+ The slash syntax tells the MCP tool exactly which library to load docs for.
1337
+
1338
+ ### HTTPS Proxy
1339
+
1340
+ If you are behind an HTTP proxy, Context7 uses the standard `https_proxy` / `HTTPS_PROXY` environment variables.
1341
+
1342
+ ## 💻 Development
1343
+
1344
+ Clone the project and install dependencies:
1345
+
1346
+ ```bash
1347
+ bun i
1348
+ ```
1349
+
1350
+ Build:
1351
+
1352
+ ```bash
1353
+ bun run build
1354
+ ```
1355
+
1356
+ Run the server:
1357
+
1358
+ ```bash
1359
+ bun run dist/index.js
1360
+ ```
1361
+
1362
+ ### CLI Arguments
45
1363
 
46
- - `list-available-docs`: Lists all available documentation libraries from Context7
47
- - `get-library-documentation`: Retrieves documentation for a specific library with options for:
48
- - `libraryName`: Name of the library to retrieve docs for
49
- - `topic`: Specific topic within the library
50
- - `tokens`: Maximum tokens to retrieve (default: 5000)
1364
+ `context7-mcp` accepts the following CLI flags:
51
1365
 
52
- ## Development
1366
+ - `--transport <stdio|http>` – Transport to use (`stdio` by default). Use `http` for remote HTTP server or `stdio` for local integration.
1367
+ - `--port <number>` – Port to listen on when using `http` transport (default `3000`).
1368
+ - `--api-key <key>` – API key for authentication (or set `CONTEXT7_API_KEY` env var). You can get your API key by creating an account at [context7.com/dashboard](https://context7.com/dashboard).
53
1369
 
54
- Clone the project and run:
1370
+ Example with HTTP transport and port 8080:
55
1371
 
56
1372
  ```bash
57
- npm install
1373
+ bun run dist/index.js --transport http --port 8080
58
1374
  ```
59
1375
 
60
- You can use the following commands to format and lint the code:
1376
+ Another example with stdio transport:
61
1377
 
62
1378
  ```bash
63
- npm run format
64
- npm run lint
1379
+ bun run dist/index.js --transport stdio --api-key YOUR_API_KEY
65
1380
  ```
66
1381
 
67
- ### Building
1382
+ ### Environment Variables
1383
+
1384
+ You can use the `CONTEXT7_API_KEY` environment variable instead of passing the `--api-key` flag. This is useful for:
1385
+
1386
+ - Storing API keys securely in `.env` files
1387
+ - Integration with MCP server setups that use dotenv
1388
+ - Tools that prefer environment variable configuration
1389
+
1390
+ **Note:** The `--api-key` CLI flag takes precedence over the environment variable when both are provided.
1391
+
1392
+ **Example with .env file:**
68
1393
 
69
1394
  ```bash
70
- npm run build
1395
+ # .env
1396
+ CONTEXT7_API_KEY=your_api_key_here
1397
+ ```
1398
+
1399
+ **Example MCP configuration using environment variable:**
1400
+
1401
+ ```json
1402
+ {
1403
+ "mcpServers": {
1404
+ "context7": {
1405
+ "command": "npx",
1406
+ "args": ["-y", "@upstash/context7-mcp"],
1407
+ "env": {
1408
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
1409
+ }
1410
+ }
1411
+ }
1412
+ }
71
1413
  ```
72
1414
 
73
- ### Local Configuration
1415
+ <details>
1416
+ <summary><b>Local Configuration Example</b></summary>
74
1417
 
75
1418
  ```json
76
1419
  {
77
1420
  "mcpServers": {
78
1421
  "context7": {
79
- "command": "node",
80
- "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/context7-mcp/build/index.js"]
1422
+ "command": "npx",
1423
+ "args": ["tsx", "/path/to/folder/context7/src/index.ts", "--api-key", "YOUR_API_KEY"]
81
1424
  }
82
1425
  }
83
1426
  }
84
1427
  ```
85
1428
 
86
- ### Testing with MCP Inspector
1429
+ </details>
87
1430
 
88
- You can also use the MCP Inspector to test the tools by following the MCP documentation for setting up the inspector.
1431
+ <details>
1432
+ <summary><b>Testing with MCP Inspector</b></summary>
89
1433
 
90
1434
  ```bash
91
1435
  npx -y @modelcontextprotocol/inspector npx @upstash/context7-mcp
92
1436
  ```
93
1437
 
94
- ## License
1438
+ </details>
1439
+
1440
+ ## 🚨 Troubleshooting
1441
+
1442
+ <details>
1443
+ <summary><b>Module Not Found Errors</b></summary>
1444
+
1445
+ If you encounter `ERR_MODULE_NOT_FOUND`, try using `bunx` instead of `npx`:
1446
+
1447
+ ```json
1448
+ {
1449
+ "mcpServers": {
1450
+ "context7": {
1451
+ "command": "bunx",
1452
+ "args": ["-y", "@upstash/context7-mcp"]
1453
+ }
1454
+ }
1455
+ }
1456
+ ```
1457
+
1458
+ This often resolves module resolution issues in environments where `npx` doesn't properly install or resolve packages.
1459
+
1460
+ </details>
1461
+
1462
+ <details>
1463
+ <summary><b>ESM Resolution Issues</b></summary>
1464
+
1465
+ For errors like `Error: Cannot find module 'uriTemplate.js'`, try the `--experimental-vm-modules` flag:
1466
+
1467
+ ```json
1468
+ {
1469
+ "mcpServers": {
1470
+ "context7": {
1471
+ "command": "npx",
1472
+ "args": ["-y", "--node-options=--experimental-vm-modules", "@upstash/context7-mcp@1.0.6"]
1473
+ }
1474
+ }
1475
+ }
1476
+ ```
1477
+
1478
+ </details>
1479
+
1480
+ <details>
1481
+ <summary><b>TLS/Certificate Issues</b></summary>
1482
+
1483
+ Use the `--experimental-fetch` flag to bypass TLS-related problems:
1484
+
1485
+ ```json
1486
+ {
1487
+ "mcpServers": {
1488
+ "context7": {
1489
+ "command": "npx",
1490
+ "args": ["-y", "--node-options=--experimental-fetch", "@upstash/context7-mcp"]
1491
+ }
1492
+ }
1493
+ }
1494
+ ```
1495
+
1496
+ </details>
1497
+
1498
+ <details>
1499
+ <summary><b>General MCP Client Errors</b></summary>
1500
+
1501
+ 1. Try adding `@latest` to the package name
1502
+ 2. Use `bunx` as an alternative to `npx`
1503
+ 3. Consider using `deno` as another alternative
1504
+ 4. Ensure you're using Node.js v18 or higher for native fetch support
1505
+
1506
+ </details>
1507
+
1508
+ ## ⚠️ Disclaimer
1509
+
1510
+ 1- Context7 projects are community-contributed and while we strive to maintain high quality, we cannot guarantee the accuracy, completeness, or security of all library documentation. Projects listed in Context7 are developed and maintained by their respective owners, not by Context7. If you encounter any suspicious, inappropriate, or potentially harmful content, please use the "Report" button on the project page to notify us immediately. We take all reports seriously and will review flagged content promptly to maintain the integrity and safety of our platform. By using Context7, you acknowledge that you do so at your own discretion and risk.
1511
+
1512
+ 2- This repository hosts the MCP server’s source code. The supporting components — API backend, parsing engine, and crawling engine — are private and not part of this release.
1513
+
1514
+ ## 🤝 Connect with Us
1515
+
1516
+ Stay updated and join our community:
1517
+
1518
+ - 📢 Follow us on [X](https://x.com/context7ai) for the latest news and updates
1519
+ - 🌐 Visit our [Website](https://context7.com)
1520
+ - 💬 Join our [Discord Community](https://upstash.com/discord)
1521
+
1522
+ ## 📺 Context7 In Media
1523
+
1524
+ - [Better Stack: "Free Tool Makes Cursor 10x Smarter"](https://youtu.be/52FC3qObp9E)
1525
+ - [Cole Medin: "This is Hands Down the BEST MCP Server for AI Coding Assistants"](https://www.youtube.com/watch?v=G7gK8H6u7Rs)
1526
+ - [Income Stream Surfers: "Context7 + SequentialThinking MCPs: Is This AGI?"](https://www.youtube.com/watch?v=-ggvzyLpK6o)
1527
+ - [Julian Goldie SEO: "Context7: New MCP AI Agent Update"](https://www.youtube.com/watch?v=CTZm6fBYisc)
1528
+ - [JeredBlu: "Context 7 MCP: Get Documentation Instantly + VS Code Setup"](https://www.youtube.com/watch?v=-ls0D-rtET4)
1529
+ - [Income Stream Surfers: "Context7: The New MCP Server That Will CHANGE AI Coding"](https://www.youtube.com/watch?v=PS-2Azb-C3M)
1530
+ - [AICodeKing: "Context7 + Cline & RooCode: This MCP Server Makes CLINE 100X MORE EFFECTIVE!"](https://www.youtube.com/watch?v=qZfENAPMnyo)
1531
+ - [Sean Kochel: "5 MCP Servers For Vibe Coding Glory (Just Plug-In & Go)"](https://www.youtube.com/watch?v=LqTQi8qexJM)
1532
+
1533
+ ## ⭐ Star History
1534
+
1535
+ [![Star History Chart](https://api.star-history.com/svg?repos=upstash/context7&type=Date)](https://www.star-history.com/#upstash/context7&Date)
1536
+
1537
+ ## 📄 License
95
1538
 
96
1539
  MIT