Bowtie MCP Server
Official# Bowtie MCP Server
[](https://github.com/bowtiesecurity/bowtie-mcp/actions/workflows/ci.yml)
[](https://pypi.org/project/bowtie-mcp/)
[](https://pypi.org/project/bowtie-mcp/)
[](LICENSE)
An [MCP](https://modelcontextprotocol.io) server for [Bowtie](https://bowtie.works). From Claude Code, Claude Desktop, Cursor or any other MCP client, an AI agent can:
- **Deploy** a Bowtie controller into your own AWS or Google Cloud account.
- **Connect** the computer you are on: install the client and approve the device.
- **Manage** a running controller: access rules, devices, users, DNS, threat intelligence, traffic logs.
It runs on your computer, with your cloud credentials, against your controller. Bowtie hosts no part of it, and the server itself sends Bowtie nothing. What a controller reports to Bowtie is listed under [What Bowtie receives](#what-bowtie-receives).
<!-- mcp-name: io.github.bowtiesecurity/bowtie-mcp -->
## Install
Run it without installing, using [uvx](https://docs.astral.sh/uv/):
```bash
uvx bowtie-mcp
```
Or install it:
```bash
pip install bowtie-mcp
```
## Quick start
### Claude Code
```bash
claude mcp add bowtie -- uvx bowtie-mcp
```
### Claude Desktop, Cursor, Windsurf
Add to `claude_desktop_config.json`, `.cursor/mcp.json` or your editor's MCP config:
```json
{
"mcpServers": {
"bowtie": {
"command": "uvx",
"args": ["bowtie-mcp"]
}
}
}
```
Then ask, for example:
- *"Deploy Bowtie in AWS us-west-2 at bowtie.example.com, admin me@example.com."*
- *"I have no domain handy, use a bowtie.direct name. Org is Acme Rockets."*
- *"Connect this laptop."*
- *"Let the Engineering group reach the git server at 10.0.4.12 on 22 and 443."*
- *"Why can't alice@example.com reach the production database?"*
- *"List pending devices and approve the ones that belong to engineering."*
- *"Set up DNS for internal.example.com pointing at 10.0.0.53."*
- *"What traffic was dropped in the last 24 hours?"*
## Pointing it at a controller
**A controller the agent deploys.** Nothing to configure. The admin password is generated on your computer and kept in the operating system keychain (a file only you can read where there is no keychain). Print it in your own terminal, outside the agent:
```bash
uvx bowtie-mcp show-login <name>
```
**A controller you already run.** Attach it once. The password is typed at a hidden prompt and goes to the keychain, so it never sits in an agent's configuration file:
```bash
uvx bowtie-mcp connect prod --url https://bt0.example.com --email admin@example.com
```
**Environment variables**, for CI or if you prefer them. This is the same approach as the [Bowtie Terraform provider](https://registry.terraform.io/providers/bowtieworks/bowtie/latest):
| Variable | Description |
|---|---|
| `BOWTIE_HOST` | Controller HTTPS endpoint (e.g., `https://bt0.example.com`) |
| `BOWTIE_USERNAME`, `BOWTIE_PASSWORD` | A local admin's email and password |
| `BOWTIE_API_KEY_ID`, `BOWTIE_API_KEY_SECRET` | An API key, instead of a password. Today's controllers accept API keys only for device approval, so most tools need the password. |
| `BOWTIE_MCP_DEPLOYMENT` | The name of a stored deployment to use, when more than one is set up |
| `BOWTIE_MCP_SKIP_CONFIRMATION` | Set to `true` to carry out single-object changes at once (see below) |
```bash
claude mcp add bowtie \
-e BOWTIE_HOST="https://bt0.example.com" \
-e BOWTIE_USERNAME="admin@example.com" \
-e BOWTIE_PASSWORD="your-password" \
-- uvx bowtie-mcp
```
With more than one controller, add the server once per controller and set `BOWTIE_MCP_DEPLOYMENT` (or `BOWTIE_HOST`) in each entry.
Credentials are used by the local server process. They are never returned to the model: every tool result has secret-looking fields (passwords, keys, tokens, hashes) blanked before it leaves.
## How changes work
Anything that spends money or changes your network is two calls. The first changes nothing and says exactly what would happen. The second carries it out.
| First call (changes nothing) | Second call |
|---|---|
| `plan_deployment` lists every cloud resource, the cost and what Bowtie receives | `apply_deployment` |
| `propose_change` checks a whole set of rule changes and shows before and after | `apply_change` |
| Any other write tool (`upsert_dns_config`, `upsert_user`, ...) returns a `change_id` and a preview | `apply_change` |
So an MCP client can be told to allow everything except four tools, and ask you only for those: `apply_deployment`, `apply_change`, `destroy_deployment` and `install_client`.
`propose_change` is the way to change access. It takes names instead of ids, accepts changes in any order, refuses a rule that points at something that does not exist, warns when a change takes access away or opens a very large network, and `apply_change` refuses to run it if the controller changed in the meantime. Every applied change is written to a record on your computer (`recent_changes`), because the controller keeps none for rule edits.
For automation and CI, `BOWTIE_MCP_SKIP_CONFIRMATION=true` makes the single-object write tools act at once. `propose_change` and deployments stay two steps.
## Tools
**Deploy and connect**
| Tool | What it does |
|---|---|
| `check_prerequisites`, `plan_deployment` | Read-only. The plan lists what would be created and what it costs. |
| `apply_deployment`, `deployment_status`, `deployment_console` | Create the planned resources and follow the boot. |
| `destroy_deployment` | Delete them. Needs the name repeated. |
| `install_client`, `enroll_this_device` | Install the client on this computer (the OS asks for admin rights) and approve it. |
| `list_deployments` | Controllers this computer knows about. |
**Access**
| Tool | What it does |
|---|---|
| `list_rules`, `list_people`, `list_devices` | The rules in the order they are checked, users and groups, and devices, in plain words. |
| `check_access` | Asks the controller how it would treat a connection, and which rule decides. |
| `propose_change`, `apply_change`, `recent_changes` | Change rules, destinations, resources, user groups and device approval; see above. |
**Everything else on the controller**
- **Read** — users, user groups, devices, device groups, the raw policy document, DNS configs, organization and its settings, sites, collections, DNS block lists, threat categories, API keys, controllers, route exclusions.
- **Write** (staged for `apply_change`) — users, device assignment and cleanup, pre-approval by serial number, device groups, DNS configs, collections, DNS block lists, threat intelligence, route exclusions.
- **Logs** — `query_verdict_logs`, `get_verdict_summary`, `query_dns_logs`, `get_verdict_logging_status`. Verdict logging must be switched on per controller.
**Guided workflows** (MCP prompts)
| Prompt | Description |
|---|---|
| `onboard_team` | Create a user group, resources, resource group, and access policy |
| `audit_policies` | Review all policies for overly permissive rules |
| `troubleshoot_access` | Diagnose why a user/device can or can't reach a destination |
| `review_pending_devices` | Batch approve or reject pending devices |
| `analyze_traffic` | Recommend rule changes from what the verdict logs show |
## Naming a new controller
- **Your own domain (default).** If the hostname is in a Route 53 or Cloud DNS zone in the same account, the record is created for you. Otherwise you add one A record and the deployment carries on when it resolves.
- **bowtie.direct (opt-in).** No DNS work; Bowtie assigns `bt0.<org>-NNNN.bowtie.direct`. This sends the hostname, public IP and organization name to Bowtie, and the controller asks api.ipify.org for its own address. The plan says so before anything is created. Removing the deployment cannot remove the name from Bowtie's DNS.
## What Bowtie receives
- From this server: nothing. The controller image is looked up in your own cloud account. The client installer is an anonymous download, checked against its published SHA-256.
- From a controller it deploys: what every Bowtie controller sends by default. The licence check from first boot (organization name, domain, controller address), and usage telemetry: organization and controller details, version and uptime, counts of devices by operating system, users, groups, rules and sites, and network and database health figures. No traffic content. Ask for telemetry off and it is switched off right after boot; one report may go out first.
- With the bowtie.direct option: also the items listed above.
Your AI provider sees what the tools return.
## HTTP mode
For clients that connect over HTTP instead of starting a local process:
```bash
uvx bowtie-mcp --transport streamable-http --port 8080
```
This listens on `127.0.0.1:8080` and serves Streamable HTTP at `http://127.0.0.1:8080/mcp`. Legacy SSE is `--transport sse`, at `/sse`. There is no sign-in on these endpoints, so keep them on this computer.
## Limits
- Signing in is with a local admin's password, because controller API keys cover only device approval today.
- A dry run of a rule change is worked out here, not by the controller.
- No Azure. Linux client packages are x86_64 only.
- A computer's client belongs to one organization. If it is already set up for another controller, `install_client` changes nothing and says so.
- The tool list is long (70). Clients that load every tool up front may need some switched off.
## Development
```bash
git clone https://github.com/bowtiesecurity/bowtie-mcp.git
cd bowtie-mcp
pip install -e ".[dev]"
pytest
```
State lives in `~/.bowtie-mcp` (override with `BOWTIE_MCP_HOME`; `BOWTIE_MCP_SECRETS=file` keeps secrets out of the keychain). See [CONTRIBUTING.md](CONTRIBUTING.md) for the layout and [TESTED.md](TESTED.md) for what has been run against real infrastructure.
## License
[MIT](LICENSE)
TDQS
Scored across 70 tools
The set has several overlapping layers: list_users vs list_people, get_policy vs list_rules, and list_devices (controller summary) vs get_device/list_devices_in_group. Descriptions often clarify the intended distinction, but with 70 tools an agent can still plausibly select the wrong org-level versus controller-level operation.
Almost all names use lower snake_case with a recognizable verb_noun pattern such as list_users, upsert_dns_config, delete_collection, and query_verdict_logs. There are minor deviations like health_check, deployment_status, and recent_changes, but they remain readable and largely predictable.
Seventy tools is far beyond a practical, well-scoped surface for an agent and creates excessive selection and sequencing burden. The server spans several large domains and also contains duplicate-ish org/controller operations, so the count is an extreme mismatch even for a broad zero-trust platform.
Coverage is broad across users, devices, groups, DNS, collections, block lists, threat intel, route exclusions, logs, changes, and deployment lifecycle. However, several resources have read-only or indirect management only, such as sites, organization configuration, controllers, API keys, and some group membership operations, leaving notable dead ends.