Selvedge — Claude Code MCP server: decision memory
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.
claude mcp add --env SELVEDGE_DB=<SELVEDGE_DB> --transport stdio selvedge -- uvx selvedgeWhat Selvedge 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.
What it helps with
- 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 for the agent
- 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.
How to install Selvedge
Platform CLI
claude mcp add --env SELVEDGE_DB=<SELVEDGE_DB> --transport stdio selvedge -- uvx selvedgeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from selvedge <command>
Platform CLI
codex mcp add selvedge --env SELVEDGE_DB=<SELVEDGE_DB> -- uvx selvedgeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from selvedge <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add -e SELVEDGE_DB=<SELVEDGE_DB> selvedge uvx selvedgeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from selvedge <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Selvedge
How do I install Selvedge in Claude Code?
Run claude mcp add selvedge -- uvx selvedge. Installation requires uv and Python.
What does Selvedge do?
It stores decision rationale and rejected approaches in a local SQLite database. An agent can retrieve records by the project entity they concern in a later session.
Does Selvedge need a hosted account or make LLM calls?
No hosted account is required. Core record storage and retrieval use the local database without LLM calls.