Cognee MCP server
Cognee's MCP server: remember, recall and forget over a knowledge graph built from text, files and code, plus a code-graph search tool.
Cognee turns text, uploaded files and source code into a knowledge graph with vector embeddings beside it. Calling remember without a session_id runs Cognee's add and cognify pipeline: content is chunked, an LLM extracts entities and the relationships between them into the graph, chunks are embedded, and a self-improvement pass runs afterwards. With a session_id, remember writes to a fast session cache instead. recall picks a search strategy on its own unless told otherwise, from LLM-written answers over the graph (graph completion, RAG completion, temporal) to raw chunk, summary or Cypher retrieval. Locally the defaults are SQLite for metadata, LanceDB for vectors and an embedded graph database, and each can be swapped for Postgres, Neo4j and others.
The server in the cognee-mcp folder of the cognee repo registers five tools: remember, recall, forget, code_search and cognify_status. By default tools/list advertises the first four plus FastMCP's search_tools and call_tool, and cognify_status is reached through that search; COGNEE_MCP_TOOL_MODE=all lists everything. Each MCP client writes to its own dataset by default (claude_code_memory, cursor_vscode_memory), so two agents on one machine do not share memory unless you set COGNEE_MCP_AGENT_SCOPED=false. It runs over stdio, SSE or Streamable HTTP, from source with uv or from the cognee/cognee-mcp Docker image, needs an LLM API key, and can use Cognee Cloud as its backend through COGNEE_SERVICE_URL. Cognee is Apache 2.0. Memory is written only when the agent calls remember.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Add to ~/.claude.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>"
}
}
}
}claude mcp add cognee -- docker run -i --rm -e TRANSPORT_MODE=stdio -e LLM_API_KEY cognee/cognee-mcp:mainAvailable tools
| Tool | Description |
|---|---|
| remember | Store text or an uploaded file (up to 10 MB) as permanent graph memory through the add and cognify pipeline, or, with a session_id, as a fast session cache entry. |
| recall | Search memory with automatic routing across search types such as graph completion, RAG completion, chunks, summaries and Cypher; checks the session cache first when a session_id is given. |
| forget | Delete one data item, a whole dataset by name or id, or everything the user owns, from the relational, graph and vector stores, optionally with search history. |
| code_search | Run structured operations against an indexed code graph: facts, symbol search, paths between symbols, impact analysis, architecture, flows, hubs, or a plain-language question answered with file and line citations. |
| cognify_status | Report active and completed pipeline jobs for a dataset, including failures from background ingestion started with remember. Not listed by default; found through search_tools. |
Required configuration
- LLM_API_KEYRequired
API key for the LLM provider Cognee uses to extract the graph and answer queries (OpenAI by default).
- COGNEE_SERVICE_URLOptional
URL of a Cognee Cloud or self-hosted Cognee instance to use as the backend instead of local storage.
- COGNEE_API_KEYOptional
API key for the instance named in COGNEE_SERVICE_URL.
- COGNEE_MCP_TOOL_MODEOptional
default, minimal (only remember, recall and forget pinned) or all (every tool listed, no tool search).
- COGNEE_MCP_AGENT_SCOPEDOptional
Set to false so every MCP client shares main_dataset instead of its own per-client dataset.
What you can do with it
Query documentation and past notes as a graph
Load design docs, runbooks and notes with remember, then ask recall a question that spans several of them; graph completion follows the extracted entities and relationships instead of matching one chunk.
Ask how a codebase fits together
After indexing a repository, code_search answers impact and path questions, such as which modules depend on a service, and returns file and line citations the agent can open.
FAQ
- Is it free?
- The server and the Cognee library are open source under Apache 2.0 and free to self-host, though you pay your LLM and embedding provider. Cognee Cloud has a free tier, then charges $1 per million tokens.
- Does it support remote or OAuth?
- It can serve Streamable HTTP or SSE from a host you run, and it can use Cognee Cloud as its backend with COGNEE_SERVICE_URL and an API key. The cognee-mcp README documents no OAuth flow.
- Is memory shared between agents or people?
- By default each MCP client gets its own dataset, so Claude Code and Cursor on the same machine keep separate memory. A shared Cognee backend with permissions lets several users write to one graph, but what goes in is whatever their agents chose to remember. Glen instead records every teammate's sessions automatically and filters recall by what each user may see.
