chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "context7",
|
||||
"version": "1.0.1",
|
||||
"description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.",
|
||||
"author": {
|
||||
"name": "Upstash",
|
||||
"email": "context7@upstash.com",
|
||||
"url": "https://upstash.com"
|
||||
},
|
||||
"homepage": "https://context7.com",
|
||||
"repository": "https://github.com/upstash/context7",
|
||||
"license": "MIT",
|
||||
"keywords": ["documentation", "context", "mcp", "library-docs"],
|
||||
"skills": "./skills/",
|
||||
"mcpServers": "./.mcp.json",
|
||||
"interface": {
|
||||
"displayName": "Context7",
|
||||
"shortDescription": "Fetch current library documentation in Codex",
|
||||
"longDescription": "Context7 adds current, version-aware library documentation and code examples to Codex through the Context7 MCP server.",
|
||||
"developerName": "Upstash",
|
||||
"category": "Developer Tools",
|
||||
"capabilities": ["Read"],
|
||||
"websiteURL": "https://context7.com",
|
||||
"privacyPolicyURL": "https://upstash.com/privacy",
|
||||
"termsOfServiceURL": "https://upstash.com/terms",
|
||||
"defaultPrompt": [
|
||||
"Use Context7 for Next.js middleware docs.",
|
||||
"Find current Prisma relation query examples."
|
||||
],
|
||||
"brandColor": "#059669"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"context7": {
|
||||
"type": "http",
|
||||
"url": "https://mcp.context7.com/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
# Context7 Plugin for Codex
|
||||
|
||||
Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories.
|
||||
|
||||
## Installation
|
||||
|
||||
Add the Context7 marketplace and install the plugin:
|
||||
|
||||
```bash
|
||||
codex plugin marketplace add upstash/context7
|
||||
codex plugin add context7@context7-marketplace
|
||||
```
|
||||
|
||||
After adding the plugin, a browser window opens so you can log in to Context7 via OAuth. Start a new Codex thread after installation so Codex can load the plugin's skill and MCP tools.
|
||||
|
||||
## What's Included
|
||||
|
||||
This plugin provides:
|
||||
|
||||
- **MCP Server** - Connects Codex to Context7's documentation service
|
||||
- **Skills** - Auto-triggers documentation lookups when you ask about libraries
|
||||
|
||||
## Authentication
|
||||
|
||||
The plugin connects to the hosted Context7 MCP server:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://mcp.context7.com/mcp"
|
||||
}
|
||||
```
|
||||
|
||||
When you add the plugin, a browser window opens to log in to Context7 via OAuth, so your requests use your account's authenticated rate limits. On remote or headless machines where a browser can't open, run `npx ctx7 setup --codex` instead — it uses the OAuth device flow and writes an API-key-backed configuration to `~/.codex/config.toml`. Create or manage API keys in the [Context7 dashboard](https://context7.com/dashboard).
|
||||
|
||||
## Available Tools
|
||||
|
||||
### resolve-library-id
|
||||
|
||||
Searches for libraries and returns Context7-compatible identifiers.
|
||||
|
||||
```text
|
||||
Input: "next.js"
|
||||
Output: { id: "/vercel/next.js", name: "Next.js", versions: ["v15.1.8", "v14.2.0", ...] }
|
||||
```
|
||||
|
||||
### query-docs
|
||||
|
||||
Fetches documentation for a specific library, ranked by relevance to your question.
|
||||
|
||||
```text
|
||||
Input: { libraryId: "/vercel/next.js", query: "app router middleware" }
|
||||
Output: Relevant documentation snippets with code examples
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
The bundled skill works automatically when you ask about libraries:
|
||||
|
||||
- "How do I set up authentication in Next.js 15?"
|
||||
- "Show me React Server Components examples"
|
||||
- "What's the Prisma syntax for relations?"
|
||||
|
||||
You can also invoke it explicitly:
|
||||
|
||||
```text
|
||||
use context7 for Next.js middleware docs
|
||||
use context7 for Prisma query examples with relations
|
||||
use context7 for the Supabase syntax for row-level security
|
||||
```
|
||||
|
||||
To get documentation for a specific version, include the version in the library ID:
|
||||
|
||||
```text
|
||||
/vercel/next.js/v15.1.8
|
||||
/supabase/supabase/v2.45.0
|
||||
```
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: context7-mcp
|
||||
description: This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
|
||||
---
|
||||
|
||||
When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Activate this skill when the user:
|
||||
|
||||
- Asks setup or configuration questions ("How do I configure Next.js middleware?")
|
||||
- Requests code involving libraries ("Write a Prisma query for...")
|
||||
- Needs API references ("What are the Supabase auth methods?")
|
||||
- Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
|
||||
|
||||
## How to Fetch Documentation
|
||||
|
||||
### Step 1: Resolve the Library ID
|
||||
|
||||
Call `resolve-library-id` with:
|
||||
|
||||
- `libraryName`: The library name extracted from the user's question
|
||||
- `query`: The user's full question (improves relevance ranking)
|
||||
|
||||
### Step 2: Select the Best Match
|
||||
|
||||
From the resolution results, choose based on:
|
||||
|
||||
- Exact or closest name match to what the user asked for
|
||||
- Higher benchmark scores indicate better documentation quality
|
||||
- If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs
|
||||
|
||||
### Step 3: Fetch the Documentation
|
||||
|
||||
Call `query-docs` with:
|
||||
|
||||
- `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`)
|
||||
- `query`: The user's specific question, scoped to a single concept
|
||||
|
||||
If the user's question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate `query-docs` call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic.
|
||||
|
||||
### Step 4: Use the Documentation
|
||||
|
||||
Incorporate the fetched documentation into your response:
|
||||
|
||||
- Answer the user's question using current, accurate information
|
||||
- Include relevant code examples from the docs
|
||||
- Cite the library version when relevant
|
||||
|
||||
## Guidelines
|
||||
|
||||
- **Be specific**: Pass the user's full question as the query for better results, but keep each query to a single concept
|
||||
- **One topic per query**: Split multi-topic questions into separate `query-docs` calls — resolve the library ID once, then query per concept, unless the question is about how the concepts interact
|
||||
- **Version awareness**: When users mention versions ("Next.js 15", "React 19"), use version-specific library IDs if available from the resolution step
|
||||
- **Prefer official sources**: When multiple matches exist, prefer official/primary packages over community forks
|
||||
Reference in New Issue
Block a user