Skip to main content
Glama
Loan MCP Server

Loan MCP Server

by Yogeshwara7

Loan MCP Server

A Model Context Protocol (MCP) server that exposes read and analytics tools for a Loan Management System backed by Microsoft Dataverse. It can be consumed by MCP clients (Claude Desktop, Copilot Studio) over stdio or HTTP, and includes an optional WhatsApp assistant.

Features

  • 12 loan tools: lookups, search, timeline, eligibility, officer workload and portfolio analytics.

  • Two transports: stdio (Claude Desktop) and Streamable HTTP (Copilot Studio / remote clients), JSON-RPC 2.0.

  • Optional WhatsApp assistant via Twilio + an LLM.

  • Microsoft Entra ID authentication (client credentials); Dataverse Web API v9.2.

  • TypeScript, Node.js 22+, structured logging, typed error handling.

Related MCP server: dataverse-mcp-server

Tools

Tool

Input

Description

GetLoanSummary

referenceNumber

Full loan summary

GetLoanStatus

referenceNumber

Status, eligibility, officer, review flag

SearchLoansByPhone

phoneNumber

Loans for a phone number

GetApplicantHistory

applicantEmail

Applications for an applicant

TrackLoanTimeline

referenceNumber

Milestone timeline

ExplainEligibility

referenceNumber

Eligibility explanation

GetRequiredDocuments

loanType

Required document checklist

ListPendingReviews

–

Loans under manual review

GetOfficerWorkload

officerName

An officer's assigned loans and workload

SearchLoansByStatus

status

Loans by status

SearchLoansByOfficer

officerName

Loans assigned to an officer

GetLoanAnalytics

–

Portfolio totals and amount statistics

Prerequisites

  • Node.js 22 or later

  • A Microsoft Dataverse environment

  • An Entra ID app registration with a corresponding Dataverse application user (Read access to the loan table)

Getting started

npm install
cp .env.example .env   # then fill in the required values
npm run build
npm start              # HTTP server (dist/http.js)

For local development with reload:

npm run dev:http       # HTTP
npm run dev            # stdio

Configuration

Set these in .env (local) or as environment variables / Azure App settings (hosted).

Required

Variable

Description

TENANT_ID

Entra ID directory (tenant) ID

CLIENT_ID

App registration (client) ID

CLIENT_SECRET

Client secret value

DATAVERSE_URL

e.g. https://yourorg.crm.dynamics.com

Common optional (defaults in parentheses)

Variable

Description

MCP_API_KEY

Shared secret for the HTTP endpoint (x-api-key). Strongly recommended when exposed.

DATAVERSE_LOAN_TABLE

Loan entity set name (cr174_loanapplics)

HTTP_PORT / HTTP_HOST

Listen port/host (PORT or 3000 / 0.0.0.0)

LOG_LEVEL

info

See .env.example for the full list, including the WhatsApp settings below.

Usage

The server is transport-only; a client drives the tools.

  • Claude Desktop (stdio): point an mcpServers entry at node dist/index.js (or npm run start:stdio).

  • Copilot Studio / remote (HTTP): add an MCP tool at https://<host>/mcp with API-key auth (header x-api-key).

GET /healthz returns liveness and WhatsApp status.

WhatsApp (optional)

Lets users query loans over WhatsApp. Enabled only when HUGGINGFACE_API_KEY and the TWILIO_* variables are set.

  1. Set HUGGINGFACE_API_KEY (or another OpenAI-compatible endpoint via LLM_BASE_URL / LLM_MODEL).

  2. Create a Twilio WhatsApp Sandbox; set TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_WHATSAPP_FROM.

  3. In the sandbox settings, set the inbound webhook to https://<host>/whatsapp (POST).

  4. Set TWILIO_VALIDATE_SIGNATURE=true once the URL is stable.

Deployment

Deployed on Azure App Service. Pushing to main builds and deploys via GitHub Actions (.github/workflows/main_loan-mcp-server.yml). Set all required and secret variables as App settings; Azure runs npm start (the HTTP server) and injects PORT automatically.

Scripts

Script

Description

npm run build

Compile TypeScript to dist/

npm start

Run the HTTP server

npm run start:stdio

Run the stdio server

npm run dev / dev:http

Run from source with reload

npm run typecheck

Type-check without emitting

npm test

Integration test (requires a populated .env)

npm run test:http

Integration test over HTTP

License

MIT

Available Tools

12 tools
ExplainEligibilityExplain EligibilityB

Explain a loan application's eligibility in business-friendly language, including its eligibility status, remarks and whether manual review is required.

Inputs: referenceNumber (required).

GetApplicantHistoryGet Applicant HistoryA

Retrieve all previous loan applications for an applicant, identified by their email address, ordered by most recent first.

Inputs: applicantEmail (required).

GetLoanAnalyticsGet Loan AnalyticsA

Return portfolio-level analytics across all loan applications: totals by status and average/highest/lowest loan amounts.

Inputs: no named parameters.

GetLoanStatusGet Loan StatusA

Retrieve the current processing status of a single loan application by its reference number, including eligibility status, the assigned officer and whether manual review is required.

Inputs: referenceNumber (required).

GetLoanSummaryGet Loan SummaryA

Retrieve the full summary of a single loan application by its reference number, including applicant details, amounts, status, eligibility and the assigned officer.

Inputs: referenceNumber (required).

GetOfficerWorkloadGet Officer WorkloadA

Summarize a loan officer's workload: total assigned applications, pending reviews and a breakdown by status, with the underlying loan list.

Inputs: officerName (required).

GetRequiredDocumentsGet Required DocumentsA

Return the list of documents required for a given loan type. Falls back to a default checklist for unrecognized loan types.

Inputs: loanType (required).

ListPendingReviewsList Pending ReviewsA

List all loan applications currently in the manual-review queue (status = Under Review).

Inputs: no named parameters.

SearchLoansByOfficerSearch Loans By OfficerA

Find all loan applications assigned to a specific loan officer, identified by their full name.

Inputs: officerName (required).

SearchLoansByPhoneSearch Loans By PhoneA

Find all loan applications associated with a given phone number, returned as a compact list.

Inputs: phoneNumber (required).

SearchLoansByStatusSearch Loans By StatusA

Find all loan applications matching a given status label (e.g. Received, Pending, Under Review, Approved, Rejected).

Inputs: status (required).

TrackLoanTimelineTrack Loan TimelineA

Return a chronological timeline for a loan application using its created date, eligibility-check date, officer assignment and current status.

Inputs: referenceNumber (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have clear distinct purposes, such as GetLoanSummary, SearchLoansByPhone, and GetOfficerWorkload. However, a few overlap: GetLoanSummary and GetLoanStatus both return status and officer info, and TrackLoanTimeline provides timeline which overlaps with status. These overlaps could cause minor misselection.

    Naming Consistency5/5

    All tool names follow a consistent Verb+Noun+Modifier pattern in PascalCase (e.g., GetLoanSummary, SearchLoansByStatus, ListPendingReviews). The naming is predictable and uniform across the set.

    Tool Count5/5

    With 12 tools, the set is well-scoped for a loan management server. It covers retrieval, search, analytics, and officer workload without being excessive or insufficient.

    Completeness3/5

    The tools comprehensively cover retrieval queries (summary, status, timeline, search, analytics, documents) but lack any mutation operations (create, update, delete loans). This is a notable gap for a complete loan management surface.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      MCP server for Microsoft Dataverse API with safe-by-default configuration. Works with any Dataverse / Dynamics 365 environment.
      23
      508 npm
      8
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A production-grade MCP server that exposes real-time banking data replicated via Oracle GoldenGate CDC as structured tools for AI agents, enabling read, score, and write operations on customer, account, transaction, and alert data.
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A production-grade MCP server for a fictional digital bank, exposing tools for an AI copilot to service customers across the full risk spectrum from read-only lookups to money movement and destructive admin actions, with OAuth 2.1 security and a realistic dataset.
      23 npm
      1
      -