# Selvedge

> Selvedge is a free MCP server for knowledge and memory. Local memory that stores why code changed and which approaches were rejected. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, self-hosted
- **Website:** https://selvedge.sh
- **Repository:** https://github.com/masondelan/selvedge
- **MCP Registry name:** io.github.masondelan/selvedge
- **Categories:** knowledge and memory, developer tools
- **Listing updated:** 2026-11-14

## About

Selvedge targets a gap that code alone leaves: the reasons behind a choice and the alternatives that were ruled out. You save a decision, its constraints and what would change your mind, then recall it in a later session using a function, database column, API route or dependency as the lookup key.

Everything sits in a SQLite file under .selvedge/ next to the project, so decisions carry over when you switch tools. No hosted account is needed and core storage and retrieval make no model calls. It connects through a local stdio MCP server or the CLI for agents with shell access, and `selvedge demo --mcp` saves a record, restarts the server and retrieves it using throwaway data.

The README is candid about limits: only explicitly saved decisions can be recalled, saved reasons are not verified, and nothing guarantees an agent will consult them. Recent versions add a markdown digest export with a drift check and an optional GitHub Action that surfaces rejected approaches in pull request comments.

## Features

- **Decision records:** Stores rationale, rejected approaches and what would change the decision.
- **Entity lookup:** Retrieves history by function, column, route or dependency.
- **Local SQLite store:** Keeps data in .selvedge/ with no hosted account.
- **MCP or CLI:** Works over stdio MCP or from a shell-capable agent.
- **Digest check:** Exports a Markdown digest and flags drift with a --check mode.
- **Review Action:** Optional GitHub Action surfaces recorded history in PR comments.

## Good for

- Recover why an approach was rejected after the original chat is gone
- Hand decisions between sessions and coding tools
- Warn reviewers about previously reverted approaches
- Keep a project decision log in version control

## Install

### Claude Code (Terminal)

```sh
claude mcp add selvedge -- uvx selvedge
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "selvedge": {
      "command": "uvx",
      "args": [
        "selvedge"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "selvedge": {
      "command": "uvx",
      "args": [
        "selvedge"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "selvedge": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "selvedge"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "selvedge": {
      "command": "uvx",
      "args": [
        "selvedge"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "selvedge": {
      "command": "uvx",
      "args": [
        "selvedge"
      ]
    }
  }
}
```

## FAQ

### Where is data stored?

In a SQLite file at .selvedge/selvedge.db by default, or the path in SELVEDGE_DB.

### Does it call an LLM?

Core storage and retrieval make no model calls.

### Does it guarantee my agent reads the decisions?

No. Only saved decisions can be recalled and use depends on the agent.

### How do I try it?

Install with uv tool install selvedge and run selvedge demo.

### Is Selvedge free?

Yes. Selvedge is free to use.

### How do I add Selvedge to Claude Code?

Run this command in your terminal: claude mcp add selvedge -- uvx selvedge

### What are the best alternatives to Selvedge?

The closest alternatives to Selvedge are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/selvedge
