cognee‑mcp - Run cognee’s memory engine as a Model Context Protocol server
Demo
.
Learn more
·
Join Discord
·
Join r/AIMemory
[](https://GitHub.com/topoteretes/cognee/network/)
[](https://GitHub.com/topoteretes/cognee/stargazers/)
[](https://GitHub.com/topoteretes/cognee/commit/)
[](https://github.com/topoteretes/cognee/tags/)
[](https://pepy.tech/project/cognee)
[](https://github.com/topoteretes/cognee/blob/main/LICENSE)
[](https://github.com/topoteretes/cognee/graphs/contributors)

Build memory for Agents and query from any client that speaks MCP – in your terminal or IDE.
## ✨ Features
- Multiple transports – choose Streamable HTTP --transport http (recommended for web deployments), SSE --transport sse (real‑time streaming), or stdio (classic pipe, default)
- **Cloud Mode** – connect to [Cognee Cloud](https://www.cognee.ai) via `--serve-url` or `COGNEE_SERVICE_URL` env var (see [Connection Modes](#-connection-modes))
- **API Mode** – connect to an already running Cognee FastAPI server (see [Connection Modes](#-connection-modes))
- **Minimal Memory API** – exposes only `remember`, `recall`, and `forget` for agent memory workflows
- Integrated logging – all actions written to a rotating file (see get_log_file_location()) and mirrored to console in dev
- Session-aware memory – store fast session cache entries or permanent graph memory through one `remember` tool
- Focused recall – query memory through one `recall` tool with optional session and search controls
- Simple deletion – remove a dataset or all owned memory through one `forget` tool
Please refer to our documentation [here](https://docs.cognee.ai/how-to-guides/deployment/mcp) for further information.
## 🚀 Quick Start
1. Clone cognee repo
```
git clone https://github.com/topoteretes/cognee.git
```
2. Navigate to cognee-mcp subdirectory
```
cd cognee/cognee-mcp
```
3. Install uv if you don't have one
```
pip install uv
```
4. Install all the dependencies you need for cognee mcp server with uv
```
uv sync --dev --all-extras --reinstall
```
5. Activate the virtual environment in cognee mcp directory
```
source .venv/bin/activate
```
6. Set up your OpenAI API key in .env for a quick setup with the default cognee configurations
```
LLM_API_KEY="YOUR_OPENAI_API_KEY"
```
7. (Optional — running from source only) Build the MCP App workspace UI bundle. Requires Node.js. Docker users skip this; the image build runs it automatically.
```
cd apps-src && npm install && npm run build && cd ..
```
This produces `src/app_bundles/visualize-graph.html`, which is gitignored. If you skip this step, `visualize_graph_ui` and the workspace tools will raise a clear error pointing back to this command.
8. Run cognee mcp server with stdio (default)
```
python src/server.py
```
or stream responses over SSE
```
python src/server.py --transport sse
```
or run with Streamable HTTP transport (recommended for web deployments)
```
python src/server.py --transport http --host 127.0.0.1 --port 8000 --path /mcp
```
You can do more advanced configurations by creating .env file using our