Skip to main content
Glama
EMI Calculator MCP Server

EMI Calculator MCP Server

First Setup EMI Calculator

MCP EMI Calculator Server

Lightweight MCP server that exposes loan EMI calculation endpoints to MCP clients (for example, Claude Desktop).

Features

  • STDIO-based FastMCP server that proxies to the REST backend

  • Simple HTTP helper with JSON responses and 10 second timeout

  • Configurable backend base URL via environment variables

Related MCP server: mcp-finance-tools

Prerequisites

  • Python 3.10+

  • uv for environment management (pip-compatible)

Install uv if you do not already have it:

  • macOS/Linux:

    curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows (PowerShell):

    powershell -ExecutionPolicy Bypass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"

Quickstart (uv workflow)

  1. Clone or download this repository.

  2. From the project root, create a virtual environment (stored in .venv by default):

    uv venv
  3. Activate the environment:

    source .venv/bin/activate      # macOS/Linux
    .venv\Scripts\Activate.ps1     # Windows (PowerShell)
  4. Install dependencies:

    uv pip install -r requirements.txt
  5. Create a .env file (if you do not already have one) with the backend base URL:

    EMI_API_BASE_URL=http://localhost:8000/api
  6. Run the MCP server (communicates via STDIO):

    uv run python emi_calculator.py

MCP Client Registration (Claude Desktop example)

Add to your claude_desktop_config.json:

 "emiMcpServer": {
      "command": "uv",
      "args": [
        "--directory",
        "mcp_emi_server project path",
        "run",
        "emi_calculator.py"
      ]
    },

Configuration (.env)

Tools exposed

  • calculate_emi — {principal, interestRate, tenure, calculation_method?} → EMI summary

  • calculate_schedule — {principal, interestRate, tenure, calculation_method?} → amortization schedule

  • compare_loans — {scenarios: [{name, principal, interestRate, tenure, calculation_method?}, ...]} → side-by-side comparison

  • calculate_with_prepayment — {principal, interestRate, tenure, prepayment_amount, prepayment_frequency, prepayment_start_month, calculation_method?} → EMI with recurring prepayments

Troubleshooting

  • Ensure the backend EMI API is running and reachable.

  • Check stderr logs for detailed errors.

Available Tools

4 tools
calculate_emiA

Calculate the equated monthly instalment (EMI) for a single loan scenario.

Args: principal: Loan amount. interestRate: Annual interest rate expressed in percent (e.g. 9.5). tenure: Total tenure in months. calculation_method: Backend calculation strategy (for example, "reducing").

Returns: Backend JSON payload containing EMI details or an error structure.

Inputs: tenure (required), principal (required), interestRate (required), calculation_method. Returns: result

calculate_scheduleA

Retrieve the amortization schedule for a loan configuration.

Args: principal: Loan amount. interestRate: Annual interest rate expressed in percent (e.g. 9.5). tenure: Total tenure in months. calculation_method: Backend calculation strategy (for example, "reducing").

Returns: Backend JSON payload describing the amortization schedule or an error structure.

Inputs: tenure (required), principal (required), interestRate (required), calculation_method. Returns: result

calculate_with_prepaymentA

Calculate EMI outcomes when regular prepayments reduce the outstanding principal.

Args: principal: Loan amount. interestRate: Annual interest rate expressed in percent (e.g. 9.5). tenure: Total tenure in months. prepayment_amount: Amount paid on each prepayment event. prepayment_frequency: Frequency descriptor (for example, "monthly" or "quarterly"). prepayment_start_month: Month number when prepayment begins (1-indexed). calculation_method: Backend calculation strategy (for example, "reducing").

Returns: Backend JSON payload capturing EMI adjustments, duration changes, and savings or an error structure.

Inputs: tenure (required), principal (required), interestRate (required), prepayment_amount (required), +3 more. Returns: result

compare_loansA

Compare EMI outputs for multiple loan scenarios in a single API call.

Args: scenarios: List of loan dictionaries with keys name, principal, interestRate, and tenure. Optional key calculation_method overrides the default. calculation_method: Default strategy applied when a scenario omits it.

Returns: Backend JSON payload with comparison results or an error structure.

Inputs: scenarios (required), calculation_method. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: single EMI, full amortization schedule, multi-scenario comparison, and prepayment impact. No overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency4/5

    Three tools follow the 'calculate_' prefix pattern (calculate_emi, calculate_schedule, calculate_with_prepayment), while compare_loans uses a different verb. The naming is still consistent in style (verb_noun, snake_case) and readable, but the deviation prevents a perfect score.

    Tool Count5/5

    Four tools are well-scoped for an EMI calculator: covering single calculation, schedule generation, comparison, and prepayment scenarios. The number is neither too thin nor excessive for the domain.

    Completeness5/5

    The surface covers the core lifecycle of EMI computation: basic EMI, amortization schedule, loan comparison, and prepayment analysis. No obvious missing operations for a standard EMI calculator, as the tools return comprehensive backend payloads.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables financial calculations such as compound interest, loan EMI, and savings goal projections through natural language.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Provides Korean-specific financial calculators (4 insurances, salary net, severance pay, capital gains tax, DSR/DTI, FX conversion, housing subscription score) as MCP tools for AI agents.
      7
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides educational fixed-rate loan estimates with mortgage and auto loan calculators.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Provides mortgage calculation tools, including monthly payment, amortization schedules, lump sum payments, and extra monthly payments for real estate agents and AI assistants.
      7
      MIT