# Context7

> Pull up-to-date, version-accurate library and framework documentation for coding, via the Context7 API.

Gives an agent up-to-date, version-accurate documentation for the libraries and frameworks it writes code against. The typical flow is two steps: search for a library to resolve its Context7 library id, then fetch that library's docs - optionally scoped to a topic and capped to a token budget so only the relevant section comes back.

## What it can do

| Method | What it does |
| --- | --- |
| `context7_search` | Search for a library or framework by name and get matching Context7 library ids. |
| `context7_get_library_docs` | Fetch a library's docs by id, optionally scoped by topic and capped by a token budget. |
| `context7_request` | Generic passthrough to any Context7 endpoint for full API coverage. |

## How to get your key

Context7 authenticates with a Bearer API key.

1. Sign in at [context7.com](https://context7.com).
2. Open your [dashboard](https://context7.com/dashboard) and find the **API key** section.
3. Create (or copy) a key and paste it into FlyMyAI.

## Fields to fill

| FlyMyAI field | Where it comes from |
| --- | --- |
| `CONTEXT7_API_KEY` | Context7 Dashboard -> API key |

## Troubleshooting

- **`401 Unauthorized`** - the key is wrong or has been rotated. Create a fresh key in the Context7 dashboard and paste it again.
- **No results from `context7_search`** - try the library's common name (e.g. `next.js`, `fastapi`); broaden the query and search again.
- **Docs come back empty or truncated** - raise the `tokens` budget, or drop the `topic` filter to get the full documentation set.

## Links

- [Context7](https://context7.com)
- [Context7 dashboard](https://context7.com/dashboard)
