Skip to content

Context7 Platform -- Up-to-date docs for AI agents

CTX7-3222: Narrow Context7 usage exclusion to allow porting code (#3462)

Enes Gules5a2b65145b59
diff --git a/.changeset/narrow-usage-exclusion.md b/.changeset/narrow-usage-exclusion.md
new file mode 100644
index 00000000..e12359fe
--- /dev/null
+++ b/.changeset/narrow-usage-exclusion.md
@@ -0,0 +1,6 @@
+---
+"@upstash/context7-mcp": patch
+"ctx7": patch
+---
+
+Narrow the "Do not use for" line in the server instructions and rule templates so agents use Context7 when they port code between libraries, platforms, or SQL dialects.
diff --git a/packages/cli/src/setup/templates.ts b/packages/cli/src/setup/templates.ts
index 01e9f4fd..fe7f679d 100644
--- a/packages/cli/src/setup/templates.ts
+++ b/packages/cli/src/setup/templates.ts
@@ -5,9 +5,9 @@ const GITHUB_RAW_URLS = [
"https://raw.githubusercontent.com/upstash/context7/main",
];
-const FALLBACK_MCP = `Use Context7 MCP 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.
+const FALLBACK_MCP = `Use Context7 MCP 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, porting code between libraries, platforms, or SQL dialects, 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.
-Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+Do not use for: refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## Steps
@@ -17,9 +17,9 @@ Do not use for: refactoring, writing scripts from scratch, debugging business lo
4. Answer using the fetched docs
`;
-const FALLBACK_CLI = `Use the \`ctx7\` CLI 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.
+const FALLBACK_CLI = `Use the \`ctx7\` CLI 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, porting code between libraries, platforms, or SQL dialects, 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.
-Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+Do not use for: refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## Steps
diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.ts
index 07149e75..0b8fc9d4 100644
--- a/packages/mcp/src/index.ts
+++ b/packages/mcp/src/index.ts
@@ -289,9 +289,9 @@ function createMcpServer(mcpContext: McpRequestContext) {
"resources/templates/list": STATIC_LIST_CACHE_HINT,
"server/discover": STATIC_LIST_CACHE_HINT,
},
- 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.
+ 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, porting code between libraries, platforms, or SQL dialects, 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.
-Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.`,
+Do not use for: refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.`,
};
const server = mcpInstrumentation
? mcpInstrumentation.createServer(serverInfo, serverOptions, mcpContext)
diff --git a/plugins/agent-plugins/context7/plugin.json b/plugins/agent-plugins/context7/plugin.json
index 5f980cf6..9d39617c 100644
--- a/plugins/agent-plugins/context7/plugin.json
+++ b/plugins/agent-plugins/context7/plugin.json
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "context7",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your coding agent's context.",
"author": {
"name": "Upstash",
diff --git a/plugins/agent-plugins/context7/skills/context7-mcp/SKILL.md b/plugins/agent-plugins/context7/skills/context7-mcp/SKILL.md
index f82f638b..dec17a70 100644
--- a/plugins/agent-plugins/context7/skills/context7-mcp/SKILL.md
+++ b/plugins/agent-plugins/context7/skills/context7-mcp/SKILL.md
@@ -1,6 +1,6 @@
---
name: context7-mcp
-description: Fetches current, version-specific library documentation and code examples through the Context7 MCP server. Use whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service, including API syntax, configuration, setup instructions, version migration, CLI usage, and library-specific debugging. Use when generating code that calls a third-party library, and when the user names a version such as Next.js 16 or React 19. Use even for well-known libraries like React, Vue, Next.js, Prisma, Supabase, Express, Tailwind, Django, and Spring Boot, because training data may not reflect recent changes. Prefer this over web search for library documentation. Do not use it for refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts, or when the user has already supplied the relevant documentation.
+description: Fetches current, version-specific library documentation and code examples through the Context7 MCP server. Use whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service, including API syntax, configuration, setup instructions, version migration, porting code between libraries, platforms, or SQL dialects, CLI usage, and library-specific debugging. Use when generating code that calls a third-party library, and when the user names a version such as Next.js 16 or React 19. Use even for well-known libraries like React, Vue, Next.js, Prisma, Supabase, Express, Tailwind, Django, and Spring Boot, because training data may not reflect recent changes. Prefer this over web search for library documentation. Do not use it for refactoring, debugging, or reviewing code that does not depend on a library or platform API, for general programming concepts, or when the user has already supplied the relevant documentation.
---
When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.
diff --git a/plugins/context7-power/POWER.md b/plugins/context7-power/POWER.md
index 09f9274e..868aeed9 100644
--- a/plugins/context7-power/POWER.md
+++ b/plugins/context7-power/POWER.md
@@ -20,9 +20,9 @@ Use this Power when the user:
- Requests code involving a specific library or framework
- Needs API references or current documentation
- Mentions a framework, SDK, or developer tool by name
-- Needs help with version migrations, library-specific debugging, or CLI usage
+- Needs help with version migrations, porting code between libraries, platforms, or SQL dialects, library-specific debugging, or CLI usage
-Do not use this Power for refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+Do not use this Power for refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## Usage
@@ -67,9 +67,9 @@ Incorporate the fetched documentation into your response:
- Keep each query to one topic; split multi-topic questions into separate `query-docs` calls, unless the question is about how the concepts interact
- When users mention versions ("Next.js 16", "React 19"), use version-specific library IDs if available from the resolution step
- When multiple matches exist, prefer official/primary packages over community forks
-- Use this Power for API syntax, configuration, setup instructions, version migration, library-specific debugging, and CLI tool usage
+- Use this Power for API syntax, configuration, setup instructions, version migration, porting code between libraries, platforms, or SQL dialects, library-specific debugging, and CLI tool usage
- Use Context7 even when you think you know the answer — your training data may not reflect recent changes. Prefer this over web search for library docs.
-- Do not use Context7 for refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+- Do not use Context7 for refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## License and Support
diff --git a/rules/context7-cli.md b/rules/context7-cli.md
index 2f36e3dd..7d646370 100644
--- a/rules/context7-cli.md
+++ b/rules/context7-cli.md
@@ -1,6 +1,6 @@
-Use the `ctx7` CLI 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.
+Use the `ctx7` CLI 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, porting code between libraries, platforms, or SQL dialects, 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.
-Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+Do not use for: refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## Steps
diff --git a/rules/context7-mcp.md b/rules/context7-mcp.md
index 08934524..0daa6c9b 100644
--- a/rules/context7-mcp.md
+++ b/rules/context7-mcp.md
@@ -1,6 +1,6 @@
-Use Context7 MCP 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.
+Use Context7 MCP 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, porting code between libraries, platforms, or SQL dialects, 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.
-Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
+Do not use for: refactoring, debugging, or reviewing code that does not depend on a library or platform API, or general programming concepts.
## Steps