Add the Cognee MCP server to Cursor
Config last verified Nov 10, 2026
The exact config to run Cognee in Cursor — paste it in, restart, and the tools load.
Prerequisites
- Cursor installed.
- LLM_API_KEY — API key for the LLM provider Cognee uses to extract the graph and answer queries (OpenAI by default).
Setup
1. Open ~/.cursor/mcp.json
2. Add this configuration
Add to ~/.cursor/mcp.json
~/.cursor/mcp.json
json
{
"mcpServers": {
"cognee": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TRANSPORT_MODE=stdio",
"-e",
"LLM_API_KEY",
"cognee/cognee-mcp:main"
],
"env": {
"LLM_API_KEY": "<LLM_API_KEY>"
}
}
}
}3. Restart Cursor and confirm the Cognee tools load.
Gotchas
Cursor keeps MCP servers under an "mcpServers" object in ~/.cursor/mcp.json for global use, and also reads a project-scoped .cursor/mcp.json so a repository can ship its own servers. Remote servers are configured with a bare "url" field and connect natively, with OAuth handled in-app when a server requires it.