Shared Memory

Provides shared memory for agentic teams with context deduplication, incremental state sharing, and token-efficient coordination for multi-agent workflows.
  • typescript

3

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

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

You gain a coordinated MCP server that provides shared memory for agentic teams. It reduces context duplication, shares discoveries incrementally, and coordinates work to improve token efficiency while keeping collaboration fast and reliable.

How to use

Use a client to create an agentic session, have workers fetch compressed context, publish work units, claim and execute tasks, and share discoveries as your work progresses. The system delivers delta updates and lazy loading so you only pull what you need.

How to install

Prerequisites you need before getting started are installed Node.js 18 or later, npm or yarn, and an MCP integration ready to connect to the shared memory MCP server.

# Clone the repository
git clone https://github.com/haasonsaas/shared-memory-mcp.git
cd shared-memory-mcp

# Install dependencies
npm install

# Build the server
npm run build

Configuration and integration with Claude Desktop

Integrate the shared memory MCP server with Claude Desktop so the MCP can run locally and be referenced by Claude’s client.

cp claude-desktop-config.example.json claude-desktop-config.json
{
  "mcpServers": {
    "shared-memory": {
      "command": "node",
      "args": ["/absolute/path/to/shared-memory-mcp/dist/server.js"]
    }
  }
}

Starting and testing

Run the server in development mode or use the built server, then run tests to verify the agentic workflow.

# Run in development mode
npm run dev

# Or run the built server
npm start

# Test the agentic workflow
npm test
# or
npm run test-workflow

Usage example

The following demonstrates creating an agentic session, getting a compressed worker context, publishing work units, claiming a unit, sharing discoveries, and fetching incremental updates.

// 1. Create agentic session (coordinator)
const session = await mcp.callTool('create_agentic_session', {
  coordinator_id: 'opus-coordinator-1',
  worker_ids: ['sonnet-1', 'sonnet-2', 'sonnet-3', 'sonnet-4'],
  task_description: 'Analyze large codebase for performance issues',
  codebase_files: [...], // Full context stored once
  requirements: [...],
  constraints: [...] 
});

// 2. Workers get compressed context (not full retransmission)
const context = await mcp.callTool('get_worker_context', {
  session_id: session.session_id,
  worker_id: 'sonnet-1'
}); // Returns summary + reference, not full context

// 3. Publish work units for coordination
await mcp.callTool('publish_work_units', {
  session_id: session.session_id,
  work_units: [
    { unit_id: 'analyze-auth', type: 'security', priority: 'high' },
    { unit_id: 'optimize-db', type: 'performance', dependencies: ['analyze-auth'] }
  ]
});

// 4. Workers claim and execute
await mcp.callTool('claim_work_unit', {
  session_id: session.session_id,
  unit_id: 'analyze-auth',
  worker_id: 'sonnet-1',
  estimated_duration_minutes: 15
});

// 5. Share discoveries incrementally
await mcp.callTool('add_discovery', {
  session_id: session.session_id,
  worker_id: 'sonnet-1', 
  discovery_type: 'vulnerability_found',
  data: { vulnerability: 'SQL injection in auth module' },
  affects_workers: ['sonnet-2'] // Notify relevant workers
});

// 6. Get only new updates (delta, not full context)
const delta = await mcp.callTool('get_context_delta', {
  session_id: session.session_id,
  worker_id: 'sonnet-2',
  since_version: 5 // Only get changes since version 5
});

Available tools

create_agentic_session

Initialize a coordinator session with worker IDs and task details to start an agentic workflow.

get_worker_context

Retrieve a compressed context snippet tailored for a specific worker to minimize data transfer.

publish_work_units

Publish a set of work units for distribution among workers, including dependencies and priorities.

claim_work_unit

A worker claims an available work unit and provides an estimated duration for execution.

add_discovery

Share incremental discoveries from a worker to inform others and trigger reactive updates.

get_context_delta

Fetch only the changes since a given version to minimize data transfer.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational