# MCP-Bastion

> MCP-Bastion is an open-source MCP server. Security middleware for MCP. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/vaquarkhan/mcp-bastion
- **MCP Registry name:** io.github.vaquarkhan/mcp-bastion
- **Listing updated:** 2026-11-13

## About

Security middleware for MCP. Blocks prompt injection, PII leakage, and resource exhaustion.

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-bastion -- uvx mcp-bastion-python
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-bastion": {
      "command": "uvx",
      "args": [
        "mcp-bastion-python"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "mcp-bastion": {
      "command": "uvx",
      "args": [
        "mcp-bastion-python"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "mcp-bastion": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-bastion-python"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "mcp-bastion": {
      "command": "uvx",
      "args": [
        "mcp-bastion-python"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "mcp-bastion": {
      "command": "uvx",
      "args": [
        "mcp-bastion-python"
      ]
    }
  }
}
```

## FAQ

### Is MCP-Bastion free?

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

### How do I add MCP-Bastion to Claude Code?

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

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/mcp-bastion-2
