chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: CodeRabbit
|
||||
sidebarTitle: CodeRabbit
|
||||
description: AI-powered code review tool
|
||||
---
|
||||
|
||||
[CodeRabbit](https://coderabbit.ai) is an AI-powered code review tool that automatically reviews pull requests. By connecting Context7 as an MCP server, CodeRabbit can access up-to-date library documentation during reviews, helping it verify implementations against the latest API references and best practices.
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Navigate to MCP Servers">
|
||||
Go to your [CodeRabbit dashboard](https://app.coderabbit.ai) and navigate to **Integrations** → **MCP Servers**.
|
||||
|
||||

|
||||
</Step>
|
||||
<Step title="Add Context7">
|
||||
Click the **Add** button next to **Context7** MCP server.
|
||||
|
||||
Add the following header for higher rate limits:
|
||||
|
||||
| Header | Value |
|
||||
|--------|-------|
|
||||
| `CONTEXT7_API_KEY` | Your API key from the [Context7 dashboard](https://context7.com/dashboard) |
|
||||
|
||||
```json
|
||||
{
|
||||
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
</Step>
|
||||
<Step title="Connect">
|
||||
Click the **Connect** button to connect the server.
|
||||
|
||||

|
||||
</Step>
|
||||
<Step title="Enable for Public Repos">
|
||||
To use Context7 with public repositories, go to **Organization Settings** → **Configuration** → **Knowledge Base**. In the MCP section, select **Enabled** instead of **Auto** and click **Apply Changes**.
|
||||
|
||||

|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Usage Guidance
|
||||
|
||||
In the **Usage Guidance** field, you can instruct CodeRabbit on how to use Context7 during reviews. For example:
|
||||
|
||||
```
|
||||
Use Context7 to look up documentation for any libraries used in the code being reviewed.
|
||||
Verify that API usage matches the latest documentation and flag any deprecated patterns.
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
Once connected, CodeRabbit will query Context7 for relevant library documentation when reviewing pull requests. This helps CodeRabbit:
|
||||
|
||||
- Verify correct API usage against the latest documentation
|
||||
- Identify deprecated methods or patterns
|
||||
- Suggest improvements based on library best practices
|
||||
- Provide more accurate and informed review comments
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: Factory AI
|
||||
sidebarTitle: Factory AI
|
||||
description: AI-native software development platform with Droids
|
||||
---
|
||||
|
||||
[Factory AI](https://factory.ai) is a coding agent platform that uses "Droids" to handle development tasks. By connecting Context7 as an MCP server, Factory Droids can access up-to-date library documentation during coding tasks.
|
||||
|
||||
For more details on how Factory AI handles MCP, see the [Factory AI MCP documentation](https://docs.factory.ai/cli/configuration/mcp).
|
||||
|
||||
## Setup
|
||||
|
||||
There are multiple ways to add Context7 as an MCP server in Factory AI. Replace `YOUR_API_KEY` with your API key from the [Context7 dashboard](https://context7.com/dashboard).
|
||||
|
||||
### Using the CLI
|
||||
|
||||
```bash
|
||||
droid mcp add context7 https://mcp.context7.com/mcp --type http --header "CONTEXT7_API_KEY: YOUR_API_KEY"
|
||||
```
|
||||
|
||||
### Using the MCP Manager
|
||||
|
||||
Run the `/mcp` command inside Factory and add Context7 from the interface.
|
||||
|
||||
### Using a Configuration File
|
||||
|
||||
Add Context7 directly to your `.factory/mcp.json` (project-level) or `~/.factory/mcp.json` (user-level):
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"context7": {
|
||||
"type": "http",
|
||||
"url": "https://mcp.context7.com/mcp",
|
||||
"headers": {
|
||||
"CONTEXT7_API_KEY": "YOUR_API_KEY"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
Once connected, Factory Droids will query Context7 for relevant library documentation during coding tasks. This helps Droids:
|
||||
|
||||
- Use correct API signatures and patterns from the latest documentation
|
||||
- Avoid deprecated methods or outdated usage patterns
|
||||
- Generate implementations aligned with library best practices
|
||||
- Produce higher-quality code with fewer revision cycles
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: GitHub Actions
|
||||
sidebarTitle: GitHub Actions
|
||||
description: Automatically refresh your Context7 library when your docs change
|
||||
---
|
||||
|
||||
Keep your Context7 documentation in sync by triggering a refresh whenever you push to your main branch.
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Get your API key">
|
||||
Go to your [Context7 dashboard](https://context7.com/dashboard) and copy your API key.
|
||||
</Step>
|
||||
<Step title="Add the API key as a repository secret">
|
||||
In your GitHub repository, go to **Settings** → **Secrets and variables** → **Actions** and add a new secret:
|
||||
|
||||
| Name | Value |
|
||||
|------|-------|
|
||||
| `CONTEXT7_API_KEY` | Your API key from the Context7 dashboard |
|
||||
</Step>
|
||||
<Step title="Create the workflow file">
|
||||
Add the following file to your repository at `.github/workflows/context7-refresh.yml`:
|
||||
|
||||
```yaml
|
||||
name: Refresh Context7 Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master # change to your default branch if different
|
||||
|
||||
jobs:
|
||||
refresh:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Context7 Refresh
|
||||
run: |
|
||||
curl -s -X POST https://context7.com/api/v1/refresh \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${{ secrets.CONTEXT7_API_KEY }}" \
|
||||
-d '{"libraryName": "/${{ github.repository }}"}'
|
||||
```
|
||||
|
||||
This uses `${{ github.repository }}` to automatically resolve to your repository's `owner/repo` (e.g., `vercel/next.js`). If your library ID on Context7 differs from your GitHub repository name, replace it with the correct value (e.g., `/your-org/your-repo`).
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Refreshing a Specific Branch
|
||||
|
||||
To refresh a non-default branch, add the `branch` field to the request body. The `branch` value must match a branch name that already exists on your library in Context7.
|
||||
|
||||
```yaml
|
||||
- name: Trigger Context7 Refresh
|
||||
run: |
|
||||
curl -s -X POST https://context7.com/api/v1/refresh \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${{ secrets.CONTEXT7_API_KEY }}" \
|
||||
-d '{"libraryName": "/your-org/your-repo", "branch": "v2"}'
|
||||
```
|
||||
|
||||
<Note>
|
||||
If the branch has not been added to your library on Context7, the refresh will fail with a `branch_not_found` error.
|
||||
</Note>
|
||||
|
||||
## Private Repositories
|
||||
|
||||
For private repositories, include a `gitToken` so Context7 can access your code:
|
||||
|
||||
```yaml
|
||||
- name: Trigger Context7 Refresh
|
||||
run: |
|
||||
curl -s -X POST https://context7.com/api/v1/refresh \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${{ secrets.CONTEXT7_API_KEY }}" \
|
||||
-d '{"libraryName": "/your-org/your-repo", "gitToken": "${{ secrets.GIT_ACCESS_TOKEN }}"}'
|
||||
```
|
||||
|
||||
<Note>
|
||||
Private sources require a Pro or Enterprise plan. See the [Private Sources](/howto/private-sources) guide for more details.
|
||||
</Note>
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Mastra
|
||||
sidebarTitle: Mastra
|
||||
description: TypeScript framework for building AI agents
|
||||
---
|
||||
|
||||
[Mastra](https://mastra.ai) is a TypeScript framework for building AI agents. It provides first-class MCP support through its `MCPClient` class. By connecting Context7 as an MCP server, your Mastra agents can access up-to-date library documentation, enabling them to generate accurate code and answer technical questions with current API references.
|
||||
|
||||
For more details on how Mastra handles MCP, see the [Mastra MCP documentation](https://mastra.ai/docs/mcp/overview).
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Install the MCP Package">
|
||||
Add the Mastra MCP package to your project:
|
||||
|
||||
```bash
|
||||
npm install @mastra/mcp@latest
|
||||
```
|
||||
</Step>
|
||||
<Step title="Create an MCP Client">
|
||||
Configure an `MCPClient` that connects to Context7:
|
||||
|
||||
```typescript
|
||||
import { MCPClient } from "@mastra/mcp";
|
||||
|
||||
const context7 = new MCPClient({
|
||||
id: "context7",
|
||||
servers: {
|
||||
context7: {
|
||||
url: new URL("https://mcp.context7.com/mcp"),
|
||||
requestInit: {
|
||||
headers: {
|
||||
CONTEXT7_API_KEY: process.env.CONTEXT7_API_KEY!,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Set `CONTEXT7_API_KEY` in your environment with your API key from the [Context7 dashboard](https://context7.com/dashboard).
|
||||
</Step>
|
||||
<Step title="Connect to Your Agent">
|
||||
Pass the Context7 tools to your Mastra agent:
|
||||
|
||||
```typescript
|
||||
import { Agent } from "@mastra/core/agent";
|
||||
|
||||
const agent = new Agent({
|
||||
id: "coding-assistant",
|
||||
name: "Coding Assistant",
|
||||
instructions: "You are a helpful coding assistant with access to up-to-date library documentation via Context7.",
|
||||
model: "anthropic/claude-sonnet-4-6",
|
||||
tools: await context7.listTools(),
|
||||
});
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
Once connected, your Mastra agents will query Context7 for relevant library documentation. This helps agents:
|
||||
|
||||
- Answer technical questions with accurate, up-to-date API references
|
||||
- Generate code that follows current library patterns and best practices
|
||||
- Avoid hallucinating outdated or incorrect API usage
|
||||
- Provide version-specific guidance for any supported library
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Tembo
|
||||
sidebarTitle: Tembo
|
||||
description: Orchestration layer for AI-powered engineering workflows
|
||||
---
|
||||
|
||||
[Tembo](https://tembo.io) is a platform for orchestrating AI coding agents across repositories and integrations. Context7 is available as a built-in MCP integration in Tembo, giving agents access to up-to-date library documentation.
|
||||
|
||||
For more details on how Tembo handles MCP, see the [Tembo MCP documentation](https://docs.tembo.io/integrations/mcp).
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Navigate to Integrations">
|
||||
Go to the **Integrations** page in your Tembo dashboard. You'll see Context7 listed under **MCP Servers**.
|
||||
|
||||

|
||||
</Step>
|
||||
<Step title="Install Context7">
|
||||
Click the **Install** button on the **Context7** card.
|
||||
</Step>
|
||||
<Step title="Verify Connection">
|
||||
After installation, Context7 will appear under your **Installed** integrations.
|
||||
|
||||

|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
Once connected, Tembo agents will query Context7 for relevant library documentation during tasks. This helps agents:
|
||||
|
||||
- Generate correct implementations based on the latest API references
|
||||
- Identify deprecated patterns during automated code reviews
|
||||
- Produce PRs that follow current library best practices
|
||||
- Reduce back-and-forth by getting it right the first time
|
||||
Reference in New Issue
Block a user