About figuard-mcp
figuard-mcp connects FiGuard spending controls to AI assistants, for teams that want to authorize agent expenses without writing SDK code. Its tools cover budget setup, pre-flight authorization, settlement, and delegation-token management.
Key features
- 01Create and manage spending budgets
- 02Authorize spend with a reasoned decision
- 03Confirm, fail, or void reservations
- 04Inspect budgets and filtered ledgers
- 05Manage scoped delegation tokens
Use cases
- 01Create a budget for an agent's trip expenses
- 02Check a proposed purchase before payment
- 03Reconcile actual charges or release failed reservations
- 04Set per-agent spending caps with delegation tokens
MCP support
figuard-mcp exposes 14 FiGuard tools to MCP clients, including budget, authorization, ledger, and delegation operations. It connects to a running FiGuard server using configured API key and base URL.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y figuard-mcpFIGUARD_API_KEYSecretFiGuard API key — set this (with FIGUARD_BASE_URL) to use a self-hosted FiGuard server. Leave unset to run embedded: in-process enforcement against a local SQLite file, no account or server needed.FIGUARD_BASE_URLSelf-hosted FiGuard server URL. Leave unset to run embedded against a local SQLite file.FIGUARD_DATABASEPath to the embedded SQLite file (default ~/.figuard/figuard.db). Embedded is the default backend — no server required.FIGUARD_MODEBackend mode: embedded | server | sandbox. Defaults to embedded when nothing else is configured.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
16Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| unit | string | No | Resource unit label (e.g. 'tokens', 'api_calls'). Required for resource budgets. Omit for monetary budgets. |
| user_id | string | Yes | Identifier for the user or agent session this budget belongs to. |
| currency | string | No | ISO 4217 currency code (e.g. 'USD', 'EUR'). Required for monetary budgets. Omit for resource budgets. |
| expires_in | string | No | How long the budget is valid. Accepts '24h', '7d', '30m', or a number of seconds. Defaults to '24h'. |
| allocations | array | No | Optional category-level caps. Each allocation is an independent maximum — flights capped at $300 means flights can never exceed $300, regardless of what other categories spend. Allocation limits must not exceed total_limit but do not need to sum to it — the remainder is a shared pool. Example: total_limit=1000, allocations=[{flights: 500}, {hotels: 200}] — valid, $300 remains as unallocated headroom. |
| total_limit | number | Yes | Maximum total amount the agent is allowed to spend. For USD budgets this is dollars, not cents. |
| intent_context | string | No | Optional human-readable description of what this budget is for (e.g. 'Book travel to NYC for user_123'). |
| external_reference | string | No | Optional stable identifier for this budget (e.g. 'run-abc-123', 'order-456'). When provided, re-calling figuard_create_budget with the same external_reference returns the existing live budget instead of creating a duplicate — safe for orchestrator restarts. |
| velocity_max_per_day | number | No | Max authorize attempts per rolling 24-hour window. |
| auto_pause_on_anomaly | boolean | No | Controls anomaly response mode. When true (default), an anomalous request pauses the budget — no further spend until a human resumes it. When false (advisory mode), the anomalous request is still denied and ANOMALY_DETECTED webhook fires, but the budget stays ACTIVE. Use false for high-throughput agents where a single spike should not halt the entire fleet. |
| velocity_max_per_minute | number | No | Max authorize attempts per rolling 1-minute window. Denied with VELOCITY_LIMIT_EXCEEDED when exceeded. |
| anomaly_detection_enabled | boolean | No | When true, FiGuard monitors spend requests for statistical anomalies. Recommended for production. |
| velocity_max_amount_per_hour | number | No | Max total requestedQuantity per rolling 1-hour window. |
Details
From the project READMEfiguard-mcp
FiGuard MCP server — use FiGuard directly from Claude Code, Cursor, or Claude Desktop without writing any SDK code.
What this does
Adds 14 FiGuard tools to your AI assistant. Instead of writing SDK code, you just talk to Claude:
"Create a $500 travel budget with $300 for flights and $200 for hotels" → Claude calls
figuard_create_budget
"Authorize a $149 economy flight from this budget" → Claude calls
figuard_authorize→ returns AUTHORIZED or DENIED
"The flight ended up costing $147 — confirm the actual amount" → Claude calls
figuard_confirm
Requirements
- Node.js 18+
- A running FiGuard server (local or sandbox)
Setup
Claude Code
claude mcp add figuard-mcp \
--env FIGUARD_API_KEY=fg_live_... \
--env FIGUARD_BASE_URL=http://localhost:8080
Or add to ~/.claude/claude_desktop_config.json manually:
{
"mcpServers": {
"figuard": {
"command": "npx",
"args": ["figuard-mcp"],
"env": {
"FIGUARD_API_KEY": "fg_live_...",
"FIGUARD_BASE_URL": "http://localhost:8080"
}
}
}
}
Cursor
Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"figuard": {
"command": "npx",
"args": ["figuard-mcp"],
"env": {
"FIGUARD_API_KEY": "fg_live_...",
"FIGUARD_BASE_URL": "http://localhost:8080"
}
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"figuard": {
"command": "npx",
"args": ["figuard-mcp"],
"env": {
"FIGUARD_API_KEY": "fg_live_...",
"FIGUARD_BASE_URL": "http://localhost:8080"
}
}
}
}
Using the sandbox (no Docker required)
Point FIGUARD_BASE_URL at the hosted sandbox to try FiGuard without running a local server:
{
"FIGUARD_API_KEY": "sb_live_demo",
"FIGUARD_BASE_URL": "https://figuard-sandbox-g1ha.onrender.com"
}
Available tools
| Tool | What it does |
|---|---|
figuard_create_budget | Create a spending envelope; returns session_token |
figuard_authorize | Pre-flight check — AUTHORIZED or DENIED with reason |
figuard_confirm | Close a reservation with the actual amount after success |
figuard_fail | Release a reservation when the action fails |
figuard_void | Cancel an unused reservation |
figuard_get_budget | Check budget status, spent, reserved, available |
figuard_get_ledger | List all spend events with filtering |
figuard_resume_budget | Unfreeze a budget paused by anomaly detection |
figuard_extend_budget | Extend a budget's expiry time |
figuard_cancel_batch | Cancel up to 100 budgets in one call |
figuard_fund_budget | Adjust a budget's total limit (CREDIT / DEBIT / RESET / RESET_SPENT) |
figuard_create_delegation_token | Create a scoped per-agent token against a fleet budget |
figuard_revoke_delegation_token | Revoke a delegation token (idempotent) |
figuard_get_delegation_token | Check delegation token state and cap usage |
Security note
FIGUARD_API_KEY is configured as an environment variable, not a tool argument. Tool arguments appear in LLM context windows — API keys must never be passed as tool parameters.
Session tokens returned by figuard_create_budget are short-lived (they expire with the budget) and are safe to use as tool arguments within a session.
Running FiGuard locally
git clone https://github.com/figuard/figuard-core
cd figuard-core
docker compose up -d
FiGuard will be available at http://localhost:8080.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.