Use the Fencer CLI as an MCP server
Overview
Section titled “Overview”fencer mcp turns the installed CLI into a local
Model Context Protocol server over stdio. It reuses the same login
as the rest of the CLI, so AI tools can work with organizations, vulnerabilities, detections,
assets, scans, and identities with your permissions.
Fencer also exposes a remote MCP endpoint at https://app.fencer.dev/mcp/. That path does not
require the CLI binary (see MCP Server). This page covers the local
stdio server provided by the binary.
Prerequisites
Section titled “Prerequisites”- The CLI is installed and you have run
fencer login(or setFENCER_TOKEN; see Authentication). - An MCP client that can spawn a local command (Claude Desktop, Cursor, and similar).
Configure your client
Section titled “Configure your client”Point the client at the fencer binary on your PATH:
{ "mcpServers": { "fencer": { "command": "fencer", "args": ["mcp"], "env": { "FENCER_ORG": "your-org-slug" } } }}If the client cannot find fencer, put the binary’s full path in command.
The server exposes the same operations as the CLI commands:
- Read:
organizations.list,vulnerabilities.list,vulnerabilities.get,detections.list,detections.get,assets.list,assets.get,assets.filters,scans.list,scans.get,scans.list_vulnerabilities,scans.diff,identities.list. - Write:
vulnerabilities.assign,vulnerabilities.unassign,vulnerabilities.ignore,vulnerabilities.unignore,vulnerabilities.defer,vulnerabilities.undefer,vulnerabilities.set_priority,vulnerabilities.fix,detections.assign,detections.unassign,detections.investigate,detections.resolve,detections.reopen,assets.set_criticality,scans.schedule.
Org-scoped tools accept an optional organization_slug. When it is omitted they use --org /
FENCER_ORG, and then the only organization you can access, if there is exactly one (a service
account always has one).
Each tool carries MCP annotations (read-only, destructive, idempotent) so your client can decide when to ask you before running it. The CLI does not prompt in MCP mode: a write tool runs as soon as the client calls it, so keep your client’s tool approval turned on for write tools.
List tools take page / page_size and return the same {results, pagination} envelope as CLI
JSON output.