Documentation
¶
Overview ¶
Package mcp exposes PromptZero's tool surface over the Model Context Protocol (stdio transport). Started by `promptzero --mcp` and intended to be plugged into MCP clients like Claude Desktop or Claude Code as a local tool server.
Every registered tool carries risk metadata derived from internal/risk.Classify, surfaced to the client as MCP annotations (readOnlyHint, destructiveHint, openWorldHint). Operators can use those hints to gate destructive calls in their MCP client.
Risk consent gate ¶
Tools at risk.High or risk.Critical are refused by default. Set the following environment variables to opt in:
- PROMPTZERO_MCP_ALLOW_HIGH=1 — permits risk.High tool calls.
- PROMPTZERO_MCP_ALLOW_CRITICAL=1 — permits risk.Critical tool calls (implies High is also permitted).
Denied calls are still recorded in the audit log (if wired) so the operator has a full record of attempted MCP tool invocations.
MCP resources ¶
Built-in wordlists are exposed as static MCP resources so clients can introspect their contents before invoking hash_crack_dictionary or http_enum_common:
- promptzero://wordlists/common.txt — ~500-entry HTTP common-paths list
- promptzero://wordlists/passwords.txt — ~100-entry common-password list
_confirmed ↔ Risk-tier equivalence (for MCP client integrations) ¶
Some reference MCPs (e.g. pm3-mcp) require a `{"_confirmed": true}` arg on every destructive tool call. PromptZero uses a different mechanism: the Spec.Risk field and the corresponding MCP tool annotations. The equivalence table is:
pm3-mcp tier → PromptZero Risk → MCP annotations read-only → Low → readOnlyHint:true, destructiveHint:false allowed-write → Medium → readOnlyHint:false, destructiveHint:false approval-write → High / Critical → readOnlyHint:false, destructiveHint:true
MCP clients (Claude Desktop, Claude Code) can gate Critical-tier calls using their built-in auto-approve settings keyed on destructiveHint:true. No `_confirmed` arg is added to PromptZero schemas — enforcement is at the client layer via annotations, not schema validation.
Index ¶
- type Server
- func (s *Server) MCPServer() *mcpserver.MCPServer
- func (s *Server) PromptNames() []string
- func (s *Server) ResourceNames() []string
- func (s *Server) ServeStdio() error
- func (s *Server) SetAuditLog(l *audit.Log)
- func (s *Server) SetBruce(b *bruce.Client)
- func (s *Server) SetBusPirate(bp *buspirate.Client)
- func (s *Server) SetFaultier(f *faultier.Client)
- func (s *Server) ToolNames() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the stdio MCP server wrapping a connected Flipper and optional Marauder sidecar.
func NewServer ¶
NewServer builds the MCP server and registers every tool compatible with the connected devices. The Marauder parameter may be nil; when absent, WiFi tools are not advertised.
func (*Server) MCPServer ¶ added in v0.2.0
MCPServer returns the underlying mcp-go server. Exposed so tests can attach alternate transports (e.g. in-process pipes) without going through the stdio wiring.
func (*Server) PromptNames ¶ added in v0.2.0
PromptNames returns the list of registered prompt names.
func (*Server) ResourceNames ¶ added in v0.5.0
ResourceNames returns the list of registered MCP resource URIs.
func (*Server) ServeStdio ¶
ServeStdio starts the server on the process's stdin/stdout pair. Blocks until the client disconnects or the process is signalled.
func (*Server) SetAuditLog ¶ added in v0.17.0
SetAuditLog wires an audit log so every MCP tool call (including consent-denied ones) is recorded. Call before ServeStdio.
func (*Server) SetBruce ¶ added in v0.17.0
SetBruce wires an optional Bruce devboard so bruce_* handlers do not short-circuit with "not connected" in MCP mode.
func (*Server) SetBusPirate ¶ added in v0.17.0
SetBusPirate wires an optional Bus Pirate 5 so buspirate_* handlers do not short-circuit with "not connected" in MCP mode.
func (*Server) SetFaultier ¶ added in v0.17.0
SetFaultier wires an optional Faultier glitcher so faultier_* handlers do not short-circuit with "not connected" in MCP mode.