Persistent Context MCP Server

AI memory management and context persistence system with MCP support

README.md

@corbyjames/persistent-context-mcp

AI memory management and context persistence system with Model Context Protocol (MCP) server for Claude Desktop and other AI assistants.

🌟 Features

  • Persistent Context Storage: Store and retrieve conversation contexts using Neo4j graph database
  • MCP Server Integration: Full compatibility with Claude Desktop via Model Context Protocol
  • Web UI: Interactive dashboard for managing contexts and visualizing relationships
  • Multi-Storage Support: Neo4j for graph relationships, file system for backups
  • AI Integration: Optional OpenAI/Anthropic API support for semantic search
  • Docker/Podman Support: Containerized deployment options
  • CLI Tool: Global command-line interface for easy management

🚀 Quick Start

Installation

# Install globally
npm install -g @corbyjames/persistent-context-mcp

# Or using npx (no installation required)
npx @corbyjames/persistent-context-mcp init

Initialize Configuration

# Interactive setup
persistent-context init

# With Claude Desktop integration
persistent-context init --claude

# With Docker configuration
persistent-context init --docker

Start Services

# Start Neo4j database
persistent-context neo4j start

# Start MCP server
persistent-context start

# Start with UI
persistent-context start --ui

# Or run as daemon
persistent-context start --daemon

🔧 Claude Desktop Integration

Automatic Setup

persistent-context claude-setup

This will automatically configure Claude Desktop to use the MCP server.

Manual Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "persistent-context": {
      "command": "persistent-context",
      "args": ["start"],
      "env": {
        "PORT": "3000"
      }
    }
  }
}

Note: Restart Claude Desktop after configuration.

🐳 Docker/Podman Deployment

Using Docker

# Generate docker-compose.yml
persistent-context container docker

# Start services
docker-compose up -d

# View logs
docker-compose logs -f

Using Podman

# Generate podman-compose.yml
persistent-context container podman

# Start services
podman-compose up -d

# View logs
podman-compose logs -f

Pre-built Docker Image

docker run -d \
  --name persistent-context \
  -p 3000:3000 \
  -p 5173:5173 \
  -e NEO4J_URI=bolt://neo4j:7687 \
  -e NEO4J_USER=neo4j \
  -e NEO4J_PASSWORD=password \
  corbyjames/persistent-context-mcp:latest

📁 Configuration

Environment Variables

Create a .env file in your project directory:

# Neo4j Configuration
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password

# Server Configuration
PORT=3000
NODE_ENV=production
LOG_LEVEL=info

# Data Storage
DATA_DIR=~/.persistent-context
BACKUP_DIR=~/.persistent-context/backups

# Optional: AI Integration
OPENAI_API_KEY=your-api-key

# Security - Store in secure vault for production
SECRETS_PATH=~/.persistent-context/secrets

Secrets Management

For production deployments, we recommend storing secrets using:

  • AWS Secrets Manager

    aws secretsmanager create-secret \
      --name persistent-context/neo4j \
      --secret-string '{"password":"secure-password"}'
    
  • Azure Key Vault

    az keyvault secret set \
      --vault-name mykeyvault \
      --name neo4j-password \
      --value "secure-password"
    
  • HashiCorp Vault

    vault kv put secret/persistent-context \
      neo4j_password="secure-password"
    
  • Kubernetes Secrets

    kubectl create secret generic persistent-context \
      --from-literal=neo4j-password=secure-password
    

🖥️ CLI Commands

Core Commands

# Initialize configuration
persistent-context init [options]
  --claude    Setup for Claude Desktop
  --docker    Generate Docker config
  --podman    Generate Podman config

# Start MCP server
persistent-context start [options]
  -d, --daemon    Run as daemon
  --ui            Also start the UI

# Start web UI
persistent-context ui [options]
  -p, --port    UI port (default: 5173)

# Manage Neo4j
persistent-context neo4j <action>
  start    Start Neo4j container
  stop     Stop Neo4j container
  status   Check Neo4j status

# Setup Claude Desktop
persistent-context claude-setup

# Generate container config
persistent-context container <runtime>
  docker    Generate docker-compose.yml
  podman    Generate podman-compose.yml

Short Alias

You can also use the short alias pcmcp:

pcmcp init
pcmcp

Environment Variables

NEO4J_URIrequiredNeo4j database connection URI
NEO4J_USERrequiredNeo4j database username
NEO4J_PASSWORDrequiredNeo4j database password
PORTServer port
OPENAI_API_KEYOptional API key for AI integration

Try it

Store the key takeaways from our current conversation in the persistent context.
Search my memory for previous discussions regarding project architecture.
Visualize the relationship graph between the entities we discussed yesterday.
Retrieve the context summary for the project named 'Alpha'.

Frequently Asked Questions

What are the key features of Persistent Context MCP?

Persistent conversation context storage using Neo4j graph database. Full compatibility with Claude Desktop via Model Context Protocol. Interactive web dashboard for managing and visualizing knowledge. Multi-storage support with file system backups. Optional semantic search capabilities via AI integration.

What can I use Persistent Context MCP for?

Maintaining long-term memory across multiple separate AI chat sessions. Mapping complex relationships between project entities and requirements. Visualizing conversation history to identify recurring themes or topics. Backing up AI conversation context for portability and data safety.

How do I install Persistent Context MCP?

Install Persistent Context MCP by running: npm install -g @corbyjames/persistent-context-mcp

What MCP clients work with Persistent Context MCP?

Persistent Context MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Persistent Context MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare