# Context7 MCP (beta)

### What is Context7 MCP?

We all know that writing code with AI clients like Cursor or Claude Code can lead to a never ending loop of bugs.&#x20;

"You broke it again!", "This is not how you initialize the class, FOCUSSSSS!" <- This used to be me after a whole morning of letting Claude code for me 😅

These bugs often come from a lack of context given to the LLM, for example if you ask it to implement a feature with the Ruby LLM gem, it might not have the latest version of the documentation and suggest an older syntax. The solution? connect the documentation directly in the LLM's chat thanks to [Context7 MCP.](https://context7.com/)

In this library you will find thousands of documentation ready to be used.

<figure><img src="/files/eoLOVD591TJE4uErwczj" alt=""><figcaption></figcaption></figure>

All the documentation I code with is related to the  Lightning Rails Stack:

* Ruby on Rails
* Lightning Rails (Of course ☺️ )
* Lucide rails
* Tailwind CSS
* DaisyUI
* ...

### How to Use Context7 MCP with Cursor AI?

<figure><img src="/files/6PXBcPd618DyG7mMqz7J" alt=""><figcaption></figcaption></figure>

1. First we will head to <https://docs.cursor.com/tools/mcp>
2. Search for context7
3. Click on "+ Add context7 to cursor"
4. And voila, you should see a new MCP in your cursor settings with 2 new tools.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lightningrails.com/ai-and-code-mcps/context7-mcp-beta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
