# CPersona

Keeps agent project memory across coding sessions in a local SQLite database using three-layer hybrid retrieval.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: Cloto-dev
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Cloto-dev/CPersona
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/cpersona

## What it does

CPersona acts as a persistent memory layer for development agents over MCP. Every architectural choice and note stays inside a single SQLite file under your direct control. Instead of routing recall through an external LLM, the system applies a three-layer hybrid search with confidence scoring, while the `reconstruct` tool surfaces exact quotes from past notes.

Running this server requires Python 3.11 or newer and `uvx`. The vector search layer needs a local embedding service running on port 8401, which you can launch with `cembedding` and the `jina-v5-nano` model. When connecting over HTTP rather than stdio, the server halts at startup unless you provide `CPERSONA_AUTH_TOKEN` or toggle `CPERSONA_ALLOW_UNAUTHENTICATED_HTTP=true`.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `CPERSONA_DB_PATH`, `CPERSONA_EMBEDDING_MODE`, `CPERSONA_EMBEDDING_URL`, `CPERSONA_RECALL_MODE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env CPERSONA_DB_PATH=<CPERSONA_DB_PATH> --env CPERSONA_EMBEDDING_MODE=<CPERSONA_EMBEDDING_MODE> --env CPERSONA_EMBEDDING_URL=<CPERSONA_EMBEDDING_URL> --env CPERSONA_RECALL_MODE=<CPERSONA_RECALL_MODE> --transport stdio cpersona -- uvx cpersona
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cpersona <command>

### Codex

**Platform CLI**
```bash
codex mcp add cpersona --env CPERSONA_DB_PATH=<CPERSONA_DB_PATH> --env CPERSONA_EMBEDDING_MODE=<CPERSONA_EMBEDDING_MODE> --env CPERSONA_EMBEDDING_URL=<CPERSONA_EMBEDDING_URL> --env CPERSONA_RECALL_MODE=<CPERSONA_RECALL_MODE> -- uvx cpersona
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cpersona <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cpersona": {
            "command": "uvx",
            "args": [
                "cpersona"
            ],
            "env": {
                "CPERSONA_DB_PATH": "<CPERSONA_DB_PATH>",
                "CPERSONA_EMBEDDING_MODE": "<CPERSONA_EMBEDDING_MODE>",
                "CPERSONA_EMBEDDING_URL": "<CPERSONA_EMBEDDING_URL>",
                "CPERSONA_RECALL_MODE": "<CPERSONA_RECALL_MODE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cpersona <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cpersona": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "cpersona"
            ],
            "env": {
                "CPERSONA_DB_PATH": "<CPERSONA_DB_PATH>",
                "CPERSONA_EMBEDDING_MODE": "<CPERSONA_EMBEDDING_MODE>",
                "CPERSONA_EMBEDDING_URL": "<CPERSONA_EMBEDDING_URL>",
                "CPERSONA_RECALL_MODE": "<CPERSONA_RECALL_MODE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cpersona <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e CPERSONA_DB_PATH=<CPERSONA_DB_PATH> -e CPERSONA_EMBEDDING_MODE=<CPERSONA_EMBEDDING_MODE> -e CPERSONA_EMBEDDING_URL=<CPERSONA_EMBEDDING_URL> -e CPERSONA_RECALL_MODE=<CPERSONA_RECALL_MODE> cpersona uvx cpersona
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cpersona <command>

## When to use it
- retain project decisions across agent sessions
- retrieve past notes using hybrid search
- inspect source quotes using the reconstruct tool
- store conversation context in an owned SQLite file

## Example prompts
- Save the design decision and reasoning for using Redis for session caching.
- Recall past decisions regarding the billing API and show the source quotes.
- Check our stored records for database migration rules established earlier.

## Similar
- [sqlite-graph-memory](https://affpapa.org/en/nevibecode/mcp/sqlite-graph-memory.md) — MCP server · ★ 12
- [tinycontext](https://affpapa.org/en/nevibecode/mcp/tinycontext.md) — MCP server · ★ 9
- [open-zk-kb](https://affpapa.org/en/nevibecode/mcp/open-zk-kb.md) — MCP server · ★ 7
- [melchizedek](https://affpapa.org/en/nevibecode/mcp/melchizedek.md) — MCP server · ★ 7
- [Pensyve](https://affpapa.org/en/nevibecode/mcp/pensyve.md) — MCP server · ★ 97
- [Palinode](https://affpapa.org/en/nevibecode/mcp/palinode.md) — MCP server · ★ 46

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
