Claude Code Integration
This guide shows the fastest path to plug the cognee MCP server into Claude Code.If you are new to Claude Code itself, first take a look at the Getting Started and MCP chapters of their docs:
- Claude Code Getting Started
- Claude Code MCP. You can find multiple ways to connect to a MCP server here.
1
Start the cognee MCP server
Choose your preferred setup method:
- Docker Quickstart - Get running in minutes with a container
- Local Setup - Build from source for full control
2
Install Claude Code
3
Navigate to your project directory
4
Run the Claude Code CLI
5
Tell Claude Code to add the server
Here is a few example configurations:If you’d like to use the above settings, remember to replace “YOUR_OPENAI_KEY” and “cognee_root_path” with the correct values.
- The easiest setup is to have the Cognee MCP server running in http transport mode (e.g. by following the quickstart guide). In this case, run the following command:
- On the other hand, if you cloned the Cognee github repository, and want to run the MCP server in stdio transport mode, you can run the following command:
- What it does:
mcp add cognee– registers a new server named cognee.-s project– stores in.mcp.json, so each developer approves it once per project. Omit for user‑level scope.-eflags – env‑vars required by cognee.- The final
uv … cogneecommand is how Claude Code spawns the server.
6
Restart Claude Code and approve the server
- The first session in this repo will prompt something like:
- Select Enable (or press Enter).