npm package: @persistadev/mcp-server
Description: MCP server for Persista - AI Memory Infrastructure + Multi-Agent Coordination. Give your AI persistent memory across sessions and coordinate multiple agents.
Author: Persista
Latest version: 4.0.0

# @persistadev/mcp-server

> Give your AI persistent memory across sessions

Persista is an MCP (Model Context Protocol) server that provides AI assistants with persistent memory, context management, and intelligent learning capabilities.

## Features

🧠 **Memory** - Save and retrieve user preferences, facts, and behaviors across sessions  
📝 **Context** - Smart context packing with relevance scoring and threading  
🔄 **Sync** - Multi-instance coordination with intent broadcasting  
📚 **Knowledge** - Version-aware best practices and deprecation warnings  
🧬 **Codebase DNA** - Automatic detection of patterns, conventions, and architecture  
⚠️ **Error Learning** - Captures build errors and anti-patterns to avoid repeating mistakes  

## Quick Start

### 1. Get an API Key

Sign up at [persista.dev](https://persista.dev) and create an API key from the dashboard.

### 2. Add to Cursor

Add this to your `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "persista": {
      "command": "npx",
      "args": ["-y", "@persistadev/mcp-server"],
      "env": {
        "PERSISTA_API_KEY": "pst_your_api_key_here"
      }
    }
  }
}
```

### 3. Restart Cursor

That's it! Your AI now has persistent memory.

## What It Does

Once installed, the AI can:

- **Remember** your preferences, coding style, and project decisions
- **Detect** your codebase patterns and conventions automatically
- **Learn** from errors to avoid making the same mistakes
- **Track** git changes between sessions
- **Coordinate** with other AI instances working on the same project

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `PERSISTA_API_KEY` | Yes | Your API key from persista.dev |
| `PERSISTA_API_URL` | No | Custom API URL (defaults to api.persista.dev) |
| `PERSISTA_USER_ID` | No | Custom user ID (defaults to system username) |
| `PERSISTA_PROJECT_DIR` | No | Override project directory detection |

## Available Tools

The MCP server provides these tools to the AI:

### Memory
- `memory_save` - Save memories with confidence decay and code attachment
- `memory_get` - Retrieve all memories with effective confidence scores
- `memory_search` - Semantic search through memories
- `memory_for_file` - Get memories attached to specific files

### Context
- `context_pack` - Smart context packing within token budget
- `context_relevant` - Get most relevant context for conversation
- `context_thread_create` - Create conversation threads
- `context_summary_save` - Save conversation summaries

### Sync
- `sync_discover` - Find other AI instances on this project
- `sync_intent` - Broadcast editing intent to prevent conflicts
- `sync_check_conflicts` - Check for conflicting edits

### Knowledge
- `knowledge_check` - Version-aware best practices
- `knowledge_deprecations` - Get deprecation warnings
- `knowledge_scan_code` - Scan code for deprecated patterns
- `knowledge_learn_pattern` - Learn custom patterns

### DNA (Codebase Analysis)
- `dna_analyze` - Deep codebase analysis
- `dna_conventions` - Get coding conventions
- `dna_patterns` - Get detected patterns
- `dna_architecture` - Get architecture info
- `dna_add_decision` - Record tech decisions
- `dna_mark_critical` - Mark critical paths

### Error Learning
- `error_capture` - Capture errors for learning
- `error_patterns` - Get known error patterns

### Session
- `session_refresh` - Reload session context
- `session_summary` - Get full session summary

## Resources

The MCP server also provides these auto-injected resources:

- `persista://session/context` - Full session context (memory, git, DNA)
- `persista://user/memory` - All user memories
- `persista://codebase/dna` - Basic codebase analysis
- `persista://codebase/dna-deep` - Deep codebase DNA
- `persista://git/changes` - Git changes since last session
- `persista://knowledge/relevant` - Relevant best practices
- `persista://errors/learned` - Learned error patterns

## Links

- **Website**: [persista.dev](https://persista.dev)
- **Dashboard**: [persista.dev/dashboard](https://persista.dev/dashboard)
- **Docs**: [persista.dev/docs](https://persista.dev/docs)

## License

MIT