Skip to main content
Glama
fed-aura-risk-mcp

fed-aura-risk-mcp

by rdwj

Risk Assessment MCP Server

A mortgage risk underwriting server built on FastMCP 3.x that exposes individual risk calculation tools and an aggregation tool for producing loan recommendations. Built from the FastMCP server template.

Tools

Tool

Description

calculate_dti

Debt-to-Income ratio from monthly income and debts

calculate_ltv

Loan-to-Value ratio from loan amount and property value

evaluate_credit_risk

Credit risk rating from borrower credit score

assess_income_stability

Income stability from employment statuses of all borrowers

assess_asset_sufficiency

Asset reserve adequacy relative to loan amount

generate_risk_recommendation

Aggregator: combines all risk factors into Approve / Approve with Conditions / Suspend / Deny

calculate_dti

Computes the Debt-to-Income ratio as a percentage. Rates Low below 36%, Medium at 36--43%, High above 43%.

Parameters: monthly_income (float), monthly_debts (float)

Returns: JSON with metric, value, rating, guidance.

{"monthly_income": 8000, "monthly_debts": 2400}

calculate_ltv

Computes the Loan-to-Value ratio as a percentage. Rates Low below 60%, Medium at 60--80%, High above 80%. Includes pmi_required flag.

Parameters: loan_amount (float), property_value (float)

Returns: JSON with metric, value, rating, guidance, pmi_required.

{"loan_amount": 320000, "property_value": 400000}

evaluate_credit_risk

Evaluates credit risk from a FICO-range score (300--850). Rates Low above 680, Medium at 620--680, High below 620.

Parameters: credit_score (int), source (str, default "self_reported")

Returns: JSON with metric, value, rating, guidance, source.

{"credit_score": 720, "source": "experian"}

assess_income_stability

Takes a list of employment statuses for all borrowers and returns the worst-case rating. Valid statuses: w2_employee, self_employed, retired, unemployed, other.

Parameters: employment_statuses (list of strings)

Returns: JSON with metric, statuses, rating, guidance, individual_ratings.

{"employment_statuses": ["w2_employee", "self_employed"]}

assess_asset_sufficiency

Checks asset reserves as a percentage of the loan amount. Rates Low above 20%, Medium at 10--20%, High below 10%.

Parameters: total_assets (float), loan_amount (float)

Returns: JSON with metric, value, rating, guidance.

{"total_assets": 90000, "loan_amount": 350000}

generate_risk_recommendation

Aggregates all five risk assessments plus document status and optional ML predictions into a final underwriting decision. The decision logic applies deny triggers (DTI > 55%, credit < 580, LTV > 97%, all borrowers unemployed), suspend triggers (missing documents), and conditional triggers (PMI, elevated DTI, self-employment documentation). Compensating factors such as strong credit offsetting high DTI are also considered.

Parameters: dti_value, dti_rating, ltv_value, ltv_rating, credit_score, credit_rating, income_rating, asset_rating, employment_statuses, has_financial_docs, has_credit_report, document_count, ml_prediction (optional), ml_confidence (optional)

Returns: JSON with recommendation, rationale, conditions, compensating_factors, overall_risk, warnings, risk_summary.

{
  "dti_value": 38.5, "dti_rating": "Medium",
  "ltv_value": 75.0, "ltv_rating": "Medium",
  "credit_score": 720, "credit_rating": "Low",
  "income_rating": "Low", "asset_rating": "Low",
  "employment_statuses": ["w2_employee"],
  "has_financial_docs": true,
  "has_credit_report": true,
  "document_count": 5
}

Related MCP server: MCP Mortgage Server

Quick Start

Local Development

make install
make run-local

# In another terminal, test with cmcp
cmcp ".venv/bin/python -m src.main" tools/list
cmcp ".venv/bin/python -m src.main" tools/call calculate_dti '{"monthly_income": 8000, "monthly_debts": 2400}'

Deploy to OpenShift

make deploy PROJECT=mcp-risk-server

The server is deployed at: https://mcp-server-mcp-risk-server.apps.cluster-z9hbt.z9hbt.sandbox1495.opentlc.com/mcp/

Testing

# Run all 53 tests
make test

# Run a single test file
.venv/bin/pytest tests/test_risk_calculations.py -v

# Test against local STDIO server with cmcp
make test-local

Architecture

The server uses FastMCP 3.x with FileSystemProvider for automatic tool discovery. Tools use standalone @tool decorators (no shared server instance). The server runs in STDIO mode locally and uses streamable-http transport on port 8080 when deployed to OpenShift.

Tool source lives in two files under src/tools/: risk_calculations.py (five calculation tools) and risk_recommendation.py (the aggregation tool). The recommendation logic is factored into a pure compute_recommendation() function for direct use in tests.

Environment Variables

Variable

Default

Purpose

MCP_TRANSPORT

stdio

Transport mode: stdio or http

MCP_HTTP_HOST

127.0.0.1

HTTP bind address

MCP_HTTP_PORT

8000

HTTP port

MCP_HTTP_PATH

/mcp/

HTTP endpoint path

MCP_LOG_LEVEL

INFO

Logging level

MCP_HOT_RELOAD

0

Enable hot-reload for development

MCP_SERVER_NAME

fastmcp-unified

Server name in MCP responses

MCP_AUTH_JWT_ALG

(none)

JWT algorithm (e.g., RS256). Auth disabled if unset

MCP_AUTH_JWT_SECRET

(none)

Shared secret for HMAC algorithms

MCP_AUTH_JWT_PUBLIC_KEY

(none)

Public key for RSA/EC algorithms

MCP_AUTH_JWT_JWKS_URI

(none)

JWKS endpoint URL

MCP_AUTH_JWT_ISSUER

(none)

Expected token issuer

MCP_AUTH_JWT_AUDIENCE

(none)

Expected token audience

MCP_AUTH_REQUIRED_SCOPES

(none)

Comma-separated default required scopes

License

This project is licensed under the MIT License. See the LICENSE file for details.

Available Tools

6 tools
assess_asset_sufficiencyAssess Asset SufficiencyA
Read-onlyIdempotent

Assess whether the borrower has sufficient asset reserves relative to the loan amount.

Inputs: loan_amount (required), total_assets (required). Returns: result

assess_income_stabilityAssess Income StabilityA
Read-onlyIdempotent

Assess income stability risk based on borrower employment statuses.

Inputs: employment_statuses (required). Returns: result

calculate_dtiCalculate DtiA
Read-onlyIdempotent

Calculate the Debt-to-Income (DTI) ratio for mortgage risk assessment.

Inputs: monthly_debts (required), monthly_income (required). Returns: result

calculate_ltvCalculate LtvB
Read-onlyIdempotent

Calculate the Loan-to-Value (LTV) ratio for mortgage risk assessment.

Inputs: loan_amount (required), property_value (required). Returns: result

evaluate_credit_riskEvaluate Credit RiskB
Read-onlyIdempotent

Evaluate credit risk based on the borrower's credit score.

Inputs: credit_score (required), source. Returns: result

generate_risk_recommendationGenerate Risk RecommendationA
Read-onlyIdempotent

Generate a comprehensive risk recommendation based on all assessment factors.

This aggregator tool combines individual risk assessments (DTI, LTV, credit, income stability, asset sufficiency) to produce a final recommendation: Approve, Approve with Conditions, Suspend, or Deny.

Inputs: dti_value (required), ltv_value (required), dti_rating (required), ltv_rating (required), +10 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct risk factor or calculation: DTI, LTV, credit, income stability, asset sufficiency, and final recommendation. There is no meaningful overlap between tool purposes.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern: calculate_, assess_, evaluate_, generate_. This makes the set predictable and easy to navigate.

    Tool Count5/5

    Six tools is well-scoped for a mortgage risk assessment server, covering individual risk factors and an aggregator without unnecessary redundancy.

    Completeness5/5

    The tool set covers the full stated workflow: calculating key ratios, assessing borrower risks, evaluating credit, and producing a final recommendation. There are no obvious dead ends or missing critical operations.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables creditworthiness analysis for non-traditional borrowers using rule-based scoring, financial behavior assessment, and underwriting report generation via MCP tools.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to parse and analyze mortgage documents (Loan Estimates & Closing Disclosures), converting them into structured MISMO-compliant JSON and checking for TRID compliance violations.
      2
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables a Digital Banking Assistant to calculate debt-to-income ratios, generate amortization schedules, and flag explainable, rules-based risk factors during conversations.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables agents to analyze contract excerpts and receive calibrated risk annotations across 10 default risk classes, including presence probabilities, overall risk levels, and human review recommendations.
      1
      MIT