Skip to main content
Glama
presidio-v

presidio-hardened-x402-mcp

by presidio-v

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PRESIDIO_X402_MCP_MODENoMode: 'regex' (zero-setup) or 'nlp' (needs [nlp] extra + spaCy model).regex
PRESIDIO_X402_CHAIN_KEYNo32-byte hex key for cross-process audit-chain HMAC.unset (per-process)
PRESIDIO_X402_MCP_AGENT_IDNoLabel written into audit records.unset
PRESIDIO_X402_MCP_LOG_LEVELNoLog level: DEBUG / INFO / WARNING / ERROR.INFO
PRESIDIO_X402_MCP_REDIS_URLNoUse Redis for replay state instead of in-memory.unset
PRESIDIO_X402_MCP_AUDIT_PATHNoAppend-only JSON-L audit log path; omit to disable.unset
PRESIDIO_X402_MCP_REPLAY_TTLNoFingerprint cache TTL (seconds).300
PRESIDIO_X402_FINGERPRINT_KEYNo32-byte hex key for cross-process replay detection.unset (per-process)
PRESIDIO_X402_REQUIRE_CHAIN_KEYNoFail startup if audit-chain key is absent or invalid.unset
PRESIDIO_X402_MCP_REMOTE_API_KEYNoAPI key for the remote screening service.unset
PRESIDIO_X402_MCP_WINDOW_SECONDSNoRolling window for the daily limit.86400
PRESIDIO_X402_MCP_DAILY_LIMIT_USDNoMax USD per rolling window (policy gate).unset
PRESIDIO_X402_MCP_REMOTE_BASE_URLNoEnable HTTP-proxy mode for tool 1 — see Modes.unset
PRESIDIO_X402_MCP_MAX_PER_CALL_USDNoMax USD per single payment (policy gate).unset
PRESIDIO_X402_MCP_PER_ENDPOINT_JSONNoPer-endpoint cap, e.g. '{"api.foo.com": 5.00}'.unset
PRESIDIO_X402_REQUIRE_FINGERPRINT_KEYNoFail startup if replay key is absent or invalid.unset

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
screen_payment_metadataA

Screen x402 payment metadata for PII before signing the payment.

Call BEFORE sending the payment request. Detects emails, phone numbers, SSNs, names, and other PII in the resource URL, description, and reason fields and returns redacted strings plus per-field entity counts.

No side effects.

Runs in one of two modes:

  • in_process (default): wraps the local presidio_x402 PIIFilter.

  • remote: when both PRESIDIO_X402_MCP_REMOTE_BASE_URL and ..._REMOTE_API_KEY are set, POSTs to /v1/screen on that host for centralized audit. On remote failure, returns a structured error dict instead of silently falling back — the caller must decide whether to retry, accept reduced screening, or abort.

Args: resource_url: x402 resource URL the agent is about to pay (max 2048 chars). description: Human-readable description (max 4096 chars). reason: Reason / memo string (max 4096 chars). entities: Optional whitelist of Presidio entity types to detect. If None, all configured entities are scanned.

Returns: On success: dict with keys redacted_resource_url, redacted_description, redacted_reason, entities_found (list of {entity_type, field, count}), and mode (one of "in_process", "remote"). On remote failure: dict with keys error (one of "auth_error", "rate_limit", "unavailable"), detail, optional retry_after (for rate_limit), and mode ("remote").

check_payment_policyA

Check whether a payment is allowed by the configured spending policy.

WARNING: this records the spend against rolling time-window ledgers. Call exactly once, immediately before submitting the payment. If you call this and then do not pay, the spend window will be inflated until it rolls over.

Configure limits at server startup via PRESIDIO_X402_MCP_* env vars.

Args: resource_url: x402 resource URL being paid (used for per-endpoint limits). amount_usd: Payment amount in USD-equivalent.

Returns: {"allowed": true} on success, or {"allowed": false, "reason": str, "limit_usd": float, "amount_usd": float}.

check_payment_replayA

Check whether this exact payment has been seen recently (replay protection).

WARNING: this records the fingerprint. Call exactly once, immediately before submitting the payment.

Cross-process detection requires PRESIDIO_X402_FINGERPRINT_KEY (and optionally PRESIDIO_X402_MCP_REDIS_URL); otherwise each MCP server process has its own ephemeral in-memory store.

Args: resource_url: x402 resource URL. pay_to: Recipient address. amount: Amount as string (preserves precision). currency: Currency symbol (e.g. "USDC"). deadline_seconds: Payment deadline as epoch seconds.

Returns: {"is_replay": false, "fingerprint": ""} on first seen, or {"is_replay": true, "fingerprint": ""} on duplicate.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/presidio-v/presidio-hardened-x402-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server