MCP Tools

Machine-readable tools for AI agents via the Model Context Protocol.

The INDvest MCP server exposes financial data tools over streamable-HTTP transport. These tools enable AI agents (Claude, etc.) to query mutual fund analytics, index data, and financial calculators programmatically.

Connection

  • Transport: Streamable HTTP
  • Endpoint: https://api.indvested.com/mcp (or http://localhost:8001/mcp for local dev)
  • Auth: x-api-token header (same token as REST API)

Claude Desktop Configuration

Remote (production):

{
  "mcpServers": {
    "indvest": {
      "type": "url",
      "url": "https://api.indvested.com/mcp",
      "headers": {
        "x-api-token": "YOUR_TOKEN"
      }
    }
  }
}

Local development:

{
  "mcpServers": {
    "indvest-local": {
      "type": "url",
      "url": "http://localhost:8001/mcp"
    }
  }
}

No auth header needed locally when DEBUG=True.


Mutual Fund Tools

list_mutual_funds

List mutual funds, optionally filtered by subcategory or AMC name. Returns fund id, name, ISIN code, asset class, and subcategory.

Parameter Type Default Description
subcategory string null Filter by subcategory name (e.g. “Large Cap Fund”). Case-insensitive substring match.
amc string null Filter by AMC name (e.g. “HDFC”). Case-insensitive substring match.

Returns: Array of fund objects with id, name, isinCode, assetClass, subcategory, amcName.


get_fund_details

Get full pre-computed metrics for a mutual fund by ISIN code. Returns SIP CAGR, XIRR, rolling returns, drawdown metrics, and benchmark comparison.

Parameter Type Default Description
isin string required ISIN code of the fund (e.g. “INF082J01036”)

Returns: Fund detail object with sipCagrMetrics, xirrMetrics, rollingReturnMetrics, drawdownMetrics, benchmarkComparisonMetrics, calmarRatio, plus fund metadata (name, AMC, TER, NAV).


get_top_funds

Get top-performing mutual funds that consistently beat their category’s 75th-percentile benchmark across all available time horizons.

Parameter Type Default Description
subcategory string null Filter by subcategory name. Returns all subcategories if omitted.

Returns: Array of top fund objects with subcategory, isinCode, fundName, amcName, fundOption, rollingReturn.


compare_funds

Compare 2-5 mutual funds side by side using rolling return metrics, category averages, and fund metadata.

Parameter Type Default Description
isin_codes string[] required List of ISIN codes to compare (2-5 funds)

Returns: Array of fund comparison objects with id, name, isinCode, amcName, subcategory, ter, nav, navDate, rollingReturns, rollingReturnMetrics.


compute_portfolio_return

Compute blended SIP CAGR and rolling returns for a weighted portfolio of mutual funds.

Parameter Type Default Description
portfolio object[] required Array of {isin, weight} objects. Weights should sum to 100.

Returns: Portfolio object with funds array and blendedReturns containing sipCagr and rollingReturns across durations.


get_fund_nav_history

Get recent daily NAV history for a mutual fund. Returns NAV values sorted newest-first.

Parameter Type Default Description
isin string required ISIN code of the fund
limit int 90 Number of most recent NAV records (max 365)

Returns: Array of {date, nav} objects.


NSE Index Tools

list_nse_indices

List all tracked NSE (National Stock Exchange) indices with id, name, and type.

No parameters.

Returns: Array of index objects with id, name, indexType.


get_nse_index_details

Get pre-computed metrics for an NSE index including rolling returns, SIP CAGR, XIRR, and present-level metrics.

Parameter Type Default Description
index_name string required Exact NSE index name (e.g. “NIFTY 50”). Use list_nse_indices() for available names.

Returns: Index detail object with rollingReturnMetrics, sipCagrMetrics, xirr, presentLevelMetrics.


get_nse_index_history

Get recent daily close values for an NSE index. Sorted newest-first.

Parameter Type Default Description
index_name string required Exact NSE index name
limit int 90 Number of most recent records (max 365)

Returns: Array of {date, close} objects.


BSE Index Tools

list_bse_indices

List all tracked BSE (Bombay Stock Exchange) indices, optionally filtered by category.

Parameter Type Default Description
category string null Filter by category name (e.g. “Broad Market”). Case-insensitive substring match.

Returns: Array of index objects with id, name, category.


get_bse_index_details

Get pre-computed metrics for a BSE index including rolling returns, SIP CAGR, XIRR, and present-level metrics (PE, PB, dividend yield where available).

Parameter Type Default Description
index_name string required Exact BSE index name (e.g. “SENSEX”). Use list_bse_indices() for available names.

Returns: Index detail object with rollingReturnMetrics, sipCagrMetrics, xirr, presentLevelMetrics.


get_bse_index_history

Get recent daily OHLC data plus PE, PB, dividend yield, and volume for a BSE index. Sorted newest-first.

Parameter Type Default Description
index_name string required Exact BSE index name
limit int 90 Number of most recent records (max 365)

Returns: Array of objects with date, open, high, low, close, pe, pb, dividendYield, volume.


Calculator Tools

sip_calculator

Calculate the maturity value of a monthly SIP (Systematic Investment Plan) using standard compound interest.

Parameter Type Default Description
monthly_amount float required Monthly investment amount in INR
duration_years int required Investment duration in years
expected_annual_return_pct float required Expected annual return percentage (e.g. 12.0 for 12%)

Returns: Object with totalInvestedAmount, estimatedMaturityValue, estimatedGains, wealthGainMultiple.


swp_calculator

Simulate month-by-month corpus depletion for a Systematic Withdrawal Plan.

Parameter Type Default Description
initial_corpus float required Starting investment corpus in INR
monthly_withdrawal float required Monthly withdrawal amount in INR
duration_years int required Simulation duration in years
expected_annual_return_pct float required Expected annual return on remaining corpus

Returns: Object with corpusDepletionMonth, corpusSurvives, yearlyBalances (array of {year, corpusBalance}).


Error Handling

All tools return structured error responses with an error field when:

  • A requested fund or index is not found
  • Cached metrics have not yet been computed
  • Parameter validation fails (e.g. more than 5 funds in compare_funds)