@upstash/context7-mcp 1.0.15 → 1.0.16
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 +13 -7
- package/dist/index.js +1 -1
- package/dist/lib/api.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ Check out our [project addition guide](./docs/adding-projects.md) to learn how t
|
|
|
46
46
|
|
|
47
47
|
- Node.js >= v18.0.0
|
|
48
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/
|
|
49
|
+
- Context7 API Key (Optional for higher rate limits) (Get yours by creating an account at [context7.com/dashboard](https://context7.com/dashboard))
|
|
50
50
|
|
|
51
51
|
<details>
|
|
52
52
|
<summary><b>Installing via Smithery</b></summary>
|
|
@@ -752,11 +752,13 @@ Add this to your Visual Studio MCP config file (see the [Visual Studio docs](htt
|
|
|
752
752
|
|
|
753
753
|
```json
|
|
754
754
|
{
|
|
755
|
-
"
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
755
|
+
"inputs": [],
|
|
756
|
+
"servers": {
|
|
757
|
+
"context7": {
|
|
758
|
+
"type": "sse",
|
|
759
|
+
"url": "https://mcp.context7.com/mcp",
|
|
760
|
+
"headers": {
|
|
761
|
+
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
|
760
762
|
}
|
|
761
763
|
}
|
|
762
764
|
}
|
|
@@ -1015,6 +1017,10 @@ Context7 MCP provides the following tools that LLMs can use:
|
|
|
1015
1017
|
>
|
|
1016
1018
|
> The slash syntax tells the MCP tool exactly which library to load docs for.
|
|
1017
1019
|
|
|
1020
|
+
### HTTPS Proxy
|
|
1021
|
+
|
|
1022
|
+
For users behind a http proxy, context7 should honor the standard https_proxy/HTTPS_PROXY environment variables.
|
|
1023
|
+
|
|
1018
1024
|
## 💻 Development
|
|
1019
1025
|
|
|
1020
1026
|
Clone the project and install dependencies:
|
|
@@ -1041,7 +1047,7 @@ bun run dist/index.js
|
|
|
1041
1047
|
|
|
1042
1048
|
- `--transport <stdio|http>` – Transport to use (`stdio` by default). Note that HTTP transport automatically provides both HTTP and SSE endpoints.
|
|
1043
1049
|
- `--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/
|
|
1050
|
+
- `--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).
|
|
1045
1051
|
|
|
1046
1052
|
Example with http transport and port 8080:
|
|
1047
1053
|
|
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ function getClientIp(req) {
|
|
|
72
72
|
function createServerInstance(clientIp, apiKey) {
|
|
73
73
|
const server = new McpServer({
|
|
74
74
|
name: "Context7",
|
|
75
|
-
version: "1.0.
|
|
75
|
+
version: "1.0.16",
|
|
76
76
|
}, {
|
|
77
77
|
instructions: "Use this server to retrieve up-to-date documentation and code examples for any library.",
|
|
78
78
|
});
|
package/dist/lib/api.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { generateHeaders } from "./encryption.js";
|
|
2
|
+
import { ProxyAgent, setGlobalDispatcher } from "undici";
|
|
2
3
|
const CONTEXT7_API_BASE_URL = "https://context7.com/api";
|
|
3
4
|
const DEFAULT_TYPE = "txt";
|
|
5
|
+
// Pick up proxy configuration in a variety of common env var names.
|
|
6
|
+
const PROXY_URL = process.env.HTTPS_PROXY ??
|
|
7
|
+
process.env.https_proxy ??
|
|
8
|
+
process.env.HTTP_PROXY ??
|
|
9
|
+
process.env.http_proxy ??
|
|
10
|
+
null;
|
|
11
|
+
if (PROXY_URL && !PROXY_URL.startsWith("$") && /^(http|https):\/\//i.test(PROXY_URL)) {
|
|
12
|
+
try {
|
|
13
|
+
// Configure a global proxy agent once at startup. Subsequent fetch calls will
|
|
14
|
+
// automatically use this dispatcher.
|
|
15
|
+
// Using `any` cast because ProxyAgent implements the Dispatcher interface but
|
|
16
|
+
// TS may not infer it correctly in some versions.
|
|
17
|
+
setGlobalDispatcher(new ProxyAgent(PROXY_URL));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
// Don't crash the app if proxy initialisation fails – just log a warning.
|
|
21
|
+
console.error(`[Context7] Failed to configure proxy agent for provided proxy URL: ${PROXY_URL}:`, error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
4
24
|
/**
|
|
5
25
|
* Searches for libraries matching the given query
|
|
6
26
|
* @param query The search query
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/context7-mcp","version":"1.0.
|
|
1
|
+
{"name":"@upstash/context7-mcp","version":"1.0.16","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-dxt":"bun install && bun run build && rm -rf node_modules && bun install --production && mv dxt/.dxtignore .dxtignore && mv dxt/manifest.json manifest.json && dxt validate manifest.json && dxt pack . dxt/context7.dxt && mv manifest.json dxt/manifest.json && mv .dxtignore dxt/.dxtignore && bun install"},"repository":{"type":"git","url":"git+https://github.com/upstash/context7.git"},"keywords":["modelcontextprotocol","mcp","context7"],"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.13.2","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.23.0","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.5","prettier":"^3.5.3","typescript":"^5.8.2","typescript-eslint":"^8.28.0"}}
|