New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@memstack/mcp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memstack/mcp

MCP server for MemStack — AI agent memory via Model Context Protocol

Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
65
-66.84%
Maintainers
1
Weekly downloads
 
Created
Source

@memstack/mcp

MCP server for MemStack — persistent AI agent memory via the Model Context Protocol.

Installation

npm install -g @memstack/mcp

Quick Start

Add to your MCP client config (~/.claude/mcp.json or .cursor/mcp.json):

{
  "mcpServers": {
    "memstack": {
      "command": "npx",
      "args": ["-y", "@memstack/mcp"],
      "env": {
        "MEMSTACK_STORAGE": "memory",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Configuration

All configuration is via environment variables. No config files needed.

Storage backends

VariableValuesDefault
MEMSTACK_STORAGEmemory, disk, markdown, postgres, sqlite, redismemory

In-memory (default — testing only, data lost on restart):

MEMSTACK_STORAGE=memory

Disk (JSON file per actor):

MEMSTACK_STORAGE=disk
MEMSTACK_DIR=/Users/me/.memstack

Markdown (zero infra, human-readable):

MEMSTACK_STORAGE=markdown
MEMSTACK_DIR=/Users/me/.memstack

Postgres (production):

MEMSTACK_STORAGE=postgres
DATABASE_URL=postgresql://user:pass@localhost/memstack

Redis:

MEMSTACK_STORAGE=redis
REDIS_URL=redis://localhost:6379

SQLite:

MEMSTACK_STORAGE=sqlite
SQLITE_PATH=./memory.db

LLM providers

VariablePurpose
OPENAI_API_KEYOpenAI LLM (default)
ANTHROPIC_API_KEYAnthropic (summarization)

At least one of OPENAI_API_KEY or ANTHROPIC_API_KEY must be set. If both are set, Anthropic is preferred for summarization.

VariablePurpose
OPENAI_API_KEYOpenAI embeddings

Without embedding config, retrieval falls back to keyword + importance search.

Tools

The MCP server exposes these tools to the agent:

ToolDescription
memory_processStore with auto-enrichment (importance, tags)
memory_storeStore a memory
memory_retrieveRetrieve memories by query, strategy, time range
memory_compile_contextAssemble token-budgeted LLM-ready context
memory_summarizeCompress old interactions via LLM
memory_pruneRemove stale/low-importance memories
memory_purge_actorDelete all memories for an actor
memory_mergeMerge multiple memories into one
memory_statsMemory diagnostics (counts, types, importance)
memory_deleteDelete a single memory
memory_healthCheck storage/LLM/embedding connectivity
memory_dry_run_prunePreview what would be pruned

Resources

URIDescription
memory://{actorId}/contextCompiled LLM context as markdown
memory://{actorId}/statsActor memory stats as JSON

Prompts

PromptDescription
memory_contextAuto-injected memory context for current actor

Actor persistence

By default, all memories belong to the "default" actor. Set MEMSTACK_ACTOR to identify the agent:

MEMSTACK_ACTOR=my-agent

This keeps memory isolated per agent. The agent can also override the actor with actorId in any tool call.

Publishing

cd packages/mcp
pnpm build && pnpm check && pnpm test
npm publish --access public

After publishing, users install with:

npm install -g @memstack/mcp

License

MIT

Keywords

mcp

FAQs

Package last updated on 26 Jun 2026

Related posts