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.

ParameterTypeDefaultDescription
subcategorystringnullFilter by subcategory name (e.g. “Large Cap Fund”). Case-insensitive substring match.
amcstringnullFilter 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.

ParameterTypeDefaultDescription
isinstringrequiredISIN 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.

ParameterTypeDefaultDescription
subcategorystringnullFilter 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.

ParameterTypeDefaultDescription
isin_codesstring[]requiredList 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.

ParameterTypeDefaultDescription
portfolioobject[]requiredArray 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.

ParameterTypeDefaultDescription
isinstringrequiredISIN code of the fund
limitint90Number 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.

ParameterTypeDefaultDescription
index_namestringrequiredExact 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.

ParameterTypeDefaultDescription
index_namestringrequiredExact NSE index name
limitint90Number 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.

ParameterTypeDefaultDescription
categorystringnullFilter 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).

ParameterTypeDefaultDescription
index_namestringrequiredExact 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.

ParameterTypeDefaultDescription
index_namestringrequiredExact BSE index name
limitint90Number 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.

ParameterTypeDefaultDescription
monthly_amountfloatrequiredMonthly investment amount in INR
duration_yearsintrequiredInvestment duration in years
expected_annual_return_pctfloatrequiredExpected 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.

ParameterTypeDefaultDescription
initial_corpusfloatrequiredStarting investment corpus in INR
monthly_withdrawalfloatrequiredMonthly withdrawal amount in INR
duration_yearsintrequiredSimulation duration in years
expected_annual_return_pctfloatrequiredExpected 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)