Skip to main content
Glama
Loan & Risk Assessment MCP Server

Loan & Risk Assessment MCP Server

by iife-robbie

loan-risk-mcp

demo project only. no production credit risk logic

Loan & Risk Assessment MCP Server

A small Model Context Protocol (MCP) server built for a Digital Banking Assistant Copilot Studio agent. It exposes three tools the agent can call when it needs real computation instead of guessing:

Tool

Purpose

calculate_dti

Debt-to-Income ratio + eligibility band

amortization_schedule

Monthly payment + total interest for a loan

flag_risk_factors

Explainable, rules-based risk score with reasons

Disclaimer: This is a portfolio/demo project. The risk logic is a transparent toy rule set, not a real credit model. Any production use would require fair-lending, compliance, and model-risk review.

Architecture

User ── chats with ──▶ Copilot Studio Agent ("Digital Banking Assistant")
                              │
                              │  calls tool over MCP (Streamable HTTP)
                              ▼
                    Loan & Risk Assessment MCP Server (this repo)
                              │
                              ▼
                 Plain-language result returned into the conversation

The MCP server is a tool the agent reaches for mid-conversation — it's part of the same Digital Banking Assistant project, not a separate demo.

Related MCP server: fed-aura-risk-mcp

Project structure

loan-risk-mcp/
├── server.py         # The MCP server + 3 tools
├── test_tools.py      # Direct unit tests of the tool logic
├── requirements.txt    # Pinned dependency versions
└── README.md

Setup

python3 -m venv venv
source venv/bin/activate        # venv\Scripts\activate on Windows
pip install -r requirements.txt

Testing the logic

Run the tool functions directly (no MCP transport involved) to confirm the math is right before wiring anything up:

python test_tools.py

Running the server

Local / stdio (for local MCP clients, e.g. Claude Desktop, MCP Inspector):

python server.py

HTTP (required for a cloud client like Copilot Studio to reach it):

python server.py --http --port 8000

You can sanity-check the HTTP server with the official MCP Inspector:

npx @modelcontextprotocol/inspector
# then point it at http://localhost:8000/mcp

Example call and response

Request: calculate_dti(monthly_income=5000, monthly_debts=1000)

{
  "dti_ratio_percent": 20.0,
  "band": "good",
  "explanation": "DTI of 20.0% is at or below the common 35% affordability threshold. Generally considered healthy."
}

Notes

  • This demonstrates pro-code (Python MCP server) + low-code (Copilot Studio topics) working together — the direction the platform is actively moving toward with connected agents and MCP.

  • The risk tool is deliberately rules-based and explainable rather than a black-box ML score, which mirrors how banks actually need AI outputs to be auditable.

  • Call out clearly in interviews that this is a demo: real underwriting logic requires far more rigor, data, and compliance sign-off.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to assess credit default risk, run what-if scenarios, and evaluate portfolios through natural language, backed by an explainable XGBoost model.
      -
    • F
      license
      A
      quality
      C
      maintenance
      Enables mortgage risk assessment and underwriting by calculating DTI, LTV, credit risk, income stability, and asset sufficiency, and by aggregating these factors into a loan recommendation with conditions and compensating factors.
      6
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to retrieve verbatim U.S. mortgage regulations with citations and effective dates, verify quotes, and run guided compliance playbooks without sending user documents to the server.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables voice-driven loan coaching by explaining the true yearly cost of a loan offer, checking whether a payment fits a saved budget, and storing loans and repayments so progress can be tracked across conversations. It also records income and expenses, asks follow-up questions when details like the interest type are missing, and returns short money lessons with quiz questions.
      1
      MIT