# writ

> writ is a freemium MCP server for security. Allow, deny or step-up checks on AI agent writes, with a tamper-evident log. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** CLI, API
- **Website:** https://withwrit.com
- **Repository:** https://github.com/withwrit/pywrit/tree/HEAD/mcp
- **MCP Registry name:** io.github.withwrit/writ
- **Categories:** security, developer tools
- **Listing updated:** 2026-11-14

## About

Writ is aimed at the moment an agent is about to refund a payment, change a permission, send an email or delete something. The scanner (`writ scan .`) finds likely write sites in Python, TypeScript and JavaScript code, such as Stripe calls and database mutations, maps them to verbs, and can insert a `writ_check()` per Python function with `--apply`.

A check posts five fields (sponsor, agent, verb, target, purpose) and policy returns ALLOW, DENY or STEP_UP. An allowed grant is spent on use. Each decision lands in an HMAC-SHA256 chained audit log, and `writ verify-chain` shows whether any record was altered. The MCP package exposes 19 tools, including `writ_check`, `writ_lease`, `writ_execute`, `writ_receipts` and a `writ_sandbox` demo that needs no key.

Sponsor tools (`writ_grant`, `writ_revoke`, `writ_reinstate`) need a separate sponsor token, and the package is MIT licensed.

## Features

- **Write-site scanner:** Finds risky writes in Python, TypeScript and JavaScript.
- **Three outcomes:** ALLOW, DENY or STEP_UP per request.
- **Chained audit log:** HMAC-SHA256 chain that verify-chain can check.
- **Single-use leases:** Convert an allow into a gated execution lease.
- **Sponsor kill switch:** Revoke and reinstate a principal.

## Good for

- Require approval before an agent issues a refund
- Audit every agent decision in a SIEM stream
- Try the gate in a 90-second sandbox
- Block an agent's deletes until a human approves

## Install

### Claude Code (Terminal)

```sh
claude mcp add writ --env WRIT_API_KEY='<WRIT_API_KEY>' --env WRIT_SPONSOR_TOKEN='<WRIT_SPONSOR_TOKEN>' -- uvx writ-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "writ": {
      "command": "uvx",
      "args": [
        "writ-mcp"
      ],
      "env": {
        "WRIT_API_KEY": "<WRIT_API_KEY>",
        "WRIT_SPONSOR_TOKEN": "<WRIT_SPONSOR_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "writ": {
      "command": "uvx",
      "args": [
        "writ-mcp"
      ],
      "env": {
        "WRIT_API_KEY": "<WRIT_API_KEY>",
        "WRIT_SPONSOR_TOKEN": "<WRIT_SPONSOR_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "writ": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "writ-mcp"
      ],
      "env": {
        "WRIT_API_KEY": "<WRIT_API_KEY>",
        "WRIT_SPONSOR_TOKEN": "<WRIT_SPONSOR_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "writ": {
      "command": "uvx",
      "args": [
        "writ-mcp"
      ],
      "env": {
        "WRIT_API_KEY": "<WRIT_API_KEY>",
        "WRIT_SPONSOR_TOKEN": "<WRIT_SPONSOR_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "writ": {
      "command": "uvx",
      "args": [
        "writ-mcp"
      ],
      "env": {
        "WRIT_API_KEY": "<WRIT_API_KEY>",
        "WRIT_SPONSOR_TOKEN": "<WRIT_SPONSOR_TOKEN>"
      }
    }
  }
}
```

## Tools

- `writ_check`: Returns ALLOW, DENY or STEP_UP and a 90 second purpose-bound token.
- `writ_verify_token`: Verifies a token at the point of action.
- `writ_lease`: Converts an ALLOW token into a single-use gated lease.
- `writ_execute`: Runs one gated upstream request.
- `writ_grant`: Approves a STEP_UP with a one-time grant.
- `writ_revoke`: Turns on the kill switch for a principal.
- `writ_reinstate`: Turns the kill switch off.
- `writ_receipts`: Returns the audit trail of decisions.
- `writ_policy`: Shows the tenant verb policy.
- `writ_sandbox`: Free 90-second demo grant.

## FAQ

### What does it cost?

10,000 receipts a month are free with no credit card, then $1 per 1,000 receipts.

### How do I try it with no key?

Call `writ_sandbox`, then `writ_check` with verb demo_write.

### Which key is required?

WRIT_API_KEY; WRIT_SPONSOR_TOKEN is only for sponsor tools.

### Does it claim compliance?

The site says it supports NIST SP 800-53 AU-9 and your assessor determines compliance.

### Is writ free?

writ has a free plan, with paid plans for more usage or features.

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

Run this command in your terminal: claude mcp add writ --env WRIT_API_KEY='<WRIT_API_KEY>' --env WRIT_SPONSOR_TOKEN='<WRIT_SPONSOR_TOKEN>' -- uvx writ-mcp

### What are the best alternatives to writ?

The closest alternatives to writ 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/writ-2
