PluginBench
MCP Server
Active
Apache-2.0

Kagura Memory Cloud MCP Server

io.github.kagura-ai/memory-cloud

Persistent memory for AI assistants: store, search, and connect knowledge across conversations with adaptive neural learning.

What is the Kagura Memory Cloud MCP server?

Kagura Memory Cloud is an MCP server that provides persistent, adaptive memory for AI assistants beyond traditional RAG. It combines hybrid search (semantic + BM25), a neural memory graph with Hebbian learning, and team-scale knowledge management to help AI agents and teams retain and discover insights across conversations.

Kagura Memory Cloud implements Karpathy's LLM Knowledge Base pattern at team scale, enabling AI assistants to store memories, search across them with hybrid semantic and keyword matching, and automatically strengthen connections between related memories through Hebbian learning. It includes a web UI, REST API, 64 MCP tools, workspace-scoped RBAC, and works with Claude, ChatGPT, Gemini, and any MCP-compatible client.

How to install Kagura Memory Cloud

Copy-paste configuration for popular MCP clients.

transport: http
Config generated by PluginBench — verify against the source before use.
~/.cursor/mcp.json
{
  "mcpServers": {
    "memory-cloud": {
      "url": "https://memory.kagura-ai.com/mcp"
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • remember — Store a memory with summary, content, type, and tags for persistent recall
  • recall — Hybrid search (semantic + BM25) with optional AI reranking to find relevant memories
  • explore — Graph traversal of neural memory to discover related memories and hidden connections
  • forget — Delete a memory from storage
  • reference — Create a reference link to an existing memory
  • create_context — Create a workspace context (folder-like container for memories)
  • list_contexts — List all contexts in a workspace
  • update_context — Modify context settings and search configuration
  • delete_context — Remove a context and its memories
  • create_tag — Create a tag for organizing memories
  • list_tags — List all tags in a context
  • delete_tag — Remove a tag
  • list_memories — List memories in a context with filtering and pagination
  • get_memory — Retrieve a specific memory by ID
  • update_memory — Modify a memory's content, summary, or tags
  • explore_edges — Inspect neural edges (Hebbian connections) between memories
  • create_edge — Manually create a connection between memories
  • delete_edge — Remove a neural edge
  • pin_memory — Pin a memory for agent delivery
  • unpin_memory — Remove a pinned memory

Use cases

  • Store and recall project context, decisions, and lessons learned across multiple conversations with an AI assistant
  • Discover hidden connections between ideas and memories through graph traversal, enabling serendipitous insights
  • Build a team knowledge base where multiple members can share and search memories with role-based access control
  • Maintain agent state and measurements for autonomous AI loops with pinned and time-triggered memory delivery
  • Analyze memory patterns to identify knowledge gaps and strengthen the most important connections

Kagura Memory Cloud MCP server FAQ

What is Kagura Memory Cloud?

Kagura Memory Cloud is an MCP server that gives AI assistants persistent, adaptive memory. It stores memories in a PostgreSQL + Qdrant + neural graph backend, supports hybrid search (semantic + keyword), and automatically strengthens connections between related memories through Hebbian learning — so the system gets smarter every time you search.

Is Kagura Memory Cloud free?

Kagura is open-source (Apache 2.0) and self-hosted. You run it on your own infrastructure (Docker + Docker Compose). There is no SaaS subscription required, though a hosted version may be available separately. Self-hosted deployments require an OpenAI API key for embeddings or a self-hosted inference server (e.g. Ollama) for local, free embeddings.

How do I install it in Claude Code or Claude Desktop?

Clone the repository, run `./setup.sh` to configure and start Docker services, then create an admin account via `python3 -m src.cli.create_admin`. This generates a `.mcp.json` file with your workspace ID and API key. Copy it to your Claude Code or Desktop config directory, restart the client, and Kagura's tools will be available.

What authentication does Kagura support?

Kagura supports password + MFA login (no OAuth required), optional Google OAuth2, and optional GitHub OAuth2. Users with the same email across providers share a single account. API access uses API keys generated from the web UI.

Can I use Kagura with ChatGPT, Gemini, or other AI clients?

Yes. Kagura is an MCP server that works with any Streamable-HTTP MCP client, including Claude Code, Claude Desktop, Claude Chat, ChatGPT, Gemini CLI, and custom integrations. You connect via the MCP URL and API key.

What are the system requirements?

Minimum: 2 CPU cores, 4 GB RAM, 10 GB disk. Recommended: 4+ cores, 8+ GB RAM, 20+ GB disk. You need Docker, Docker Compose, Python 3.11+, Node.js 20+, and either an OpenAI API key or a self-hosted inference server for embeddings.

README (reference)

Source of truth, from the repository.

<p align="center"> <a href="https://www.kagura-ai.com"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/social-preview.png"> <img src="docs/assets/readme-banner.png" alt="Kagura Memory Cloud — adaptive memory for AI agents and teams, beyond RAG" width="820"> </picture> </a> </p> <p align="center"> English · <a href="README.ja.md">日本語</a> </p> <p align="center"> <strong>Adaptive memory for AI agents and teams</strong> — self-hosted, beyond RAG.<br> An MCP server that gets smarter every time you search:<br> hybrid search + a neural memory graph that learns which memories belong together. </p> <p align="center"> <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"></a> <a href="https://github.com/kagura-ai/memory-cloud/actions/workflows/ci.yml"><img src="https://github.com/kagura-ai/memory-cloud/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://codecov.io/gh/kagura-ai/memory-cloud"><img src="https://codecov.io/gh/kagura-ai/memory-cloud/graph/badge.svg" alt="codecov"></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node.js-20+-green.svg" alt="Node.js 20+"></a> <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-Streamable_HTTP-purple.svg" alt="MCP"></a> <a href="https://safeskill.dev/scan/kagura-ai-memory-cloud"><img src="https://img.shields.io/badge/SafeSkill-90%2F100_Verified%20Safe-brightgreen" alt="SafeSkill 90/100"></a> </p> <p align="center"> Works with Claude, ChatGPT, Gemini, and any MCP-compatible client.<br> <a href="https://github.com/kagura-ai/kagura-memory-python-sdk"><strong>Python SDK (KaguraClient, REST clients & FileIngestor)</strong></a> </p> <p align="center"> <a href="https://www.kagura-ai.com/demo/terminal-en-cli-2x.mp4"> <img src="docs/assets/cli-demo.gif" alt="Claude Code CLI recalling from Kagura Memory over MCP" width="760"> </a> <br> <em>Claude Code CLI recalling memories from Kagura over MCP — <a href="https://www.kagura-ai.com/demo/terminal-en-cli-2x.mp4">▶ watch the demo</a></em> </p>

Why Kagura Memory Cloud?

Your AI forgets everything after each conversation. Kagura fixes that — and gets smarter every time you search.

Most AI memory tools are just vector databases with a chat wrapper. Kagura is different — it implements the full LLM Knowledge Base pattern (Karpathy's LLM Wiki) at team scale:

ApproachStorageCompoundingScale
Vector DB / RAGEmbedded chunksNone — retrieve-onlyAny
Karpathy's LLM WikiMarkdown filesLLM rewrites pagesPersonal (~100 pages)
Kagura Memory CloudPostgreSQL + Qdrant + Neural graphHebbian + Sleep MaintenanceTeam / org
FeatureDescription
Adaptive MemoryEvery search automatically strengthens connections between related memories. The more you use it, the better explore() discovers hidden relationships.
Hybrid SearchSemantic (OpenAI / self-hosted) + BM25 keyword — 96% top-1 accuracy
AI RerankingSelf-hosted (Ollama/vLLM — local, free), Voyage AI, or Cohere — cross-encoder reranking for precision
Neural Memory GraphHebbian learning builds a knowledge graph in the background. explore() traverses it for serendipitous discovery.
Agent Memory SubstrateBeyond a knowledge store: delivery modes (pinned / time-triggered), a server-stamped trust boundary, an agent state lane, and a retrieval-feedback signal — the primitives an autonomous agent loop needs.
Agent Control Plane (preview)Workspace-scoped Agent Registry, subtractive context bindings, agent-bound member keys, lifecycle kill switches, and one-call session bootstrap. Introduced in v0.49.0.
64 MCP ToolsMemory, Agent Substrate, Agent Control Plane, Neural edges, Contexts, Tags, Files (R2), Analyses (Memory Analysis), Resources, Secrets, Sleep Maintenance, Usage, API-Key Bindings
Multi-ProviderOpenAI or self-hosted (Ollama, vLLM — local, private, zero cost) for embeddings
Team ReadyWorkspaces, RBAC, context isolation, shared memory
Web UINext.js dashboard — contexts, search settings, member management
5-Minute Setup./setup.sh and you're done

Architecture

Workspace (team/org)
├── Context A ("my-project")     ← like a folder
│   ├── Memory 1                 ← 3-layer: summary / context / content
│   ├── Memory 2
│   └── Neural edges (Hebbian)   ← automatic connections
├── Context B ("learning-notes")
│   └── ...
└── Members (Owner/Admin/Member/Viewer)

LLM Knowledge Base — 5-Layer Implementation

Karpathy's LLM Wiki pattern describes a 5-layer "living knowledge base" — beyond traditional RAG. Kagura implements all 5 layers at team scale:

LayerKagura ImplementationDifference from Karpathy's pattern
IngestREST /api/v1/memory, MCP remember, R2 file storage, resource tokens+ binary blobs, + multi-tenant
CompileMCP-as-compile-API — chat agent compiles via structured tool calls (remember(summary, content, type, tags)) + Sleep Maintenance for batch consolidationContinuous micro-compile (not batch wiki rewrite) — schema-enforced output
IndexTriple index: BM25 (keyword) + Qdrant (semantic) + Hebbian graph (relational) — all auto-maintainedNo manual index.md upkeep
QueryHybrid Search + AI Reranker + explore graph traversalBeyond markdown grep — supports semantic + relational queries
EnhanceHebbian learning — every recall() strengthens edges between co-retrieved memories. Sleep Maintenance consolidates periodically.Background graph evolution (zero LLM cost) vs LLM-driven page rewrites

Compounding loop: Currently explicit (user/agent calls remember() after synthesizing answers). Auto-write-back of synthesized answers is intentionally opt-in to keep noise low.

Adaptive Memory: Two Search Paths

Kagura separates precision search and discovery into two independent paths, each optimized for its purpose:

recall()  ──→ Hybrid Search (semantic + BM25) ──→ [Reranker] ──→ Precise results
                      │
                      └──→ Hebbian Learning (background) ──→ Graph edges grow
                                                                │
explore() ──→ Graph Traversal (Neural Memory) ←─────────────────┘  Related discoveries
  • recall() — Precision search. Hybrid (semantic 60% + BM25 40%) with optional AI reranking. Returns the most relevant memories.
  • explore() — Discovery. Traverses the Neural Memory graph to find related memories that keyword search would miss.
  • Hebbian learning — Every recall() silently strengthens edges between co-retrieved memories. No explicit training needed — the graph grows organically as you use the system.

This separation is intentional: mixing graph signals into recall degrades precision (validated via benchmarks). Instead, each path does what it's best at.

Data isolation: All data is filtered by workspace_id → context_id → user_id. Memories never leak across boundaries. Single Qdrant collection with payload filtering.

Tech stack: FastAPI (async) · PostgreSQL · Qdrant · Redis · Next.js 16 · OAuth2 · MCP over Streamable HTTP

Vector backend: Qdrant by default. A single-process self-hosted / CLI / edge deployment can instead run the embedded LanceDB backend — "Kagura Lite" (preview) with no separate Qdrant server (KAGURA_VECTOR_BACKEND=lance, cd backend && uv sync --locked --extra lite). Not for multi-worker / SaaS (LanceDB is single-writer). See Deployment → Embedded Vector Backend.

Quick Start

System Requirements

MinimumRecommended
CPU2 cores4+ cores
RAM4 GB8+ GB
Disk10 GB free20+ GB free

Prerequisites

  • Docker & Docker Compose
  • Python 3.11+
  • Node.js 20+
  • OpenAI API key (for embeddings) — or a self-hosted inference server (e.g. Ollama) for local embeddings
  • OAuth2 credentials (optional — password + MFA login available without OAuth)

Setup

One-line setup:

git clone https://github.com/kagura-ai/memory-cloud.git
cd memory-cloud
./setup.sh

With Claude Code:

git clone https://github.com/kagura-ai/memory-cloud.git
cd memory-cloud
claude   # then run /setup

Step-by-step setup:

# 1. Clone
git clone https://github.com/kagura-ai/memory-cloud.git
cd memory-cloud

# 2. Configure environment (generates secrets, prompts for API keys)
(cd backend && python3 -m src.cli.setup_env)

# 3. Start all services
docker compose up -d

# 4. Run migrations
(cd backend && alembic upgrade head)

# 5. Create admin account (interactive — sets password, MFA, API key, embedding provider)
(cd backend && python3 -m src.cli.create_admin)

# Backend API:  http://localhost:8080
# Frontend UI:  http://localhost:3000
# API docs:     http://localhost:8080/redoc

.env.local settings (auto-configured by setup_env):

SettingRequiredDescription
API_KEY_SECRETYesSecret for API key encryption (auto-generated)
JWT_SECRETYesSecret for JWT tokens (auto-generated)
OPENAI_API_KEYYes*OpenAI API key for embeddings
SELF_HOSTED_BASE_URLNoSelf-hosted backend URL (default: http://localhost:11434)
EMBEDDING_PROVIDERNoopenai (default) or self_hosted
GOOGLE_CLIENT_ID/SECRETNoGoogle OAuth2 login (optional — password login available)
GITHUB_CLIENT_ID/SECRETNoGitHub OAuth2 login (optional)

* Either OPENAI_API_KEY or a running self-hosted inference server (e.g. Ollama) is required for memory features.

Admin CLI

CommandPurpose
python3 -m src.cli.setup_envGenerate secrets + configure .env.local (run before Docker)
python3 -m src.cli.create_adminCreate admin + workspace + API key + .mcp.json + embedding setup
python3 -m src.cli.reset_passwordReset password and/or MFA
python3 -m src.cli.delete_adminDelete admin (for re-creation)

Run from backend/ directory. Docker API container must be running.

<details> <summary>Platform-specific notes</summary>
  • WSL (Windows): Install Docker Desktop for Windows and enable WSL integration
  • macOS: Install Docker Desktop for Mac. brew install python@3.11 node
  • Linux (Ubuntu/Debian): sudo apt install docker.io docker-compose-v2 python3.11 nodejs npm
  • GCP (Production): Set production values in .env.local (DATABASE_URL, QDRANT_URL, ENVIRONMENT=production, CORS_ORIGINS)
  • Frontend env vars: Copy frontend/.env.example to frontend/.env.local and set:
    • NEXT_PUBLIC_API_URL — backend URL (default: http://localhost:8080)
    • NEXT_PUBLIC_APP_URL — frontend URL for metadata
    • NEXT_PUBLIC_PLAN_FREE_DISPLAY_NAME / BASIC / PRO / PROMAX — plan display name customization (default: S/M/L/XL)
</details>

Connect an MCP Client

Works with Claude Code, Claude Desktop, Claude Chat, ChatGPT, Gemini CLI, and any Streamable-HTTP MCP client.

Claude Code (3 steps):

  1. Start services and open http://localhost:3000/workspace/integrations/api-keys to create an API key
  2. Copy .mcp.json.example to .mcp.json and fill in your workspace ID and API key:
cp .mcp.json.example .mcp.json
# Edit .mcp.json — set workspace_id (from URL bar) and API key

.mcp.json.example ships with the all-tools URL. Set "url" to one of:

  • All tools (default): http://localhost:8080/mcp/w/{workspace_id}
  • Core tools only — smaller tool list: http://localhost:8080/mcp/w/{workspace_id}?profile=core

Pick core when your client loads every tool schema at session start (it is about 65% smaller). It lists the 12 memory and context tools and leaves out Sleep, analyses, files, edges, secrets, resources and the agent control plane — those stay callable, they are just not listed; switch back to the default URL to see them. See Tool Profiles.

  1. Restart Claude Code and verify:
You: "Remember: our API uses JWT with 1h expiry and refresh token rotation"
→ AI calls remember() — stored permanently

You: "What do we know about auth?"
→ AI calls recall() — finds it instantly, even months later

.mcp.json is in .gitignore — never commit it (contains API keys).

Full setup guide — every client, the memory-sync hook, the ready-to-use .claude/ templates, the kagura-memory Claude Code plugin (skills + tool-guardrail hooks), and the WSL2 networking note: MCP Client Setup

MCP Tools

64 tools across 13 categories: Memory (remember / recall / explore …), Agent Substrate (pinned + time-triggered delivery, state, measurements, feedback), Agent Control Plane (preview), Neural Edges, Contexts, Tags, Files (R2), Analyses (Memory Analysis), Resources, Secrets (zero-knowledge), Sleep Maintenance, Usage, and API-Key Bindings — each with per-role access control.

Tool-by-tool reference with required roles: MCP Tools Reference

A client does not have to list all 64: the core URL above (?profile=core) lists 12, and ?tools=remember,recall lists exactly the tools you name — see Tool Profiles.

REST API

In addition to MCP tools, a full REST API is available:

  • Memory: remember, recall, reference, forget, explore (/api/v1/memory/*)
  • Contexts: CRUD, search settings (/api/v1/contexts/*)
  • Agents (preview): Registry, context bindings, and composed bootstrap (/api/v1/agents/*)
  • Files: Presigned upload/download backed by R2 (/api/v1/files/*, up to 100 MiB); legacy /api/v1/attachments/* routes return 410 Gone
  • Analyses: Memory Analysis preview/start/read/cancel (/api/v1/analyses/*)
  • Resources: External event ingestion and resource inspection (/api/v1/resources/*)
  • Workspaces: Management, members, invitations (/api/v1/workspaces/*)
  • Admin: Users, plan management, neural config (/api/v1/admin/*)
  • Secrets: Zero-knowledge secret store — ciphertext-only, server never decrypts (/api/v1/config/secrets/*)

Full API documentation: http://localhost:8080/redoc

Authentication

Two OAuth2 providers are supported:

  • Google OAuth2 — Optional. Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
  • GitHub OAuth2 — Optional. Set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET

Users with the same email address across providers share a single account. Password + MFA login is available without any OAuth provider (see Quick Start). An existing account can also add a password from its profile and then sign in with its verified email address and that password; see Deployment → Email + password sign-in.

Plan Tier Customization

Plans control per-workspace resource limits (contexts / memories / MCP calls per day). Four tiers ship by default: S (free), M (basic), L (pro) and XL (promax). For self-hosted single-user setups, assign the XL (promax) plan to your workspace — it is the only tier that may create resources, connectors and public contexts (numeric limits are env-overridable; a tier's feature set is not). Defaults, environment-variable overrides, and optional Stripe self-service billing: Deployment → Plan Tiers

Development with Claude Code

This project is designed to be developed with Claude Code and Kagura Memory Cloud itself — pre-configured slash commands, safety hooks, sub-agents, and rules load automatically from .claude/. Setup and the full tooling reference: Contributing → Development with Claude Code

Documentation

API reference — two complementary entry points:

  • Concepts (markdown): API Reference — auth, base URLs, MCP endpoint, request/response examples
  • Endpoint reference (live): http://localhost:8080/redoc — auto-generated from FastAPI, always in sync with the running backend

Concepts & guides:

Contributing

See CONTRIBUTING.md for development setup, code style, and PR workflow.

License

Apache License 2.0

Related MCP servers

Give coding agents right-to-left awareness: lint, normalise Arabic, detect direction.

Build proven high converting product showrooms and websites from your existing ecommerce catalog

0
TypeScript
MIT
View repository →

Semantic code intelligence — call graphs, dependencies, impact analysis, and test coverage.

View repository →

NASA-validated computed planetary positions for your AI: 19 astrology tools, never hallucinated.

0
TypeScript
View repository →

Checks whether a website has a usable llms.txt. Score 0–100. Free 3/day/IP, then ¥10.

View repository →

Shape-shifting MCP hub — shapeshift() into 130,000+ servers at runtime. No restarts. 7 registries.

0
Python
MIT
View repository →