@upstash/context7-mcp 1.0.20 → 1.0.21

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
@@ -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
  }
@@ -493,9 +510,28 @@ startup_timeout_ms = 20_000
493
510
 
494
511
  This ensures Codex CLI works reliably on Windows.
495
512
 
513
+ ⚠️ MacOS Notes
514
+
515
+ On MacOS, some users may encounter the same request timed out errors like Windows,
516
+ it also can be solved tith the full path to Node.js and the installed package:
517
+
518
+ ```toml
519
+ [mcp_servers.context7]
520
+ command = "/Users/yourname/.nvm/versions/node/v22.14.0/bin/node" # Node.js full path
521
+ args = ["/Users/yourname/.nvm/versions/node/v22.14.0/lib/node_modules/@upstash/context7-mcp/dist/index.js",
522
+ "--transport",
523
+ "stdio",
524
+ "--api-key",
525
+ "YOUR_API_KEY"
526
+ ]
527
+ ```
528
+
529
+ This ensures Codex CLI works reliably on MacOS.
530
+
496
531
  </details>
497
532
 
498
533
  <details>
534
+
499
535
  <summary><b>Install in JetBrains AI Assistant</b></summary>
500
536
 
501
537
  See [JetBrains AI Assistant Documentation](https://www.jetbrains.com/help/ai-assistant/configure-an-mcp-server.html) for more details.
@@ -1101,7 +1137,7 @@ bun run dist/index.js
1101
1137
 
1102
1138
  - `--transport <stdio|http>` – Transport to use (`stdio` by default). Note that HTTP transport automatically provides both HTTP and SSE endpoints.
1103
1139
  - `--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).
1140
+ - `--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
1141
 
1106
1142
  Example with HTTP transport and port 8080:
1107
1143
 
@@ -1115,6 +1151,39 @@ Another example with stdio transport:
1115
1151
  bun run dist/index.js --transport stdio --api-key YOUR_API_KEY
1116
1152
  ```
1117
1153
 
1154
+ ### Environment Variables
1155
+
1156
+ You can use the `CONTEXT7_API_KEY` environment variable instead of passing the `--api-key` flag. This is useful for:
1157
+
1158
+ - Storing API keys securely in `.env` files
1159
+ - Integration with MCP server setups that use dotenv
1160
+ - Tools that prefer environment variable configuration
1161
+
1162
+ **Note:** The `--api-key` CLI flag takes precedence over the environment variable when both are provided.
1163
+
1164
+ **Example with .env file:**
1165
+
1166
+ ```bash
1167
+ # .env
1168
+ CONTEXT7_API_KEY=your_api_key_here
1169
+ ```
1170
+
1171
+ **Example MCP configuration using environment variable:**
1172
+
1173
+ ```json
1174
+ {
1175
+ "mcpServers": {
1176
+ "context7": {
1177
+ "command": "npx",
1178
+ "args": ["-y", "@upstash/context7-mcp"],
1179
+ "env": {
1180
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
1181
+ }
1182
+ }
1183
+ }
1184
+ }
1185
+ ```
1186
+
1118
1187
  <details>
1119
1188
  <summary><b>Local Configuration Example</b></summary>
1120
1189
 
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.21",
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.21","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"}}