Cursor Integration
If you’re looking to unify your code exploration in Python repositories, Cursor provides an intuitive interface to interact with cognee’s MCP server directly.
If you are using Visual Studio Code, you can explore our Roo or Cline integration guides instead.
By integrating Cursor and cognee, you can effortlessly:
- Generate knowledge graphs from your codebase
- Access code search capabilities
- Explore advanced analysis tools without leaving your IDE
Let’s quickly set up cognee’s MCP server in Cursor, ensuring you can query your codebase and retrieve insights.
Why Use Cognee with Cursor?
Cognee specializes in building detailed knowledge graphs and retrieve accurate data based on user queries. Together with Cursor, you get:
- Streamlined Development Experience: Interact with cognee’s code analysis directly from Cursor’s Composer.
- Enhanced Code Understanding: Find out dependencies and relationships in your code base easily, and quickly search across large codebases.
- Efficiency Gains: No need to switch between terminals or external apps—simply invoke cognee’s powerful tools from within your IDE.
Prerequisites
Before proceeding, ensure you have the following:
- Cursor installed on your machine.
- A local copy of the cognee repository.
- An LLM API key (default setup uses OpenAI, e.g.,
sk-...
).
Integration Steps
1. Install Cursor
- Visit the official Cursor website to download Cursor.
- Follow the on-screen instructions to install Cursor on your operating system.
- Once installed, open Cursor to verify everything is functioning properly.
2. Run cognee MCP server
If you haven’t done yet, follow the installation and deployment steps here.
3. Add a New MCP Server in Cursor
- Launch Cursor, and click the Gear Icon to open Settings.
- Navigate to Tools & Integration > MCP Tools.
- Click on + Add MCP Server.
It will automatically open mcp.json, set the following:
{
"mcpServers": {
"cognee": {
"command": "uv",
"args": [
"--directory",
"/Users/path_to_your_local_cognee/cognee-mcp",
"run",
"cognee"
]
}
}
}
Save this configuration. You should see your new entry in the MCP Tools.
4. Refresh and Verify Cognee in Cursor
You can use the toggle to refresh the connection.
If all goes well, you should see a list of available tools from cognee. This indicates cognee’s MCP server is running correctly, and Cursor has successfully loaded the server’s capabilities.
7. Use Cognee in Cursor Chat
- Open the Chat in Cursor.
- Make sure Agent is selected.
- Issue a prompt referencing cognee tools. Cursor will pass your request to the cognee MCP server, and results will be displayed directly in the Chat interface.
You can start with experimenting “cognify” tool for adding information to cognee memory and “search” to run queries about your data.
Remember: Use the
CODE
search type to query only after codify tool has been used. Tip: For larger codebases, consider incremental indexing or caching to speed up analysis.
You’ve now set up cognee’s MCP server with Cursor! Enjoy a richer, more powerful code exploration experience right inside your IDE.
Join the Conversation!
Have questions or feedback? Join our community to connect with professionals, share insights, and get answers to your questions!