@upstash/context7-mcp 1.0.5 → 1.0.6

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 +38 -15
  2. package/dist/index.js +2 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
- # Context7 MCP - Up-to-date Docs For Any Cursor Prompt
2
- [![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)
1
+ # Context7 MCP - Up-to-date Docs For Any Prompt
2
+
3
+ [![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) [<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%257B%2522name%2522%253A%2522context7%2522%252C%2522config%2522%253A%257B%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540upstash%252Fcontext7-mcp%2540latest%2522%255D%257D%257D)
4
+
5
+ [![中文文档](https://img.shields.io/badge/docs-中文版-yellow)](./docs/README.zh-CN.md) [![한국어 문서](https://img.shields.io/badge/docs-한국어-green)](./docs/README.ko.md)
3
6
 
4
7
  ## ❌ Without Context7
5
8
 
@@ -13,23 +16,19 @@ LLMs rely on outdated or generic information about the libraries you use. You ge
13
16
 
14
17
  Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.
15
18
 
16
- Add `use context7` to your question in Cursor:
19
+ Add `use context7` to your prompt in Cursor:
17
20
 
18
21
  ```txt
19
- How do I use the new Next.js `after` function? use context7
22
+ Create a basic Next.js project with app router. use context7
20
23
  ```
21
24
 
22
25
  ```txt
23
- How do I invalidate a query in React Query? use context7
26
+ Create a script to delete the rows where the city is "" given PostgreSQL credentials. use context7
24
27
  ```
25
28
 
26
- ```txt
27
- How do I protect a route with NextAuth? use context7
28
- ```
29
+ Context7 fetches up-to-date code examples and documentation right into your LLM's context.
29
30
 
30
- Context7 fetches up-to-date documentation and working code examples right into your LLM's context.
31
-
32
- - 1️⃣ Ask your question naturally
31
+ - 1️⃣ Write your prompt naturally
33
32
  - 2️⃣ Tell the LLM to `use context7`
34
33
  - 3️⃣ Get working code answers
35
34
 
@@ -114,9 +113,12 @@ Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.
114
113
  }
115
114
  ```
116
115
 
117
- ### Install in VSCode
116
+ ### Install in VS Code
117
+
118
+ [<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%257B%2522name%2522%253A%2522context7%2522%252C%2522config%2522%253A%257B%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540upstash%252Fcontext7-mcp%2540latest%2522%255D%257D%257D)
119
+ [<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%257B%2522name%2522%253A%2522context7%2522%252C%2522config%2522%253A%257B%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540upstash%252Fcontext7-mcp%2540latest%2522%255D%257D%257D)
118
120
 
119
- Add this to your VSCode MCP config file. See [VSCode MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.
121
+ 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.
120
122
 
121
123
  ```json
122
124
  {
@@ -156,11 +158,11 @@ Add this to your Claude Desktop `claude_desktop_config.json` file. See [Claude D
156
158
  ### Available Tools
157
159
 
158
160
  - `resolve-library-id`: Resolves a general library name into a Context7-compatible library ID.
159
- - `libraryName` (optional): Search and rerank results
161
+ - `libraryName` (required)
160
162
  - `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
161
163
  - `context7CompatibleLibraryID` (required)
162
164
  - `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
163
- - `tokens` (optional, default 5000): Max number of tokens to return
165
+ - `tokens` (optional, default 5000): Max number of tokens to return. Values less than 5000 are automatically increased to 5000.
164
166
 
165
167
  ## Development
166
168
 
@@ -214,6 +216,27 @@ If you see this error, try using `bunx` instead of `npx`.
214
216
 
215
217
  This often resolves module resolution issues, especially in environments where `npx` does not properly install or resolve packages.
216
218
 
219
+ ### MCP Client Errors
220
+
221
+ 1. Try removing `@latest` from the package name.
222
+
223
+ 2. Try using `bunx` as an alternative.
224
+
225
+ 3. Try using `deno` as an alternative.
226
+
227
+ ## Context7 In Media
228
+
229
+ - [Better Stack: "Free Tool Makes Cursor 10x Smarter"](https://youtu.be/52FC3qObp9E)
230
+ - [Cole Medin: "This is Hands Down the BEST MCP Server for AI Coding Assistants"](https://www.youtube.com/watch?v=G7gK8H6u7Rs)
231
+ - [Income stream surfers: "Context7 + SequentialThinking MCPs: Is This AGI?"](https://www.youtube.com/watch?v=-ggvzyLpK6o)
232
+ - [Julian Goldie SEO: "Context7: New MCP AI Agent Update"](https://www.youtube.com/watch?v=CTZm6fBYisc)
233
+ - [JeredBlu: "Context 7 MCP: Get Documentation Instantly + VS Code Setup"](https://www.youtube.com/watch?v=-ls0D-rtET4)
234
+ - [Income stream surfers: "Context7: The New MCP Server That Will CHANGE AI Coding"](https://www.youtube.com/watch?v=PS-2Azb-C3M)
235
+
236
+ ## Star History
237
+
238
+ [![Star History Chart](https://api.star-history.com/svg?repos=upstash/context7&type=Date)](https://www.star-history.com/#upstash/context7&Date)
239
+
217
240
  ## License
218
241
 
219
242
  MIT
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ const DEFAULT_MINIMUM_TOKENS = 5000;
9
9
  const server = new McpServer({
10
10
  name: "Context7",
11
11
  description: "Retrieves up-to-date documentation and code examples for any library.",
12
- version: "1.0.4",
12
+ version: "1.0.6",
13
13
  capabilities: {
14
14
  resources: {},
15
15
  tools: {},
@@ -62,9 +62,7 @@ server.tool("get-library-docs", "Fetches up-to-date documentation for a library.
62
62
  .describe("Topic to focus documentation on (e.g., 'hooks', 'routing')."),
63
63
  tokens: z
64
64
  .preprocess((val) => (typeof val === "string" ? Number(val) : val), z.number())
65
- .refine((val) => typeof val === "number" && val >= DEFAULT_MINIMUM_TOKENS, {
66
- message: `Must be a number >= ${DEFAULT_MINIMUM_TOKENS}`,
67
- })
65
+ .transform((val) => (val < DEFAULT_MINIMUM_TOKENS ? DEFAULT_MINIMUM_TOKENS : val))
68
66
  .optional()
69
67
  .describe(`Maximum number of tokens of documentation to retrieve (default: ${DEFAULT_MINIMUM_TOKENS}). Higher values provide more context but consume more tokens.`),
70
68
  }, async ({ context7CompatibleLibraryID, tokens = DEFAULT_MINIMUM_TOKENS, topic = "" }) => {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@upstash/context7-mcp","version":"v1.0.5","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"},"repository":{"type":"git","url":"git+https://github.com/upstash/context7-mcp.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-mcp/issues"},"homepage":"https://github.com/upstash/context7-mcp#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.8.0","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"}}
1
+ {"name":"@upstash/context7-mcp","version":"v1.0.6","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"},"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.8.0","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"}}