# Selvedge

Selvedge keeps decision rationale and rejected options in a project-local store. Use it when an agent needs earlier context in a later coding session.

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

## What it does

Selvedge records decisions against project entities such as a function, database column, or API route. A record can explain the reason for a choice, alternatives that were rejected, and what might prompt a reconsideration. An agent can look up that history before editing related code.

The MCP server runs locally over stdio and stores records in SQLite under `.selvedge/`. The CLI can access the same store when you switch tools. Installation requires `uv` and Python; Python 3.11–3.14 is recommended for new installs. Only decisions someone explicitly saves can be retrieved. Selvedge does not check whether a record is true or ensure an agent will consult it.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `SELVEDGE_DB` — 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 SELVEDGE_DB=<SELVEDGE_DB> --transport stdio selvedge -- uvx selvedge
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from selvedge <command>

### Codex

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

### Cursor

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

### GitHub Copilot

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

### Gemini CLI

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

## When to use it
- record why an implementation approach was chosen
- retrieve an earlier decision by function or API route
- carry decision records between agent sessions
- review rejected approaches before changing related code

## Example prompts
- Save why we chose this API route and record the alternative we rejected.
- Before editing this function, find its decision history and check whether the constraints still apply.
- Record why we selected this dependency and what would make us revisit the choice.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
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
