@upstash/context7-mcp 4.1.0 → 4.1.1
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/dist/index.js +11 -5
- package/dist/lib/subscriptions.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -135,11 +135,16 @@ function createMcpServer(mcpContext) {
|
|
|
135
135
|
],
|
|
136
136
|
};
|
|
137
137
|
const serverOptions = {
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
|
|
138
|
+
// The collections are static for the process lifetime. Explicitly disabling
|
|
139
|
+
// change notifications prevents clients from opening subscriptions/listen
|
|
140
|
+
// streams for events this server never publishes. Declaring prompts and
|
|
141
|
+
// resources still installs their empty list handlers for clients that call
|
|
142
|
+
// them unconditionally.
|
|
143
|
+
capabilities: {
|
|
144
|
+
tools: { listChanged: false },
|
|
145
|
+
prompts: { listChanged: false },
|
|
146
|
+
resources: { listChanged: false, subscribe: false },
|
|
147
|
+
},
|
|
143
148
|
instructions: `Use this server to fetch current documentation whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service — even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. This includes API syntax, configuration, version migration, library-specific debugging, setup instructions, and CLI tool usage. Use even when you think you know the answer — your training data may not reflect recent changes. Prefer this over web search for library docs.
|
|
144
149
|
|
|
145
150
|
Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.`,
|
|
@@ -544,6 +549,7 @@ async function main() {
|
|
|
544
549
|
return server;
|
|
545
550
|
}, {
|
|
546
551
|
transport: stdioTransport,
|
|
552
|
+
maxSubscriptions: getMaxSubscriptions(),
|
|
547
553
|
onerror: (error) => console.error("MCP stdio error:", error),
|
|
548
554
|
});
|
|
549
555
|
installProcessShutdown(stdioHandle, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// Context7's tools, prompts, and resources are static for the process lifetime,
|
|
2
|
+
// so notification subscriptions provide no useful events.
|
|
3
|
+
export const DEFAULT_MAX_SUBSCRIPTIONS = 0;
|
|
3
4
|
export function getMaxSubscriptions(value = process.env.MCP_MAX_SUBSCRIPTIONS) {
|
|
4
5
|
if (value === undefined)
|
|
5
6
|
return DEFAULT_MAX_SUBSCRIPTIONS;
|
|
6
7
|
const parsed = Number(value);
|
|
7
|
-
if (Number.isSafeInteger(parsed) && parsed
|
|
8
|
+
if (Number.isSafeInteger(parsed) && parsed >= 0)
|
|
8
9
|
return parsed;
|
|
9
10
|
console.warn(`Invalid MCP_MAX_SUBSCRIPTIONS; using the default of ${DEFAULT_MAX_SUBSCRIPTIONS}.`);
|
|
10
11
|
return DEFAULT_MAX_SUBSCRIPTIONS;
|