Risk Calculation MCP
README.md
# 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](https://rwacalculator.io/risk-mcp). Source:
[github.com/mselcukozturk/risk-calculation-mcp](https://github.com/mselcukozturk/risk-calculation-mcp).
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:
```json
{
"mcpServers": {
"risk-calculation": {
"command": "npx",
"args": ["-y", "risk-calculation-mcp@1.2.1"]
}
}
}
```
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.2.1` 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:
```sh
claude mcp add --transport stdio risk-calculation -- npx -y risk-calculation-mcp@1.2.1
```
Codex:
```sh
codex mcp add risk-calculation -- npx -y risk-calculation-mcp@1.2.1
```
A Claude Desktop `.mcpb` installer is available from the
[installation page](https://rwacalculator.io/risk-mcp). 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.
Under CRR3 and the BDDK draft, `calculate_irb` floors own LGD estimates at the unsecured
values: 25% corporate, 5% residential mortgage, 50% qualifying revolving retail and 30%
other retail. Set `foundation: true` for a corporate foundation-approach exposure: pass
the supervisory LGD (40%, 45% or 75% under CRR3, 45% or 75% before) or an LGD* that
already reflects eligible collateral; the own-estimate floors are then not applied and
LGD* is not computed. `qrreTransactor: true` selects the CRR3 0.05% PD floor for a
QRRE transactor instead of 0.10%. Neither is inferred.
Example call to `calculate_irb`:
```json
{
"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:
```json
{
"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
```sh
npx -y risk-calculation-mcp@1.2.1 --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, collateral-specific
CRR3 LGD floors for secured corporate and other retail exposures, foundation-approach
collateral haircuts 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](https://eur-lex.europa.eu/eli/reg/2013/575/oj),
[CRR3 amendments](https://eur-lex.europa.eu/eli/reg/2024/1623/oj),
[BDDK regulations](https://www.bddk.org.tr/Mevzuat/Liste/132).
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](https://rwacalculator.io/about) ·
[Privacy](https://rwacalculator.io/privacy) · [Support](https://rwacalculator.io/contact)
MIT licensed. Published by IRB Risk Weight Calculator.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues