mcp-server-memo

mcp-server-memo

3.5

A lightweight MCP server for managing session summaries and memos for LLMs like Claude.

Top Comments

MCP Server Memo is designed as a memory assistant for LLMs, allowing them to store and retrieve detailed session records through the MCP tool interface. The server preserves historical versions of sessions, organizes them chronologically, and uses local storage without requiring an external database. It is MCP compliant, optimized for performance, and has minimal dependencies, making it easy to maintain and extend.

Features

  • Preserves History: All historical versions of a session are preserved.
  • Time-Ordered: Sessions are organized chronologically.
  • Local Storage: Uses the local filesystem for storage.
  • MCP Compliant: Follows the Model Context Protocol specification.
  • Performance Optimized: Optimized for file I/O and concurrent operations.

MCP Tools

  • {'upsertSummary': 'Creates a new version of a session summary without deleting previous versions.'}
  • {'getSummaryTool': 'Retrieves the latest version of a specific session summary.'}
  • {'listSummariesTool': 'Lists available summaries with filtering, sorting, and pagination.'}
  • {'updateMetadata': 'Updates metadata of the latest version of a session without changing the summary content.'}
  • {'appendSummary': 'Appends content to a session summary, creating a new version.'}
  • {'listAllSummariesTool': 'Lists all available summaries with basic information.'}
  • {'getSessionHistory': 'Retrieves all historical versions of a specific session.'}

Usage with Different Platforms

client_workflow_example

javascript
import { v4 as uuidv4 } from 'uuid';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

// Initialize client
const transport = new StdioClientTransport({
  command: 'node',
  args: ['dist/index.js'],
  cwd: process.cwd()
});

const client = new Client({
  name: 'example-client',
  version: '1.0.0'
});

await client.connect(transport);

// Function to generate new session ID (done once per logical session)
function createNewSession() {
  return uuidv4();
}

// Function to append to an existing session
async function appendToSession(sessionId, newContent) {
  return client.callTool({
    name: "appendSummary",
    arguments: {
      sessionId,
      content: newContent,
      title: "Example Session",
      tags: ["example", "demo"]
    }
  });
}

// Function to get session history
async function getSessionHistory(sessionId) {
  const response = await client.callTool({
    name: "getSessionHistory",
    arguments: { sessionId }
  });
  
  const result = JSON.parse(response.content[0].text);
  if (result.success) {
    return result.history;
  }
  
  throw new Error(result.error || "Failed to get session history");
}

// Usage example
const sessionId = createNewSession();

// Add initial content
await appendToSession(sessionId, "Initial conversation data");

// Add more content later in the conversation
await appendToSession(sessionId, "Second part of the conversation");
await appendToSession(sessionId, "Final part of the conversation");

// Get the full history
const history = await getSessionHistory(sessionId);
console.log(`Session ${sessionId} has ${history.length} versions`);