Skip to main content
Glama

Memory MCP

Persistent memory for AI agents. Plug-and-play with zero infrastructure.

A Model Context Protocol (MCP) server that gives your AI agents persistent, searchable memory. Works out of the box with zero configuration using local embeddings and file-based storage.

Features

  • πŸ” Semantic Search - Find memories by meaning, not keywords

  • πŸ”— Auto-Linking - Related memories are automatically connected

  • 🏷️ Auto-Categorization - Memories are categorized by type (knowledge, decision, pattern, etc.)

  • ⭐ Importance Scoring - Automatic priority based on content

  • πŸ”Œ Pluggable Embeddings - Transformers.js (default), OpenAI, Ollama, or custom

  • πŸ“¦ Zero Config - No database or API keys required to start

  • πŸ€– Agent Instructions - Agents automatically learn when and how to use memory tools via MCP protocol

Web Dashboard

Browse and search your memories in the browser with memory-mcp-dashboard β€” cyberpunk-themed UI, neural graph visualization, same storage.

Related MCP server: Kirok

Quick Start

Start the server immediately with zero configuration.

# Run using npx (requires Node 18+)
npx @aalokjha/mem-aj

Or install locally:

npm i @aalokjha/mem-aj

How it works by default:

  • Embeddings: Uses in-process Transformers.js (all-MiniLM-L6-v2, 384 dimensions). No external server or Python needed.

  • Storage: Uses a local JSON vector store at ~/.memory-mcp/.

  • Initialization: The first run downloads a ~90MB model file. Every run after that is instant.

MCP Client Configuration

Add Memory MCP to your favorite AI tools by adding these configurations.

OpenCode / Claude Desktop / Cursor

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@aalokjha/mem-aj"]
    }
  }
}

Production Setup

Configure environment variables to use high-performance storage and external embedding providers.

Qdrant + External Embeddings

  1. Run your own Qdrant instance.

  2. Set environment variables to point to your services:

export VECTORDB_PROVIDER=qdrant
export QDRANT_URL=http://localhost:6333
export EMBEDDING_PROVIDER=openai
export EMBEDDING_API_KEY=sk-your-key

Configuration

Environment Variables

Variable

Default

Description

EMBEDDING_PROVIDER

transformersjs

Embedding provider: transformersjs, openai, ollama, custom

VECTORDB_PROVIDER

local

Storage provider: local, qdrant

EMBEDDING_URL

-

Embedding service URL (for Ollama/Custom)

EMBEDDING_API_KEY

-

API key for OpenAI

EMBEDDING_MODEL

Provider default

Model name

EMBEDDING_DIMENSIONS

Provider default

Vector dimensions

EMBEDDING_MAX_TOKENS

Provider default

Max token context window for embeddings

QDRANT_URL

http://localhost:6333

Qdrant endpoint

VECTORDB_COLLECTION

memories

Collection name

LOG_LEVEL

info

Log level: debug, info, warn, error

Embedding Providers

Transformers.js (Default - Zero Config)

Runs locally in your Node.js process. No external services needed.

export EMBEDDING_PROVIDER=transformersjs

OpenAI

export EMBEDDING_PROVIDER=openai
export EMBEDDING_API_KEY=sk-your-key
export EMBEDDING_MODEL=text-embedding-3-small

Ollama

export EMBEDDING_PROVIDER=ollama
export EMBEDDING_URL=http://localhost:11434
export EMBEDDING_MODEL=nomic-embed-text

Custom

Any HTTP endpoint that accepts POST /embed with { inputs: string[] } and returns number[][].

export EMBEDDING_PROVIDER=custom
export EMBEDDING_URL=http://your-service:port

MCP Tools

memory_add

Store a memory with automatic categorization and importance scoring.

{
  "content": "Decided to use PostgreSQL for the main database",
  "type": "auto",
  "tags": ["database", "architecture"],
  "project": "my-app"
}

Semantic search across all memories.

{
  "query": "database decisions",
  "limit": 10,
  "min_score": 0.7
}

memory_list

Browse memories by type, tags, or project.

{
  "type": "decision",
  "project": "my-app",
  "limit": 20
}

memory_forget

Delete a memory by ID.

{
  "memoryId": "uuid-here"
}

Manually link two related memories.

{
  "id1": "uuid-1",
  "id2": "uuid-2"
}

memory_profile

Store user preferences.

{
  "action": "set",
  "key": "preferred_language",
  "value": "typescript"
}

Memory Types

Type

Description

Keywords Detected

knowledge

Facts and information

(default)

decision

Choices made

decided, chose, will use, picked

pattern

Recurring solutions

pattern, always, convention, best practice

preference

User preferences

prefer, like, dislike, want, hate

context

Situational context

working on, currently, project

debug

Debug notes

error, bug, fix, crash, issue

Development

# Install dependencies
npm install

# Build
npm run build

# Run in dev mode
npm run dev

# Run tests
npm test

Agent Instructions

The server automatically injects usage instructions into the connected agent's context via the MCP instructions protocol field. Agents learn:

  • When to search, store, and link memories

  • How to write effective memories (word limits adapted to the configured embedding model)

  • What memory types to use and cross-tool workflows

No manual prompt engineering or AGENTS.md configuration needed. Just connect and the agent knows what to do.

Token limits per provider default:

Provider

Max Tokens

Max Words

Transformers.js

512

~384

OpenAI

8,191

~6,143

Ollama

8,192

~6,144

Custom

512

~384

Override with EMBEDDING_MAX_TOKENS if using a non-default model.

Architecture

Memory MCP supports two modes:

Zero-Config Mode (Default)

Simple, file-based storage for personal use.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   MCP Client    │────▢│   Memory MCP    │────▢│   Local JSON    β”‚
β”‚   (Claude/AI)   β”‚     β”‚    Server       β”‚     β”‚   Vector Store  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚ Transformers.js β”‚
                        β”‚  (In-process)   β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Production Mode

High-performance configuration for shared environments.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   MCP Client    │────▢│   Memory MCP    │────▢│     Qdrant      β”‚
β”‚   (Claude/AI)   β”‚     β”‚    Server       β”‚     β”‚    Vector DB    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚    External     β”‚
                        β”‚    Provider     β”‚
                        β”‚ (OpenAI/Ollama) β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

License

MIT License - see LICENSE

Contributing

Contributions welcome! Please read our contributing guidelines.

Credits

Built by Aalok Jha

Available Tools

7 tools
memory_addA

Store a memory with auto-categorization and importance scoring. Use this to persist decisions, findings, debug insights, infrastructure details, user preferences, and session summaries.

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNo
typeNoauto
contentYesThe memory content to store
projectNo
importanceNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral burden. It discloses that memories are stored with auto-categorization and importance scoring, which are meaningful behavioral traits. It does not detail return values or effects on existing memories, but for a straightforward add operation this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no filler. The core action is front-loaded, and the second sentence provides immediately useful examples of appropriate content. Every part contributes to understanding the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description establishes the tool's purpose, primary use cases, and key behaviors, and the schema provides the required content plus a type enum. However, with no output schema and low parameter coverage, an agent may be uncertain about optional parameters like tags, project, and how importance scoring interacts with the provided importance value. It is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 20%, so the description must compensate. It hints at 'type' and 'importance' via 'auto-categorization and importance scoring', but it does not clarify the 'tags' or 'project' parameters, nor the meaning and range of the importance score. This is insufficient coverage for a 5-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Store') and resource ('a memory'), and describes the added behaviors of auto-categorization and importance scoring. This clearly differentiates it from sibling tools like memory_search, memory_list, and memory_forget.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The second sentence provides clear context for when to use the tool by listing concrete content types: decisions, findings, debug insights, infrastructure details, user preferences, and session summaries. It does not explicitly name alternatives or state when not to use it, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_forgetA

Delete a memory by ID. Memories are never automatically deleted β€” use this for outdated or incorrect information.

ParametersJSON Schema
NameRequiredDescriptionDefault
memoryIdYesThe ID of the memory to delete

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral disclosure burden. It adds useful context that deletion is never automatic, but it does not state whether deletion is permanent, what happens to linked memories, or whether any confirmation is involved. For a simple delete operation this is adequate but not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no filler. The core operation is front-loaded, and the second sentence justifies the tool's existence by explaining why manual deletion may be necessary. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema, the description is nearly complete. It identifies the action, the target, and the typical use case. A minor gap is that it does not mention what happens after deletion or whether the operation is reversible, but those are not essential for invoking this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the only parameter, memoryId, is already clearly documented as 'The ID of the memory to delete.' The description adds no additional parameter-level meaning, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a precise action ('Delete a memory by ID') with a clear resource and method. It is unequivocally distinct from sibling tools like memory_add, memory_search, and memory_list, so an agent can immediately identify this as the deletion operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear guidance on when to use this tool: for outdated or incorrect information. It also notes that memories are never automatically deleted, which implies this is the manual cleanup mechanism. It does not explicitly name alternatives or exclusion conditions, but the sibling set makes the distinction obvious.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_helpA

Show server configuration and available tools.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral transparency burden. The verb 'Show' strongly implies a read-only informational operation, but side-effect freedom, authentication needs, and output format are not explicitly disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that immediately states the tool's purpose. Every word earns its place, and there is no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter help-oriented tool, the description covers the essential output: server configuration and available tools. No output schema exists, but the description provides a sufficient picture of what the agent should expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and schema coverage is 100%, so there are no parameter semantics for the description to clarify. The description appropriately focuses on what the tool returns rather than parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb, 'Show,' and names the exact resources: 'server configuration and available tools.' This clearly distinguishes memory_help from its siblings, which all perform memory operations like add, link, search, list, forget, and profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for discovering server configuration and available tools, likely an orientation/help entry point. However, it does not explicitly state when to use this over siblings or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_listA

Browse memories by type, tags, or project with pagination. Use this when you need to review all memories in a category rather than searching by meaning.

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNo
typeNo
limitNo
offsetNo
projectNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden for behavioral disclosure. It does reveal that this is a browsing/pagination operation and that it filters by category rather than semantic meaning, but it does not mention sorting, return format, or how filters combine. This is acceptable for a low-risk list tool but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no filler. The core purpose and the key distinguishing use case are front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given five parameters, 0% schema description coverage, no annotations, and no output schema, this description leaves important gaps. An agent is not told what the response looks like, how filters interact, or what valid type values are. The description establishes purpose but not enough operational context for fully correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions type, tags, project, and pagination, but does not explain the format or behavior of the tags array, possible type values, how filters combine, or the meaning of limit and offset beyond saying 'pagination.' The parameter semantics are therefore only partially clarified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Browse') with a clear resource ('memories') and identifies the filtering dimensions: type, tags, and project. It also explicitly contrasts itself with searching by meaning, which distinguishes it from the sibling memory_search tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states when to use this tool: 'when you need to review all memories in a category rather than searching by meaning.' It names the alternative behavior but does not explicitly name memory_search as the alternative, so it falls just short of the strongest guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_profileA

Key-value store for user preferences and settings. Use this for structured data like preferred_language, editor, timezone β€” not for general knowledge (use memory_add for that).

ParametersJSON Schema
NameRequiredDescriptionDefault
keyNoRequired for get and set
valueNoRequired for set
actionYes

TDQS

A4.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only describes the tool's domain, not what happens on set (overwrite semantics), whether get/list have side effects, or any persistence or authorization behavior. The action enum supplies the operations but not their behavioral implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with front-loaded purpose, concrete examples, and an explicit alternative. No filler or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity, the schema covers required parameters and allowed actions, and the description covers selection criteria. A minor gap is the lack of output or return information for the list action, but the action name and key-value domain make this largely self-evident.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents key ('Required for get and set') and value ('Required for set'), and the action enum lists valid actions. The description adds value by giving example keys and clarifying that values are structured preferences/settings, which helps an agent construct valid key/value pairs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies the tool as a key-value store for user preferences and settings and gives concrete example keys (preferred_language, editor, timezone). It also distinguishes the target data type from general knowledge and names memory_add as the alternative, so an agent can tell it apart from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use the tool ('Use this for structured data...') and when not to ('not for general knowledge'), directly naming memory_add as the alternative. This is specific and actionable, covering both positive and negative selection criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.3.0
    • First observedmemory_add
    • First observedmemory_forget
    • First observedmemory_help
    • First observedmemory_link
    • First observedmemory_list
    • First observedmemory_profile
    • First observedmemory_search

TDQS

A4.1/5.0

Scored across 7 tools

Disambiguation5/5

Each tool targets a distinct operation: add, link, search, list, forget, profile, and help. The search vs list distinction is explicitly described as semantic versus metadata browsing, and memory_profile is clearly separated from general knowledge storage.

Naming Consistency4/5

All tools share the memory_ prefix, which is highly predictable. Most suffixes are verb-style actions like add, link, search, list, and forget, though profile and help are nouns rather than actions, creating a minor inconsistency.

Tool Count5/5

Seven tools is well-scoped for a memory server: core CRUD, linking, browsing, preference storage, and help each have a clear place. There is no apparent redundancy or excessive surface area.

Completeness4/5

The core memory lifecycle is covered: add, read/search/list, delete, link, and profile storage. An explicit update operation and an unlink operation are missing, but these can be worked around with forget+add, so they are minor gaps rather than critical dead ends.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers