Skip to content
MCP server

Sanctuary

Local MCP server adding encrypted keys, approval gates and an audit chain around AI agents

Runs locally

Sanctuary is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
macOS, Linux, CLI
Runs
Locally
Version
1.8.4
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "sanctuary": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.sanctuary]
command = "npx"
args = ["-y", "@sanctuary-framework/mcp-server"]

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Or run: gemini mcp add -s user sanctuary npx -- -y @sanctuary-framework/mcp-server

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "sanctuary": {
          "command": "npx",
          "args": [
            "-y",
            "@sanctuary-framework/mcp-server"
          ]
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About Sanctuary

Sanctuary targets the risk that an agent on your machine can use every credential and permission your account has. Its answer is a layer under the agent: keys held under your passphrase, a policy that is frozen at startup and that the agent cannot read, and an append-only, hash-chained record of what the agent did. Approval gates have three tiers, with a human required on irreversible actions.

The README is unusually explicit about what is proven. Operating-system egress enforcement is proven on macOS and, in a separate Castle Wall Linux package, on Ubuntu 24.04 (x86-64) only; Windows is roadmapped. The audit record and export are marked partial, and it does not claim a filesystem or process sandbox.

One command wraps Claude Code, and the README also names Cursor, Hermes, OpenClaw, Cline and Mastra, with Mastra fixture-tested only. It needs Node.js 22 or newer.

What it does

Encrypted local keys
Ed25519 identity and Argon2id unlock keep keys and state encrypted under your passphrase.
Approval gates
Three approval tiers with a human on the irreversible ones.
Hash-chained audit record
An append-only log of what the agent did, rated partial by the project.
Egress policy wall
Signed operator policy allows or denies outbound traffic below the agent on macOS and Ubuntu 24.04.
Harness wrapping
One command protects Claude Code and other named harnesses.
Evidence matrix
An Assurance Matrix ties each claim to a captured drill.

Good for

  • Put approval gates in front of an autonomous coding agent
  • Restrict where an agent account's network traffic can go
  • Keep agent keys and state encrypted on your own hardware
  • Review a tamper-evident log of an agent's actions

Pricing

Open source

Open source; no hosted service

Sanctuary FAQ

Which platforms are covered?

macOS is proven; Linux is proven on Ubuntu 24.04 (x86-64) only via a separate package; Windows enforcement is roadmapped.

Does Sanctuary need a vendor service?

No. The README says no vendor sits in the path or can decrypt your state.

Which agents can Sanctuary wrap?

Claude Code, Cursor, Hermes, OpenClaw, Cline and Mastra, with wrapping tested on representative paths only.

What does Sanctuary not claim?

A filesystem or process sandbox for the agent, or an audited per-rule trail.

Is Sanctuary free?

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

How do I add Sanctuary to Claude Code?

Run this command in your terminal: claude mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server

What are the best alternatives to Sanctuary?

The closest alternatives to Sanctuary are REA, headroom, omniget, next-ai-draw-io and Claude Code Ultimate Guide.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers