Risk Calculation

v1.3.1
io.github.mselcukozturk/risk-calculation Checked 1 hour ago Published 8 days ago

Local IRB and standardised credit risk weights, RWA and capital under EU CRR/CRR3 and BDDK.

Free, local credit-risk calculations for MCP clients. IRB and standardised risk weights, risk-weighted assets (RWA), and the 8% capital requirement under EU CRR/CRR3 and Turkish BDDK current/draft rules. Calculations use the same public core as rwacalculator.io. The publisher does not operate a public MCP endpoint. Run it on your computer or your own server. No accounts, API keys, model API, telemetry, storage, or outbound network requests are used during calculation.

Summary extracted from the README.

Risk Calculation MCP

Free, local credit-risk calculations for MCP clients. IRB and standardised risk weights, risk-weighted assets (RWA), and the 8% capital requirement under EU CRR/CRR3 and Turkish BDDK current/draft rules. Calculations use the same public core as rwacalculator.io.

The publisher does not operate a public MCP endpoint. Run it on your computer or your own server. No accounts, API keys, model API, telemetry, storage, or outbound network requests are used during calculation. Your AI application has its own data handling policies; local MCP execution does not mean your conversation stays on your computer.

Install

Requires Node.js 20 or later. Standard MCP configuration for Claude Desktop, Cursor, VS Code and other clients supporting stdio:

{
  "mcpServers": {
    "risk-calculation": {
      "command": "npx",
      "args": ["-y", "risk-calculation-mcp@1.1.0"]
    }
  }
}

The first npx run downloads the package and dependencies from npm. Pin the version for repeatable calculations. To avoid downloads at each client startup, install it once with npm install -g risk-calculation-mcp@1.1.0 and use risk-calculation-mcp as the command. If the client cannot find Node or npx, use the full path to the executable.

Claude Code:

claude mcp add --transport stdio risk-calculation -- npx -y risk-calculation-mcp@1.1.0

Codex:

codex mcp add risk-calculation -- npx -y risk-calculation-mcp@1.1.0

A Claude Desktop .mcpb installer is available from the installation page. The bundle includes dependencies; the host application supplies the Node runtime.

Tools

  • get_risk_capabilities: supported rule books, classes, input units and limitations.
  • calculate_irb: single non-defaulted corporate, corporate SME, mortgage, qualifying revolving retail or other retail exposure; effective floors, correlation, RWA and capital.
  • calculate_standardised: 18 exposure classes in modern rules and the supported subset in legacy rules; CCF, rule reference, RWA, capital and informational output floor rate.

Both calculation tools require an explicit regime: crr (EU before 2025), crr3 (EU from 2025), bddk (current Turkish rules), or bddkDraft (draft, not current law). This convention is identical across both tools. Language never selects jurisdiction.

PD, LGD, LTV, CCF and risk weights use percentage points: pd: 1 means 1%, not 0.01%. Amounts are currency units (0–1e15), maturity is years (1–5; corporate default 2.5), annualSales is millions of EUR for EU or TRY for BDDK. Article 501 smeTotal is always EUR, separate from exposure currency. No FX conversion is performed.

Example call to calculate_irb:

{
  "regime": "crr3",
  "exposureClass": "corporate",
  "pd": 1,
  "lgd": 40,
  "maturity": 2.5,
  "ead": 1000000,
  "currency": "EUR"
}

Risk weight is approximately 82.06%. Results include supplied and effective inputs, rule-book status, sources, warnings and links to the matching calculator. Monetary results remain null when no amount is given. The 8% capital figure excludes buffers and institution-specific requirements.

Standardised example:

{
  "regime": "crr3",
  "exposureClass": "corporate",
  "rating": "3",
  "year": 2026,
  "item": "commitment",
  "amount": 1000000,
  "currency": "EUR"
}

Risk weight 75%, CCF 40%, exposure value EUR 400,000, RWA EUR 300,000, capital EUR 24,000. Inspect the tool schema for class-specific fields. Missing material facts produce a tool error; preferential eligibility is never inferred. Corporate SME IRB requires annualSales; BDDK draft additionally requires smeLimit in TRY millions. Current BDDK uses C=1000 million TRY, EU uses EUR 50 million. Those limits are versioned assumptions, not live regulatory data.

Your own HTTP server

npx -y risk-calculation-mcp@1.1.0 --http

This serves stateless Streamable HTTP at http://127.0.0.1:3000/mcp. Set PORT to change the port. It accepts modern and legacy MCP clients. It binds to loopback and validates Host and browser Origin headers. There is no built-in authentication. For remote use, put it behind your own HTTPS reverse proxy with access controls, preserve the backend Host as 127.0.0.1:3000, and reject cross-origin browser requests at the proxy. Do not forward arbitrary browser Origin values as trusted. The publisher provides no hosted URL.

Scope and evidence

The supported domain is currently credit risk. Market, operational, liquidity and other risk domains are not implemented. New tools can be added in later releases. This is an indicative single-exposure calculator, not a bank's approved model, regulatory reporting system, credit decision or investment recommendation.

IRB excludes PD=100%, financial-sector 1.25 multipliers, double default, corporate/secured other-retail CRR3 LGD floors and portfolio LGD floors. Standardised calculations exclude credit risk mitigation, prior liens, SCRA sovereign floors, due-diligence adjustments and unimplemented national options. Bank-level output floors are not applied to individual exposures. Preferential conditions must be confirmed by the user.

Sources: EU CRR, CRR3 amendments, BDDK regulations. The formulas approximate the normal distribution, as documented on the website.

Verification is performed against independently calculated examples and through clean package installation with the official MCP client over stdio and HTTP. No bank-internal core, customer data or private repository files are distributed.

Methodology and limits · Privacy · Support

MIT licensed. Published by IRB Risk Weight Calculator.