@upstash/context7-mcp 1.0.20 → 1.0.22

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.
Files changed (3) hide show
  1. package/README.md +115 -7
  2. package/dist/index.js +4 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -48,7 +48,7 @@ Check out our [project addition guide](./docs/adding-projects.md) to learn how t
48
48
 
49
49
  - Node.js >= v18.0.0
50
50
  - Cursor, Claude Code, VSCode, Windsurf or another MCP Client
51
- - Context7 API Key (Optional for higher rate limits) (Get yours by creating an account at [context7.com/dashboard](https://context7.com/dashboard))
51
+ - 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))
52
52
 
53
53
  > [!WARNING]
54
54
  > **SSE Protocol Deprecation Notice**
@@ -130,6 +130,25 @@ claude mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
130
130
 
131
131
  </details>
132
132
 
133
+ <details>
134
+ <summary><b>Install in Amp</b></summary>
135
+
136
+ Run this command in your terminal. See [Amp MCP docs](https://ampcode.com/manual#mcp) for more info.
137
+
138
+ #### Without API Key (Basic Usage)
139
+
140
+ ```sh
141
+ amp mcp add context7 https://mcp.context7.com/mcp
142
+ ```
143
+
144
+ #### With API Key (Higher Rate Limits & Private Repos)
145
+
146
+ ```sh
147
+ amp mcp add context7 --header "CONTEXT7_API_KEY=YOUR_API_KEY" https://mcp.context7.com/mcp
148
+ ```
149
+
150
+ </details>
151
+
133
152
  <details>
134
153
  <summary><b>Install in Windsurf</b></summary>
135
154
 
@@ -250,11 +269,9 @@ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Contex
250
269
  {
251
270
  "context_servers": {
252
271
  "Context7": {
253
- "command": {
254
- "path": "npx",
255
- "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
256
- },
257
- "settings": {}
272
+ "source": "custom",
273
+ "command": "npx",
274
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
258
275
  }
259
276
  }
260
277
  }
@@ -384,6 +401,45 @@ If the `mcpServers` object does not exist, create it.
384
401
 
385
402
  </details>
386
403
 
404
+ <details>
405
+ <summary><b>Install in Qwen Coder</b></summary>
406
+
407
+ 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.
408
+
409
+ 1. Open the Qwen Coder settings file. The location is `~/.qwen/settings.json` (where `~` is your home directory).
410
+ 2. Add the following to the `mcpServers` object in your `settings.json` file:
411
+
412
+ ```json
413
+ {
414
+ "mcpServers": {
415
+ "context7": {
416
+ "httpUrl": "https://mcp.context7.com/mcp",
417
+ "headers": {
418
+ "CONTEXT7_API_KEY": "YOUR_API_KEY",
419
+ "Accept": "application/json, text/event-stream"
420
+ }
421
+ }
422
+ }
423
+ }
424
+ ```
425
+
426
+ Or, for a local server:
427
+
428
+ ```json
429
+ {
430
+ "mcpServers": {
431
+ "context7": {
432
+ "command": "npx",
433
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
434
+ }
435
+ }
436
+ }
437
+ ```
438
+
439
+ If the `mcpServers` object does not exist, create it.
440
+
441
+ </details>
442
+
387
443
  <details>
388
444
  <summary><b>Install in Claude Desktop</b></summary>
389
445
 
@@ -493,9 +549,28 @@ startup_timeout_ms = 20_000
493
549
 
494
550
  This ensures Codex CLI works reliably on Windows.
495
551
 
552
+ ⚠️ MacOS Notes
553
+
554
+ On MacOS, some users may encounter the same request timed out errors like Windows,
555
+ it also can be solved with the full path to Node.js and the installed package:
556
+
557
+ ```toml
558
+ [mcp_servers.context7]
559
+ command = "/Users/yourname/.nvm/versions/node/v22.14.0/bin/node" # Node.js full path
560
+ args = ["/Users/yourname/.nvm/versions/node/v22.14.0/lib/node_modules/@upstash/context7-mcp/dist/index.js",
561
+ "--transport",
562
+ "stdio",
563
+ "--api-key",
564
+ "YOUR_API_KEY"
565
+ ]
566
+ ```
567
+
568
+ This ensures Codex CLI works reliably on MacOS.
569
+
496
570
  </details>
497
571
 
498
572
  <details>
573
+
499
574
  <summary><b>Install in JetBrains AI Assistant</b></summary>
500
575
 
501
576
  See [JetBrains AI Assistant Documentation](https://www.jetbrains.com/help/ai-assistant/configure-an-mcp-server.html) for more details.
@@ -1101,7 +1176,7 @@ bun run dist/index.js
1101
1176
 
1102
1177
  - `--transport <stdio|http>` – Transport to use (`stdio` by default). Note that HTTP transport automatically provides both HTTP and SSE endpoints.
1103
1178
  - `--port <number>` – Port to listen on when using `http` transport (default `3000`).
1104
- - `--api-key <key>` – API key for authentication. You can get your API key by creating an account at [context7.com/dashboard](https://context7.com/dashboard).
1179
+ - `--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).
1105
1180
 
1106
1181
  Example with HTTP transport and port 8080:
1107
1182
 
@@ -1115,6 +1190,39 @@ Another example with stdio transport:
1115
1190
  bun run dist/index.js --transport stdio --api-key YOUR_API_KEY
1116
1191
  ```
1117
1192
 
1193
+ ### Environment Variables
1194
+
1195
+ You can use the `CONTEXT7_API_KEY` environment variable instead of passing the `--api-key` flag. This is useful for:
1196
+
1197
+ - Storing API keys securely in `.env` files
1198
+ - Integration with MCP server setups that use dotenv
1199
+ - Tools that prefer environment variable configuration
1200
+
1201
+ **Note:** The `--api-key` CLI flag takes precedence over the environment variable when both are provided.
1202
+
1203
+ **Example with .env file:**
1204
+
1205
+ ```bash
1206
+ # .env
1207
+ CONTEXT7_API_KEY=your_api_key_here
1208
+ ```
1209
+
1210
+ **Example MCP configuration using environment variable:**
1211
+
1212
+ ```json
1213
+ {
1214
+ "mcpServers": {
1215
+ "context7": {
1216
+ "command": "npx",
1217
+ "args": ["-y", "@upstash/context7-mcp"],
1218
+ "env": {
1219
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
1220
+ }
1221
+ }
1222
+ }
1223
+ }
1224
+ ```
1225
+
1118
1226
  <details>
1119
1227
  <summary><b>Local Configuration Example</b></summary>
1120
1228
 
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ const DEFAULT_PORT = 3000;
18
18
  const program = new Command()
19
19
  .option("--transport <stdio|http>", "transport type", "stdio")
20
20
  .option("--port <number>", "port for HTTP transport", DEFAULT_PORT.toString())
21
- .option("--api-key <key>", "API key for authentication")
21
+ .option("--api-key <key>", "API key for authentication (or set CONTEXT7_API_KEY env var)")
22
22
  .allowUnknownOption() // let MCP Inspector / other wrappers pass through extra flags
23
23
  .parse(process.argv);
24
24
  const cliOptions = program.opts();
@@ -77,7 +77,7 @@ function getClientIp(req) {
77
77
  function createServerInstance(clientIp, apiKey) {
78
78
  const server = new McpServer({
79
79
  name: "Context7",
80
- version: "1.0.20",
80
+ version: "1.0.22",
81
81
  }, {
82
82
  instructions: "Use this server to retrieve up-to-date documentation and code examples for any library.",
83
83
  });
@@ -334,7 +334,8 @@ async function main() {
334
334
  }
335
335
  else {
336
336
  // Stdio transport - this is already stateless by nature
337
- const server = createServerInstance(undefined, cliOptions.apiKey);
337
+ const apiKey = cliOptions.apiKey || process.env.CONTEXT7_API_KEY;
338
+ const server = createServerInstance(undefined, apiKey);
338
339
  const transport = new StdioServerTransport();
339
340
  await server.connect(transport);
340
341
  console.error("Context7 Documentation MCP Server running on stdio");
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@upstash/context7-mcp","version":"1.0.20","description":"MCP server for Context7","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc && chmod 755 dist/index.js","format":"prettier --write .","lint":"eslint \"**/*.{js,ts,tsx}\" --fix","lint:check":"eslint \"**/*.{js,ts,tsx}\"","start":"node dist/index.js --transport http","pack-mcpb":"bun install && bun run build && rm -rf node_modules && bun install --production && mv mcpb/.mcpbignore .mcpbignore && mv mcpb/manifest.json manifest.json && mv public/icon.png icon.png && mcpb validate manifest.json && mcpb pack . mcpb/context7.mcpb && mv manifest.json mcpb/manifest.json && mv .mcpbignore mcpb/.mcpbignore && mv icon.png public/icon.png && bun install"},"repository":{"type":"git","url":"git+https://github.com/upstash/context7.git"},"keywords":["modelcontextprotocol","mcp","context7","vibe-coding","developer tools","documentation","context"],"author":"abdush","license":"MIT","type":"module","bin":{"context7-mcp":"dist/index.js"},"files":["dist"],"bugs":{"url":"https://github.com/upstash/context7/issues"},"homepage":"https://github.com/upstash/context7#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.17.5","commander":"^14.0.0","undici":"^6.6.3","zod":"^3.24.2"},"devDependencies":{"@types/node":"^22.13.14","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0","eslint":"^9.34.0","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.5","prettier":"^3.6.2","typescript":"^5.8.2","typescript-eslint":"^8.28.0"}}
1
+ {"name":"@upstash/context7-mcp","version":"1.0.22","description":"MCP server for Context7","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc && chmod 755 dist/index.js","format":"prettier --write .","lint":"eslint \"**/*.{js,ts,tsx}\" --fix","lint:check":"eslint \"**/*.{js,ts,tsx}\"","start":"node dist/index.js --transport http","pack-mcpb":"bun install && bun run build && rm -rf node_modules && bun install --production && mv mcpb/.mcpbignore .mcpbignore && mv mcpb/manifest.json manifest.json && mv public/icon.png icon.png && mcpb validate manifest.json && mcpb pack . mcpb/context7.mcpb && mv manifest.json mcpb/manifest.json && mv .mcpbignore mcpb/.mcpbignore && mv icon.png public/icon.png && bun install"},"repository":{"type":"git","url":"git+https://github.com/upstash/context7.git"},"keywords":["modelcontextprotocol","mcp","context7","vibe-coding","developer tools","documentation","context"],"author":"abdush","license":"MIT","type":"module","bin":{"context7-mcp":"dist/index.js"},"files":["dist"],"bugs":{"url":"https://github.com/upstash/context7/issues"},"homepage":"https://github.com/upstash/context7#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.17.5","commander":"^14.0.0","undici":"^6.6.3","zod":"^3.24.2"},"devDependencies":{"@types/node":"^22.13.14","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0","eslint":"^9.34.0","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.5","prettier":"^3.6.2","typescript":"^5.8.2","typescript-eslint":"^8.28.0"}}