Home Tutorials Categories Skills About
ZH EN JA KO
📚

Context7

Documentation Injection Developer Tools

Install Command

npx clawhub@latest install context7

Installation Guide

1
Check Environment

Make sure Node.js 22+ and OpenClaw are installed. Run openclaw --version in your terminal to verify.

2
Run Installation

Run the install command above in your terminal. ClawHub will automatically download and install Context7 to the ~/.openclaw/skills/ directory.

3
Verify Installation

Run openclaw skills list to check your installed skills and confirm Context7 appears in the list.

4
Configure (Optional)

Follow the configuration instructions in the description below to add skill settings to ~/.config/openclaw/openclaw.json5.

Manual Installation: Copy the Skill folder to ~/.openclaw/skills/ or the skills/ directory in your project root. Make sure the folder contains a SKILL.md file.
Real-time fetching of latest official documentation Precise querying by library name and topic Automatic context injection into conversations

Detailed Description

Context7 solves the most common pain point of AI coding assistants — using outdated APIs and non-existent functions. It can fetch the latest official documentation of any open-source library in real-time and inject accurate code examples and API descriptions into the AI conversation context.

Core Features

  • Library Search (resolve_library_id): Fuzzy search by library name, returning a list of matching libraries with their Context7 IDs to precisely locate target documentation
  • Documentation Retrieval (get_library_docs): Fetch the latest documentation content for a specified library, with support for filtering by topic and controlling the number of returned tokens
  • Version Awareness: Always returns the latest version of documentation, avoiding the outdated API issues found in AI training data
  • Code Examples: Returned documentation includes ready-to-use code examples, ensuring the correctness of generated code

Configuration

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@context7/mcp"]
      // No API Key required, free to use
    }
  }
}

Use Cases

  • Developing with new frameworks: Ensure AI-generated Next.js/Svelte/Vue code uses the latest APIs
  • Library version upgrades: View new version Breaking Changes and migration guides
  • API reference lookup: Quickly get parameter, return value, and usage examples for a function
  • Learning new technologies: Get authoritative official documentation rather than outdated blog content