Skip to content
Docs for briefcase-ai v3.3.0see what’s new.

MCP Server

Run a Model Context Protocol (MCP) server that gives MCP-capable tools — Claude Code, Cursor, Codex — direct access to Briefcase operations: sanitize PII, estimate model cost, analyze output drift, and read the usage guide. The tools are read-only and wrap briefcase.sanitize, briefcase.cost, and briefcase.drift.

pip install briefcase-ai[mcp] For: agent runtimes & IDEs

Install

Terminal window
pip install briefcase-ai[mcp]

Run It

Start the server over stdio with the console script:

Terminal window
briefcase-mcp

Or run the module directly:

Terminal window
python -m briefcase.mcp

Build the Server in Python

build_server() returns a configured FastMCP instance, and main() runs it over stdio.

from briefcase.mcp import build_server
server = build_server()
print(server.name) # -> "briefcase"

Register in an MCP Client

Point an MCP-capable client at the briefcase-mcp command. The exact config file differs per tool, but the shape is the same:

{
"mcpServers": {
"briefcase": {
"command": "briefcase-mcp"
}
}
}

Tools

The server exposes four tools:

ToolWhat it doesAct
sanitize_textRedact PII from text before it leaves your environmentCapture
estimate_costEstimate the cost of a model callOperate
analyze_driftCheck a set of outputs for consistency and driftReplay & Verify
how_toRetrieve Briefcase usage guidance

sanitize_text

Redact PII (emails, phones, SSNs, cards, API keys, IPs) from text. Wraps briefcase.sanitize.Sanitizer.

InputType
textstr

Returns { "sanitized": str, "redactions": list[str] } — the redacted text and the PII types found.

sanitize_text("Contact me at jordan@example.com or 555-123-4567")
-> {"sanitized": "Contact me at [REDACTED_EMAIL] or [REDACTED_PHONE]",
"redactions": ["email", "phone"]}

estimate_cost

Estimate the USD cost of an LLM call. Wraps briefcase.cost.CostCalculator.

InputType
modelstr
input_tokensint
output_tokensint
rate_cardstr (optional)platform × tier pricing, e.g. "bedrock:batch"

Returns { "model": str, "rate_card": str, "input_cost": float, "output_cost": float, "cache_cost": float, "total_cost": float }.

estimate_cost("claude-haiku-4-5", 1000, 500)
-> {"model": "claude-haiku-4-5", "rate_card": "standard", "input_cost": 0.001,
"output_cost": 0.0025, "cache_cost": 0.0, "total_cost": 0.0035}

analyze_drift

Analyze a list of model outputs for consistency and drift. Wraps briefcase.drift.DriftCalculator.

InputType
outputslist[str]

Returns { "consistency_score": float, "agreement_rate": float, "consensus_output": str, "status": str }.

analyze_drift(["billing", "billing", "shipping"])
-> {"consistency_score": 0.67, "agreement_rate": 0.67,
"consensus_output": "billing", "status": "drifting"}

how_to

Return Briefcase usage guidance.

InputType
topicstr (optional)

Pass a topic keyword (e.g. "export", "sanitize", "cost", "logging") to get matching sections, or leave it empty for the full guide.

Resource

The server also exposes a resource, briefcase://llms-full.txt, which serves the bundled Briefcase usage guide for clients that read MCP resources.

Where this fits

These tools surface Briefcase capabilities to any MCP client. To go deeper on what each one does in the full SDK:

Next steps