Skip to content

Add Context7 Documentation Source #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 26, 2025
Merged

Add Context7 Documentation Source #208

merged 5 commits into from
Apr 26, 2025

Conversation

butschster
Copy link
Collaborator

@butschster butschster commented Apr 26, 2025

This PR adds a new docs source type that integrates with Context7 documentation service, allowing users to retrieve targeted documentation content based on library, topic, and token limits.

Features

  • New docs source type for accessing Context7 documentation
  • Library/topic/token-based filtering for precise content retrieval
  • Complete integration with existing modifier and content builder systems
  • JSON schema validation for configuration files

Example Usage

sources:
  - type: docs
    library: "laravel/docs"
    topic: controller
    tokens: 600
    description: "Laravel controller documentation"
    tags: ["laravel", "docs"]

Features

  • New docs-search tool for discovering available documentation libraries
  • Configuration options via MCP_DOCS_TOOLS_ENABLED environment variable

Implementation Details

  • Added DocsSearchAction to query Context7's search API (https://context7.com/api/v1/search)
  • Extended McpConfig with docs tools configuration options
  • Updated McpServerBootloader to conditionally register docs tools
  • Created documentation showing search and retrieval workflows

Benefits

  • Enables AI assistants to find and retrieve relevant documentation on demand
  • Complements the docs source type for static context generation
  • Provides direct access to specialized documentation without storing it locally
  • Supports efficient token usage through customizable token limits

- Add DocsSource class for retrieving content from Context7
- Implement DocsSourceFetcher for API communication
- Update JSON schema for validation
@butschster butschster added the sources New source type for data retrieval label Apr 26, 2025
@butschster butschster added this to the 1.27 milestone Apr 26, 2025
@butschster butschster self-assigned this Apr 26, 2025
@butschster butschster moved this to In review in Context Generator Apr 26, 2025
@butschster butschster added the type:enhancement New feature or request label Apr 26, 2025
@butschster butschster merged commit d2aee6f into main Apr 26, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Context Generator Apr 26, 2025
@butschster butschster deleted the issue/200 branch April 26, 2025 21:10
@butschster butschster linked an issue Apr 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sources New source type for data retrieval type:enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add new source type + tool for context7
1 participant