# sqlew [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/sqlew-io/sqlew  
**GitHub Stars:** 5  
**npm Downloads (last month):** 681  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sqlew

## Description
Automated ADR (Architecture Decision Records) for AI Coding Agents - MCP server with SQL-backed decision repository

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "sqlew": {
    "command": "npx",
    "args": ["-y","sqlew"]
  }
}
```

## Documentation

## What sqlew does

sqlew stores architecture knowledge separately from implementation code. Decisions can include their rationale, tags, architectural layers, constraints, and alternatives that were rejected. This gives coding agents a structured way to recall why a system was designed a certain way, what rules apply, and which options have already been considered.

The server is aimed at AI coding workflows where an agent repeatedly investigates the same repository. It does not replace reading source code for implementation details. Instead, it addresses the design-intent portion of that investigation: architectural choices, non-local constraints, and prior decisions that are difficult to reconstruct from code alone.

## How it works

The MCP interface exposes intent-retrieval operations including `suggest`, session context, and targeted decision and constraint lookups. Session-start context can provide recent information where the coding harness supports it. Related decisions can also be surfaced after repository searches or web research when the surrounding hooks are installed.

sqlew supports three workflow stages. Research and writing can draft ADRs automatically, without requiring Plan Mode. Plan-based workflows can capture decisions as well. Constraints remain first-class records, while duplicate and similarity checks help prevent circular reconsideration of an existing decision.

The database is created automatically on first run for the local setup. The default shared database path is `~/.config/sqlew/sqlew-shared.db`. Project identity usually comes from the basename of the Git remote; `SQLEW_PROJECT_NAME` can override that when several repositories share one database.

## Setup and configuration

The full package is installed globally with npm and includes SQLite, PostgreSQL, and MySQL drivers. Smaller package options are available for PostgreSQL, MySQL, or SQLite. Cursor Cloud and other ephemeral environments can use `npx @sqlew/pg` with a remote database URL. `SQLEW_DATABASE_URL` or `DATABASE_URL` configures the database connection.

For npm 12 and later, the full package and the SQLite variant require permission for the `better-sqlite3` install script. PostgreSQL and MySQL variants do not need that permission. On Windows, a global SQLite installation may require the same script permission or Node.js 22 LTS; PostgreSQL is another supported option.

A basic MCP-only setup registers the `sqlew` command in a project `.mcp.json` file. Native integrations are available through the separate sqlew-plugin for Claude Code, Codex CLI, Grok Build, Hermes, and oh-my-pi. The plugin adds harness-specific hooks and planning skills; MCP-only clients receive the server tools without those additions.

## Tools and capabilities

- Store architectural decisions and constraints in SQL.
- Retrieve relevant context with `suggest`.
- Query individual decisions or constraints.
- Include rationale, tags, layers, and rejected alternatives in decision records.
- Inject recent or related context through supported session and post-search hooks.
- Detect duplicate or similar decisions before another architecture choice is recorded.

## Limitations and notes

MCP alone does not provide the automatic, plan-less ADR workflow. That behavior depends on the sqlew-plugin hooks for compatible coding harnesses. Cursor Cloud also needs the plugin for plan-less automatic ADR capture; running the PostgreSQL package by itself only provides the MCP server.

The server is designed to recall design intent, not implementation detail. Agents still need to inspect the repository when they need exact code behavior. sqlew does not send data to external networks or collect usage statistics. It is licensed under Apache-2.0.

_Full upstream README: https://allmcps.com/mcp/sqlew/readme_

