Treasury Risk Analyzer
LocalAbout Treasury Risk Analyzer
Treasury Risk Analyzer is an MCP server offering deterministic financial analytics for AI Treasury and CFO agents. It covers risk, FX exposure, liquidity forecasts and payment decisions, with each paid call settled in USDC on Base.
Key features
- 01Calculate volatility, risk ratios, VaR and stress tests
- 02Analyze currency exposure and hedge priorities
- 03Forecast daily cash and liquidity buffers
- 04Return PAY, REVIEW or DO_NOT_PAY decisions
- 05Document deterministic methods and payment receipts
Use cases
- 01Assess portfolio risk and concentration
- 02Review foreign-exchange exposure and hedging priorities
- 03Forecast cash buffers before a payment
- 04Evaluate whether a supplied payment can be made today
MCP support
Exposes treasury risk, FX, liquidity and payment-decision tools to MCP clients. Calls to paid tools use per-call USDC payments on Base via x402.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y treasury-risk-mcpX402_PRIVATE_KEYSecretPrivate key of a dedicated Base wallet holding a few USDC, used to sign per-call x402 payments. Without it, paid tools only validate input and quote the price.MAX_PAYMENT_USDHard per-call spending cap in USD (default 2.00). Tools priced above it are refused before signing.TREASURY_API_URLOverride the service base URL (default: public production deployment).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
6Saved tool list · updated 1w ago
This tool takes no parameters.
Details
From the project READMEtreasury-risk-mcp
MCP server for the Treasury Risk Analyzer: deterministic financial decision services for AI Treasury and CFO agents. It covers treasury risk, FX exposure, the liquidity forecast, and one question: "Can we safely execute this payment today?"
Each call is paid in USDC on Base via x402. There is no account, no API key and no subscription. Your agent pays per call from its own wallet, and only when the input is valid.
Tools
| Tool | Price | What it answers |
|---|---|---|
describe_service | free | What the service does, its prices, and whether payments are configured |
get_example_input | free | A valid example input for any paid tool |
run_demo | free | Runs a paid tool on fixed sample data and returns its real, full output (default: can we pay a EUR 750,000 invoice today?) |
treasury_risk | $0.10 | Volatility, Sharpe/Sortino/Calmar, VaR/CVaR, HHI concentration, risk contribution, correlated stress tests |
fx_exposure | $0.25 | Gross/net exposure by currency, natural hedges, FX stress scenarios, hedge priority |
liquidity_forecast | $0.50 | Daily cash projection, minimum cash and its date, buffer breach, liquidity status, optional DSO/DPO/DIO |
treasury_decision | $2.00 | PAY / REVIEW / DO_NOT_PAY for a payment, combining liquidity, FX and risk, with a confidence score |
No LLM computes any figure: every metric is deterministic and documented in the response's methodology.
Install
Claude Desktop (claude_desktop_config.json), Cursor, or any MCP client:
{
"mcpServers": {
"treasury-risk": {
"command": "npx",
"args": ["-y", "treasury-risk-mcp"],
"env": {
"X402_PRIVATE_KEY": "0x…",
"MAX_PAYMENT_USD": "2.00"
}
}
}
}
Claude Code:
claude mcp add treasury-risk -e X402_PRIVATE_KEY=0x… -e MAX_PAYMENT_USD=2.00 -- npx -y treasury-risk-mcp
| Variable | Default | Meaning |
|---|---|---|
X402_PRIVATE_KEY | (none) | Private key of a Base wallet that holds USDC. Without it, paid tools only validate your input and return the price. |
MAX_PAYMENT_USD | 2.00 | Hard per-call cap. A tool priced above it is refused before anything is signed. |
TREASURY_API_URL | production URL | Override the service URL. |
Wallet safety: use a dedicated wallet that holds only a few USDC. The key stays in the MCP process on your machine. It is only used to sign an EIP-3009 USDC transfer for the exact price the service asks for, never more than MAX_PAYMENT_USD. No ETH is needed for gas, because the facilitator submits the transfer.
How payment works
- The tool sends your input to the API. Invalid input gets a free
400and you are never charged. - Valid input gets
402 Payment Requiredwith the price. - The server signs a USDC authorization for that price and retries.
- The payment settles on Base, and the analysis comes back with a
_paymentreceipt (transaction hash, payer, network).
Limits
- The output is analytics and decision support, not investment advice. It does not execute any payment.
- It only analyses the data you supply. It does not fetch market data.
- The HTTP API is also callable directly. Its OpenAPI spec is at
/openapi.yamland/openapi.json.
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.