Context7 MCP

Adding Libraries

Add a public library to Context7 so AI coding assistants get up-to-date docs for it
2 min read

Context7 indexes public libraries from their source repositories so developers get current, version-specific documentation inside their coding tools. Anyone can add a public library — you don't need to own it.

Add a Library#

The fastest way to add a library is through the web interface:

Add a Library →

Open the Add Library page

Go to context7.com/add-library and select the GitHub tab.

Paste the repository URL

Paste the public GitHub repository URL for the library you want to add.

Adjust parsing (optional)

Optionally narrow what gets indexed by setting included folders and exclusions. For finer control — committed to the repository itself — add a context7.json file (see Library Owners).

Submit

Submit the repository. Context7 parses and indexes the documentation, then makes it available by its library ID (format: /org/project).

Note

This page is for public libraries. To add internal or private documentation, see the Private Sources guide (requires a Pro or Enterprise plan).

What Gets Indexed#

Context7 parses documentation files — .md, .mdx, .markdown, .rst, .txt, and .ipynb — and extracts the code examples and explanations they contain. Raw source code files (.py, .ts, .go, and so on) are not indexed when documentation is present; a library's docs are expected to show the important usage examples.

If a repository contains little or no documentation content, Context7 falls back to generating examples from the source code itself. For public repositories this fallback is automatic — there is no setting to turn it on or off. For private repositories, generating docs from source code is opt-in: check Generate docs when adding the source, or pass the generateDocs flag via the API.

To control which folders and files are scanned, set included folders when submitting, or commit a context7.json file to the repository (see Library Owners).

Maintain the Library?#

If you own or maintain the library, you can take control of how it appears in Context7 — configure parsing with context7.json, manage versions through a web admin panel, and get higher refresh limits.

Keeping Docs Fresh#

Once a library is added, Context7 refreshes its documentation automatically based on popularity, so developers keep receiving up-to-date docs without any manual work.

For tighter control, add the Context7 GitHub Action to trigger a refresh on every push to your default branch — so a new release's docs are indexed as soon as you ship it.

Need Help?#

If you encounter issues or need assistance adding a library, please open an issue or reach out to our community.