MCP-SERVER-TATA-CAPITAL

PulkitAg13/MCP-SERVER-TATA-CAPITAL

3.2

If you are the rightful owner of MCP-SERVER-TATA-CAPITAL and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

MCP-SERVER-TATA-CAPITAL is a model context protocol server designed to facilitate seamless integration and management of financial data and services.

MCP-SERVER-TATA-CAPITAL

🚀 Loan Sales Agentic API

A lightweight backend API for Personal Loan Eligibility, Offers, Document Verification, and Application Management.


📌 Base URL

http://127.0.0.1:8000/docs

📂 API Endpoints Overview

EndpointMethodDescription
/healthGETServer status check
/loan/personal/check-eligibilityPOSTCheck customer loan eligibility
/loan/personal/applyPOSTSubmit personal loan application
/loan/personal/statusPOSTTrack loan application status
/loan/personal/offerPOSTGenerate loan offers
/loan/personal/verify-panPOSTPAN verification
/loan/personal/verify-salary-slipPOSTSalary slip verification
/loan/personal/cibil-scorePOSTGet CIBIL score
/loan/personal/calculate-emiPOSTCalculate EMI

🟢 1. GET /health

✔ Check whether server is active

Response
{
  "status": "ok",
  "message": "Server is running"
}

🟦 2. POST /loan/personal/check-eligibility

Checks loan eligibility based on income, CIBIL, age, and existing liabilities.

Sample Request

{
  "customer_id": "CUST001",
  "age": 28,
  "monthly_income": 45000,
  "existing_emis": 5000,
  "cibil_score": 735,
  "employment_type": "salaried"
}

✔ Success

{
  "eligible": true,
  "approved_amount": 250000,
  "interest_rate": 12.5,
  "message": "Customer is eligible for the loan"
}

❌ Low Income

{
  "eligible": false,
  "message": "Minimum income requirement not met"
}

❌ Low CIBIL

{
  "eligible": false,
  "message": "CIBIL score too low for personal loan"
}

🟦 3. POST /loan/personal/apply

Creates a loan application entry.

Sample Request

{
  "customer_id": "CUST001",
  "loan_amount": 200000,
  "tenure_months": 36,
  "income": 45000,
  "employment_type": "salaried",
  "address": "Mumbai"
}

✔ Success

{
  "application_id": "APP10235",
  "status": "submitted",
  "message": "Loan application submitted successfully"
}

❌ Missing Fields

{
  "error": "customer_id and loan_amount are required"
}

🟦 4. POST /loan/personal/status

Retrieve status of a loan application.

Sample Request

{
  "application_id": "APP10235"
}

✔ Success

{
  "application_id": "APP10235",
  "status": "under_review"
}

❌ Invalid ID

{
  "error": "Application ID not found"
}

🟦 5. POST /loan/personal/offer

Generates personalized loan offers.

Sample Request

{
  "customer_id": "CUST001",
  "income": 45000,
  "cibil_score": 730
}

✔ Success

{
  "customer_id": "CUST001",
  "offers": [
    {
      "loan_amount": 200000,
      "interest_rate": 12.4,
      "tenure_months": 36
    },
    {
      "loan_amount": 300000,
      "interest_rate": 13.5,
      "tenure_months": 48
    }
  ]
}

🟦 6. POST /loan/personal/verify-pan

Validates the PAN number format and mapping.

Sample Request

{
  "customer_id": "CUST001",
  "pan_number": "ABCDE1234F"
}

✔ Success

{
  "valid": true,
  "message": "PAN verification successful"
}

❌ Invalid PAN

{
  "valid": false,
  "message": "Invalid PAN format or not found"
}

🟦 7. POST /loan/personal/verify-salary-slip

Verifies if customer's salary slip is available in backend data folder.

Sample Request

{
  "customer_id": "CUST001"
}

✔ Success

{
  "verified": true,
  "file": "salary_slip_CUST001.pdf"
}

❌ Not Found

{
  "verified": false,
  "message": "Salary slip not found"
}

🟦 8. POST /loan/personal/cibil-score

Returns the stored CIBIL score for a customer.

Sample Request

{
  "customer_id": "CUST001"
}

✔ Success

{
  "customer_id": "CUST001",
  "cibil_score": 742
}

❌ Not Found

{
  "error": "Customer not found"
}

🟦 9. POST /loan/personal/calculate-emi

Calculates EMI using reducing balance interest formula.

Sample Request

{
  "loan_amount": 200000,
  "interest_rate": 12.5,
  "tenure_months": 36
}

✔ Success

{
  "emi": 6681.23
}

❌ Missing Fields

{
  "error": "loan_amount, interest_rate and tenure_months are required"
}

📌 Folder Structure Example

project/
│── main.py
│── requirements.txt
│── data/
│    ├── salary_slips/
│    │    ├── salary_slip_CUST001.pdf
│    │    ├── salary_slip_CUST002.pdf
│    │    └── ...
│    └── cibil_scores.json

🚀 Run Server

uvicorn main:app --reload