risk-analytics-mcp-server

risk-analytics-mcp-server

Provides AI agents with quantitative risk tools such as VaR, expected shortfall, GARCH volatility, backtesting, stress testing, tail risk analysis, and credit scoring using synthetic or user-supplied data.

Category
Visit Server

README

risk-analytics-mcp-server

An MCP server that gives AI agents quantitative risk tools.

Any MCP client (Claude Code, Claude Desktop, or your own agent) gets seven tools backed by two real engines — market-risk-engine and credit-risk-model:

Tool What it does
compute_var_es Portfolio VaR & Expected Shortfall four ways — historical, parametric-normal, Cornish-Fisher, Monte Carlo — so the agent can compare methods, not just get a number.
garch_volatility GARCH(1,1) fit by maximum likelihood (no arch dependency) + mean-reverting h-day vol forecast.
backtest_var Walk-forward VaR backtest with Kupiec POF, Christoffersen independence / conditional-coverage tests, and the Basel traffic-light zone.
stress_test Preset crisis-shock library (GFC equity crash, 2020 pandemic, +200bp rates, flight to quality, USD squeeze) + the portfolio's own worst historical windows.
evt_tail_risk Peaks-over-threshold GPD tail fit; EVT VaR/ES for the 99.5%+ region where empirical quantiles run out of data.
score_credit_application 12-month PD, scorecard points and letter rating from a WoE logistic scorecard (PDO points scaling).
credit_model_summary The scorecard's held-out AUROC/Gini/KS and per-feature Information Values.

Every market tool works with no data at all — omit the returns and it runs on a seeded 4-asset synthetic demo book (EQUITY/BOND/GOLD/FX, ~5 trading years), so an agent can explore the tools fully offline. Pass your own daily returns (fractions, 0.01 = 1%) to analyze a real portfolio. VaR/ES are reported as positive daily loss fractions.

The credit scorecard is trained once per process on the engine's seeded synthetic 12k-loan book and cached; the methodology (monotonic WoE binning, logistic regression, points scaling, ratings) is the production pattern, the score itself is a demo.

Install & connect

pip install git+https://github.com/chenxi-bot21/risk-analytics-mcp-server.git

Claude Code:

claude mcp add risk -- risk-mcp

Claude Desktop / any MCP client (stdio transport):

{
  "mcpServers": {
    "risk": { "command": "risk-mcp" }
  }
}

Or without installing, via uv:

{
  "mcpServers": {
    "risk": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/chenxi-bot21/risk-analytics-mcp-server.git", "risk-mcp"]
    }
  }
}

Example prompts once connected

  • "What's the 99% VaR of a portfolio that's 60% equity, 30% bonds, 10% gold? Compare methods — do the tails look fat?"
  • "Backtest a 99% historical VaR on these returns and tell me which Basel zone it lands in." (paste returns)
  • "Score this applicant: 24 years old, $25k income, $30k loan at 26%, DTI 42, utilization 130%, 4 delinquencies…"

Architecture

src/risk_mcp/
├── market.py   # JSON-friendly wrappers around marketrisk (pure functions)
├── credit.py   # cached synthetic-trained WoE scorecard + scoring
└── server.py   # FastMCP registration shim — no logic of its own

The wrappers are plain functions with plain-type signatures, so the whole surface is unit-tested (19 tests) without a running server; one test drives a tool through the actual MCP protocol layer.

python -m unittest discover -s tests -t .

License

MIT.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured