# rowstile

> rowstile is an open-source MCP server for databases. Check, test and review row-level security policies for Postgres from a coding agent. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://rowstile.dev/reference/tools
- **Repository:** https://github.com/rowstile/rowstile
- **MCP Registry name:** io.github.rowstile/rowstile
- **Categories:** databases, developer tools, security
- **Listing updated:** 2026-11-14

## About

rowstile turns a single policy file into plain SQL for Postgres: views, trigger-maintained tables for inheritance, row-level security policies and helper functions for checks, sharing and audit. The MCP server exposes the commands that matter to a coding agent: checking a policy, running its tests, proving properties and reviewing changes.

The wider command set includes init, which drafts a first policy from your tables and foreign keys, dev, which re-checks on every save and shows who gains or loses access, why, which explains a denial and the smallest data changes that would grant it, and migrate, which emits a migration for tools such as Prisma, Drizzle Kit, Django or Rails. A local Studio page shows tables as a chosen user would see them.

The README is candid about fit: it suits apps whose data lives in one Postgres database, and not setups where access depends on several databases or a browser reads tables through Supabase's Data API. It is in beta (0.1.0) with one maintainer, and it works with Postgres 16, 17 or 18 without superuser rights.

## Features

- **Policy checks:** Validate a policy file before it is applied.
- **Policy tests:** Run tests written against the policy.
- **Prove and review:** Prove properties and review what a change does to access.
- **Why explanations:** Explain why a user has or lacks a permission, and what would grant it.
- **Migrations for your tool:** Generate policy migrations for Prisma, Drizzle Kit, Django, Rails and others.
- **Local Studio:** Browse tables as a given user, with unreadable rows greyed out.
- **No extra service:** Rules compile into Postgres itself; nothing runs beside the database.

## Good for

- Let an agent verify a row-level security change before merging
- Draft a first access policy from an existing schema
- Find out why a user cannot edit a folder
- Replace hand-written RLS that has become hard to test
- Model shared folders, teams and tenants in one policy

## Install

### Claude Code (Terminal)

```sh
claude mcp add rowstile -- npx -y rowstile
```

### Claude Desktop (claude_desktop_config.json)

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

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

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

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

```json
{
  "servers": {
    "rowstile": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "rowstile"
      ]
    }
  }
}
```

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

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

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

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

## Tools

- `check`: Check a policy
- `test`: Run policy tests
- `prove`: Prove policy properties
- `review`: Review a policy change

## FAQ

### Which Postgres versions work?

Postgres 16, 17 and 18, managed or not, with no superuser needed.

### Is it production-ready?

It is in beta at 0.1.0 with one maintainer, and the README says a minor release before 1.0 may change the language and functions.

### When does it not fit?

When access depends on several databases or outside Postgres, or a browser reads tables through Supabase's Data API.

### Was it called something else?

Yes, it was called rowfence until 0.1.0-alpha.1.

### Is rowstile free?

Yes. rowstile is open source, so you can use and self-host it for free.

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

Run this command in your terminal: claude mcp add rowstile -- npx -y rowstile

### What are the best alternatives to rowstile?

The closest alternatives to rowstile 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.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

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