Content
# f5-mcp
MCP server for F5 BIG-IP iControl REST (v17), scoped to **System (/mgmt/tm/sys)**,
**Network (/mgmt/tm/net)**, **Local Traffic Manager (/mgmt/tm/ltm)** and
**Application Security Manager (/mgmt/tm/asm)** endpoints. Other modules
(gtm, afm, apm, ...) are out of scope until added to the allow-list — see
[src/f5\_mcp/scope.py](src/f5_mcp/scope.py).
LTM/ASM write operations (`f5_create`/`f5_modify`/`f5_delete`) can affect live
traffic and security policy enforcement (virtual servers, pools, nodes, ASM
policies/signatures). There is no extra confirmation step beyond the
allow-list — be careful what you ask the model to do against a production device.
Designed to run as a local stdio MCP server, e.g. for use with LM Studio.
## Setup
```bash
uv sync
cp .env.example .env
# edit .env with your BIG-IP host/credentials
```
## Run standalone (MCP Inspector)
```bash
uv run mcp dev src/f5_mcp/server.py
```
## Tools
- `f5_list_endpoints()` — curated list of common sys/net/ltm/asm endpoints to use as a starting point.
- `f5_get(path, params=None)` — GET a resource or collection.
- `f5_create(path, body)` — POST a new resource.
- `f5_modify(path, body, method="PATCH")` — PATCH or PUT an existing resource.
- `f5_delete(path)` — DELETE a resource.
- `f5_set_virtual_state(path, enabled)` — enable/disable an LTM virtual server without needing to know the underlying `disabled`/`enabled` field name (models would otherwise send an empty PATCH body and get a 400 from F5).
- `f5_get_asm_event(support_id, include_raw=False)` — look up a single ASM request event by Support ID (`/mgmt/tm/asm/events/requests/<support_id>`). Returns a trimmed summary by default (client IP, URL, violations, enforcement state, etc.); set `include_raw=True` for the full event including `rawRequest`/`rawResponse`.
All tools validate `path` against the sys/net/ltm/asm allow-list before issuing the request.
## LM Studio configuration
In LM Studio's MCP server settings (`mcp.json` or the in-app MCP config), add:
```json
{
"mcpServers": {
"f5-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/f5-ltm-asm-mcp", "run", "f5-mcp"],
"env": {
"F5_HOST": "https://your-bigip-host",
"F5_USERNAME": "admin",
"F5_PASSWORD": "changeme",
"F5_VERIFY_SSL": "false"
}
}
}
}
```
Restart LM Studio after adding this so it picks up the new server.