Skip to content
MCP server

MCP Hangar

Open-source MCP gateway that pins tools, holds risky calls and limits egress

Runs locallyStatus and history
Pricing
Open source
Platforms
self-hosted, CLI, Linux
Runs
Locally
Version
2.39.0
Listing updated
3 days ago

About MCP Hangar

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

Hangar sits between an MCP client and its servers and decides every tool call by passing it through 13 gates in a fixed order. The first gate that says no is the verdict. The checks include tool access, withdrawal per tenant, a digest pin, health circuit breaking, tenant budgets and rate, human approval, an egress check just before outbound I/O, and a cap on response size. The site says nothing on the verdict path is scored or learned.

The pin is the notable one: if a tool's description or schema changes after you approved it, the call is refused. A short config lists which tools are allowed by pattern and which wait for a person, for example reads allowed and create_issue held. Egress policy is described for Kubernetes.

Every decision is recorded with caller, tenant, gate and a bounded reason code, and SIEM export is offered. It is MIT licensed, self-hosted with no SaaS, installs from PyPI, and runs on a laptop, a VM or Kubernetes. Its stdio entry needs a config.yaml listing upstream servers.

Install

Run in a terminal

claude mcp add hangar -- uvx mcp-hangar

Add to claude_desktop_config.json

{
  "mcpServers": {
    "hangar": {
      "command": "uvx",
      "args": [
        "mcp-hangar"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "hangar": {
      "command": "uvx",
      "args": [
        "mcp-hangar"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "hangar": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-hangar"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "hangar": {
      "command": "uvx",
      "args": [
        "mcp-hangar"
      ]
    }
  }
}

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

{
  "mcpServers": {
    "hangar": {
      "command": "uvx",
      "args": [
        "mcp-hangar"
      ]
    }
  }
}

Configuration

  • MCP_CONFIGPath to config.yaml declaring the upstream MCP servers and policy. Without it Hangar reads ./config.yaml, else ~/.config/mcp-hangar/config.yaml (written by `mcp-hangar init`), and refuses to start if neither exists.

What it does

Tool pinning
Refuses a call if a tool's description or schema changed after approval.
Human approval
Holds selected calls until a person approves or denies.
Egress policy
Controls where a server can connect on Kubernetes.
13 ordered gates
A fixed sequence of checks with named deny reasons.
Audit trail
Records each allow, deny and hold with caller and tenant.
Tenant budgets
Rate and concurrency limits per tenant.

Good for

  • Block a tool whose description was silently rewritten
  • Require sign-off on write calls like create_issue
  • Give each tenant a rate budget
  • Keep an attributable record of MCP calls

Pricing

Open source

MIT licence, self-hosted.

Prices change. Check mcp-hangar.io before you buy.

MCP Hangar FAQ

Is it a hosted service?

No. It is self-hosted and MIT licensed, with no SaaS.

Does it use machine learning?

No. The site describes the verdict path as deterministic.

Where can it run?

On a laptop, a VM or Kubernetes.

What does it need to start?

A config.yaml declaring upstream servers and policy, which `mcp-hangar init` can create.

Is MCP Hangar free?

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

How do I add MCP Hangar to Claude Code?

Run this command in your terminal: claude mcp add hangar -- uvx mcp-hangar

What are the best alternatives to MCP Hangar?

The closest alternatives to MCP Hangar are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to MCP Hangar

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools