Skip to main content
Glama

Memory MCP

This repository implements a small MCP server that exposes a mem_save tool for recording structured memory entries to a per-project JSON file (.memory/memory.json). The server is intentionally simple: it stores entries provided by the AI and enforces a token-budgeted FIFO eviction policy.

Installation

npm install
npm run build

Related MCP server: Sequential Thinking MVP Server

Configuration

Add this server to your MCP client configuration. Example:

{
  "mcpServers": {
    "memory-mcp": {
      "command": "node",
      "args": ["/path/to/mcp/dist/server.js"]
    }
  }
}

Features

This server does not summarize or decide what to store by itself. User should decide when to call mem_save.

  • Tool: mem_save — record memories for a project (JSON storage)

  • Token estimation and FIFO eviction to keep estimated tokens ≤ 1000

  • Auto-creates .memory/memory.json if missing

mem_save behavior

Inputs:

  • projectPath (string): absolute project path provided by the AI

  • entries (array): list of memory entry objects. Each entry has:

    • what (string)

    • why (string)

    • outcome (string)

    • task_context, constraints, dependencies (optional strings)

Storage:

  • Memory is stored at <projectPath>/.memory/memory.json:

    { "entries": [ ... ], "meta": { "total_entries": number, "estimated_tokens": number, "last_updated": "YYYY-MM-DD" } }

Token estimation (approximate):

  • Chinese chars ≈ 1.3 tokens each

  • English letters ≈ 0.3 tokens each

  • Other symbols ≈ 0.6 tokens each

Eviction policy:

  • After appending new entries, the server computes an estimated total token usage.

  • If the total exceeds 1000 tokens, it removes the oldest entries (FIFO) one-by-one until the total is ≤ 1000.

Return value:

  • On success the tool returns a JSON text message with success: true and a short summary.

License

MIT

Available Tools

1 tool
mem_saveC

Record workflow memories with FIFO eviction (keep ≤ 1000 tokens)

ParametersJSON Schema
NameRequiredDescriptionDefault
projectPathYesProject path (provided by AI)
entriesYesList of memory entries

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions FIFO eviction and a token limit, which are useful behavioral traits, but doesn't cover other important aspects like whether this is a read/write operation, error handling, persistence characteristics, or what happens when the limit is exceeded.

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 extremely concise - a single sentence that efficiently communicates the core functionality and key constraint. Every word earns its place with no wasted language or redundancy.

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?

For a tool that records memories with no output schema and no annotations, the description is insufficient. It doesn't explain what 'recording' means operationally, how memories are stored/retrieved, what format they take, or what the tool returns. The token limit and eviction policy are helpful but don't provide complete context for effective use.

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%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning about the parameters beyond what's in the schema, so it meets the baseline but doesn't provide extra value.

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

Purpose4/5

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

The description clearly states the verb ('Record') and resource ('workflow memories'), specifying it's for recording with a FIFO eviction policy and token limit. However, with no sibling tools, the differentiation aspect is not applicable, so it doesn't reach the highest score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or specific contexts. It mentions the eviction policy but doesn't explain when this tool is appropriate or what scenarios it's designed for.

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. 4 tool updatesv1.0.0
    • Removedenv_verify
    • Removedevaluate_task
    • Addedmem_save
    • Removedthink
  2. 3 tool updates
    • First observedenv_verify
    • First observedevaluate_task
    • First observedthink

TDQS

B3/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as recording workflow memories with FIFO eviction, and no other tools exist to cause confusion.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The name 'mem_save' follows a clear verb_noun pattern, which would be consistent if more tools were added.

Tool Count2/5

One tool is too few for a server named 'Workflow MCP Server', which implies a broader scope for managing workflows. A single memory-saving tool does not provide the expected functionality for creating, managing, or executing workflows, making it an extreme mismatch for the apparent domain.

Completeness1/5

The tool surface is severely incomplete for a workflow server. It only offers memory saving with no tools for creating workflows, listing workflows, updating workflows, deleting workflows, or executing workflows. This leaves major gaps that will cause agent failures in handling workflow-related tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers