CursorBeginner

How to Add Library Docs as Context with @Docs in Cursor

Index a library's documentation in Cursor so the agent answers with current, accurate API details.

7 minBeginner

Models can be out of date on fast-moving libraries. Cursor's @Docs feature fixes this by crawling and indexing a documentation site, then letting you pull that index into any prompt. The agent then quotes the real docs instead of relying on stale training data. This guide indexes a docs site and uses it in a question.

  • Cursor installed
  • The URL of the documentation site you want to index
  • A question about that library you want answered accurately

Open the docs manager

In a chat or Composer prompt, type @Docs and choose Add new doc. Cursor opens a small dialog where you paste the base URL of the docs you want it to crawl.

Cursor - Add documentation
Add new doc
------------------------------
URL: https://docs.example.dev
Name: Example SDK
[ Indexing... 42 / 130 pages ]
Cursor crawls from the URL you give it and shows indexing progress.

Let it finish indexing

Indexing runs in the background. Larger docs sites take a few minutes. Once the status shows complete, the doc set is available to every chat and Composer prompt in Cursor, not just the current one.

Reference the docs in a prompt

Type @Docs again and pick the set you indexed. Then ask your question. The agent searches the indexed pages and grounds its answer in them, often citing the specific section.

Prompt
@Docs Example SDK
What is the correct way to paginate the listItems endpoint?
Show the exact parameter names from the current docs.

Keep the index fresh

When a library publishes a new version, re-index its docs from the same manager so the agent picks up the changes. Old entries can be removed if you no longer use that library.

Index the version you actually run
Many docs sites host multiple versions. Point @Docs at the version your project depends on so you do not get advice for an API you are not using.

Result: the agent answers questions about a third-party library using its real, current documentation, which sharply reduces invented method names and outdated patterns.

Watch related tutorials

Tags
#cursor#docs#context#rag