# writ

> writ is a freemium MCP server for security. Commit-time policy gate for AI agent writes: ALLOW, DENY or STEP_UP with audit receipts. It runs locally on your machine and is started by your AI client.

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

## About

Writ asks an agent to check before it does anything consequential. The agent sends a sponsor, agent, verb, target and purpose, and the policy answers ALLOW, DENY or STEP_UP. An ALLOW comes with a 90-second token bound to that exact write, and a STEP_UP waits for a human sponsor to approve a one-time grant. Every outcome, allowed or denied, becomes a receipt in an HMAC-SHA256 chained audit log that can be verified for tampering.

The MCP server runs over stdio from the writ-mcp Python package and needs a WRIT_API_KEY. Beyond checking, it can convert an ALLOW into a single-use lease and execute the gated upstream request itself using a credential held in Writ's vault, so the agent never touches the raw key. Sponsor tools grant, revoke and reinstate, with revoke acting as a kill switch. A writ_sandbox tool gives a free 90-second demo grant with no key.

The wider product scans Python, TypeScript and JavaScript code for write sites such as refunds, deletes and emails, and offers a GitHub App that flags ungated writes. The site says it supports NIST SP 800-53 AU-9 but leaves compliance to your assessor. The first 10,000 receipts per month are free and then $1 per 1,000.

## Features

- **Check before write:** Agents ask for a decision with verb, target and purpose before acting.
- **Purpose-bound tokens:** ALLOW returns a 90-second token tied to the exact write.
- **Tamper-evident log:** Receipts are hash-chained and verifiable with a chain check.
- **Gated execution:** Leases let Writ run the upstream request with a vaulted credential.
- **Kill switch:** Revoke a principal so later checks are denied.
- **Sandbox:** A free demo grant works without an API key.

## Good for

- Require approval before an agent issues a refund
- Stop an agent from deleting data without a policy match
- Keep an auditable record of every agent write
- Revoke a misbehaving agent immediately
- Verify that an audit log has not been altered

## 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`: Decision plus a 90-second purpose-bound token.
- `writ_verify_token`: Verifies an authorization token at the point of action.
- `writ_lease`: Converts an ALLOW token into a single-use lease.
- `writ_execute`: Runs one gated upstream request with a lease or token.
- `writ_grant`: Sponsor approval of a STEP_UP.
- `writ_revoke`: Kill switch for a principal.
- `writ_reinstate`: Turns the kill switch off.
- `writ_receipts`: Audit trail of decisions.
- `writ_verify_receipts`: Verifies the audit-log hash chain.
- `writ_policy`: Shows the tenant verb policy.
- `writ_sandbox`: Free demo grant without a key.
- `writ_github_installations`: Lists GitHub App installations.
- `writ_github_set_threshold`: Sets the check-run fail threshold per install.
- `writ_github_toggle_pr_comments`: Enables or disables the PR comment bot.
- `writ_manifests`: Lists repos with risk profiles or fetches a manifest.
- `writ_explain_receipt`: Explains a receipt in plain language.
- `writ_tenant_notify`: Gets or updates step-up notification settings.
- `writ_principals`: Lists the tenant's principals.
- `writ_verbs`: Lists the tenant's verb vocabulary.
- `writ_keys`: Lists API key metadata.

## FAQ

### What does it cost?

The first 10,000 receipts per month are free with no card, then $1 per 1,000 receipts.

### What happens on STEP_UP?

A human sponsor approves a one-time grant, then the agent checks again.

### Can I try it without a key?

Yes, writ_sandbox gives a free 90-second demo grant.

### What are the requirements?

Python 3.9 or newer and a WRIT_API_KEY for non-sandbox tools.

### 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
