home / mcp / memory pouchdb mcp server

Memory PouchDB MCP Server

simple memory mcp server with custom memory location

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bneil-mcp-memory-pouchdb": {
      "command": "node",
      "args": [
        "/path/to/mcp-memory-pouchdb/dist/index.js"
      ],
      "env": {
        "POUCHDB_PATH": "<path-to-pouchdb-directory>",
        "MEMORY_FILE_PATH": "<path-to-memory.json>",
        "DISABLE_MEMORY_FILE": "<true|false>"
      }
    }
  }
}

You can deploy and use a Memory Custom MCP Server that stores interactions and memory data in a robust PouchDB-backed knowledge graph. This setup helps you organize project-specific memories, track timestamps, and retrieve relevant context during conversations with an LLM-driven client.

How to use

Start by launching the Memory MCP Server within your client workflow. The server provides a memory graph you can read from and write to during conversations with your language model. Begin each session by initializing memory access, identify the default user, and then retrieve and update memory as you interact. You can create entities, connect them with relations, and store observations with timestamps to maintain a clear history of interactions.

How to install

Prerequisites: ensure you have Node.js version 16 or higher installed on your system.

Install via Smithery for quick setup:

npx -y @smithery/cli install @bneil/mcp-memory-pouchdb --client claude

Clone the repository and install dependencies:

git clone [email protected]:bneil/mcp-memory-pouchdb.git
cd mcp-memory-pouchdb
npm install

Build and run the server locally:

npm run build
node dist/index.js

Configuration

To run the Memory MCP Server, you need two environment variables: MEMORY_FILE_PATH and POUCHDB_PATH. You can place the server in your Claude Desktop configuration under the mcpServers section.

{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
        "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
        "DISABLE_MEMORY_FILE": "true"
      }
    }
  }
}

Optional environment variables you may provide: - POUCHDB_OPTIONS: JSON string of additional PouchDB configuration options - DISABLE_MEMORY_FILE: Set to "true" to disable saving to memory.json and rely solely on PouchDB storage.

Notes and troubleshooting

If the server fails to start, confirm that MEMORY_FILE_PATH and POUCHDB_PATH are set and point to valid directories. Check that the run command uses the exact path to the built index file and that you started the server with the proper node invocation.

When you update memory during a session, ensure you follow the recommended steps to create entities, connect them with relations, and store observations with timestamps for coherent history.

Examples of key actions

Get current time from the server to timestamp interactions.

Set a new memory file path for a specific project.

Create entities and relations to model user data and interactions.

Add observations to capture details of conversations and events.

Read the graph to retrieve memory when beginning a session.

Security and maintenance

Keep file paths and access controls secure. Regularly back up the PouchDB store and memory files to prevent data loss. Rotate credentials and review environment variables to minimize exposure.

Available tools

Get Current Time

Retrieve the current timestamp from the server for consistent logging and memory observations.

Set Memory File Path

Specify or update the absolute path where memory backup data is stored.

Create Entities

Create new memory entities (e.g., people, organizations, events) used in the knowledge graph.

Create Relations

Connect entities with relationships to form a graph structure.

Add Observations

Record factual observations about entities and events with timestamps.

Delete Entities

Remove entities from memory when they are no longer relevant.

Delete Observations

Remove observations that are no longer accurate or needed.

Delete Relations

Remove relationships between entities.

Read Graph

Query the memory graph to retrieve related entities and observations.

Search Nodes

Find nodes in memory by name, type, or attributes.

Open Nodes

Access detailed information for a specific memory node.