Skip to main content
Glama
MF MCP Server

MF MCP Server

by ronyv89

MF MCP Server

A production-ready Model Context Protocol (MCP) server for Indian mutual funds, providing comprehensive NAV history, technical indicators, and screening capabilities.

Features

πŸ” Fund Discovery & Information

  • Search mutual funds by name, AMC, or category

  • List all available funds with pagination

  • Get detailed fund information including metadata and performance summaries

  • Retrieve latest NAV with change calculations

πŸ“ˆ Technical Analysis

  • Complete indicator suite: SMA, EMA, RSI, MACD, Bollinger Bands, ROC, Volatility, Drawdown

  • Rolling returns over configurable periods (30d, 90d, 180d, 365d)

  • Signal generation with bullish/bearish/neutral classifications

  • Trend and momentum analysis

πŸ“Š Advanced Features

  • Fund comparison across multiple performance and technical metrics

  • Custom screening with flexible rule-based filtering

  • Historical NAV data with date range filtering

  • Performance analytics with risk-adjusted metrics

πŸš€ Enterprise Ready

  • Robust error handling with user-friendly messages

  • In-memory caching with configurable TTL

  • Request timeouts and retry logic

  • TypeScript with comprehensive type safety

  • Zod validation for all inputs

Related MCP server: India Market MCP

Supported Tools

Tool

Description

search_mutual_funds

Search schemes by name, AMC, category

list_mutual_funds

Paginated listing of all available funds

get_mutual_fund_details

Detailed fund information and metadata

get_latest_nav

Current NAV with change calculations

get_nav_history

Historical NAV data with filtering

compute_indicators

Technical indicators and signals

compare_mutual_funds

Side-by-side fund comparison

screen_mutual_funds

Rule-based fund screening

Architecture

src/
β”œβ”€β”€ index.ts                 # Application entry point
β”œβ”€β”€ server.ts               # MCP server setup and tool registration
β”œβ”€β”€ config/
β”‚   └── env.ts             # Environment configuration
β”œβ”€β”€ tools/                 # MCP tool implementations
β”œβ”€β”€ services/              # Business logic layer
β”œβ”€β”€ providers/             # Data provider integrations
β”œβ”€β”€ analytics/             # Technical indicator calculations
β”œβ”€β”€ utils/                 # Utility functions
└── types/                 # TypeScript type definitions

Quick Start

Installation

git clone <repository-url>
cd mf-mcp-server
npm install

Environment Setup

cp .env.example .env
# Edit .env file with your configuration

Development

npm run dev

Production Build

npm run build
npm start

Environment Variables

# MCP Server Configuration
NODE_ENV=development
LOG_LEVEL=info

# API Configuration
MFAPI_BASE_URL=https://api.mfapi.in
MFAPI_TIMEOUT=10000
CACHE_TTL_SECONDS=300

# Rate limiting
REQUESTS_PER_MINUTE=60

Claude Desktop Configuration

Add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "mf-mcp-server": {
      "command": "node",
      "args": ["/path/to/mf-mcp-server/dist/index.js"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

For development with TypeScript:

{
  "mcpServers": {
    "mf-mcp-server": {
      "command": "npx",
      "args": ["tsx", "/path/to/mf-mcp-server/src/index.ts"],
      "cwd": "/path/to/mf-mcp-server"
    }
  }
}

Usage Examples

Search for Funds

Search for HDFC equity funds with a limit of 5 results

Get Technical Indicators

Compute RSI, MACD, and Bollinger Bands for scheme code 119551

Screen High-Performing Funds

Find funds with RSI < 30, 1-year returns > 15%, and volatility < 20%

Compare Fund Performance

Compare schemes 119551, 120503, and 118989 across returns, volatility, and signals

Technical Indicators

Moving Averages

  • Simple Moving Average (SMA): Trend identification

  • Exponential Moving Average (EMA): Responsive trend analysis

Momentum Oscillators

  • RSI (Relative Strength Index): Overbought/oversold conditions

  • Rate of Change (ROC): Momentum measurement

Trend Analysis

  • MACD: Moving average convergence divergence

  • Bollinger Bands: Volatility-based support/resistance

Risk Metrics

  • Standard Deviation: Volatility measurement

  • Maximum Drawdown: Downside risk assessment

  • Rolling Returns: Performance over multiple timeframes

Data Sources

Primary: MFAPI (api.mfapi.in)

  • Real-time NAV data

  • Historical price series

  • Scheme metadata

  • Free public API with good coverage

Planned: AMFI Integration

  • Enhanced fund metadata

  • Category classifications

  • Regulatory information

  • Fallback data source

Performance & Limitations

Caching Strategy

  • Default TTL: 5 minutes for most data

  • Latest NAV: 1 minute TTL

  • Historical data: 10 minute TTL

  • Fund listings: 30 minute TTL

API Rate Limits

  • Default: 60 requests per minute

  • Retry logic: 3 attempts with exponential backoff

  • Timeout: 10 seconds per request

Data Limitations

  • NAV-based analysis (not suitable for intraday trading)

  • Limited fundamental data (P/E ratios, holdings not available)

  • Historical data availability varies by fund

  • Technical analysis requires minimum 50 data points

Development

Scripts

npm run dev          # Development with hot reload
npm run build        # Production build
npm start            # Run production build
npm run lint         # ESLint checks
npm run lint:fix     # Fix linting issues
npm run type-check   # TypeScript type checking

Testing

# Manual testing with Claude Desktop or MCP inspector
npx @modelcontextprotocol/inspector build/index.js

Code Quality

  • TypeScript: Strict mode enabled

  • ESLint: Code quality and consistency

  • Zod: Runtime type validation

  • Error handling: Comprehensive error boundaries

Roadmap

Phase 1 (Current)

  • βœ… Core MCP tools implementation

  • βœ… Technical indicators

  • βœ… Fund screening

  • βœ… MFAPI integration

Phase 2 (Planned)

  • AMFI data integration

  • Portfolio analysis tools

  • Expense ratio comparisons

  • Fund manager analytics

Phase 3 (Future)

  • Real-time market data

  • Holdings analysis

  • Sector allocation tools

  • Risk-adjusted metrics (Sharpe, Sortino)

Important Disclaimers

⚠️ Investment Advisory Warning: This tool is for informational purposes only and does not constitute investment advice. Technical analysis of mutual funds based solely on NAV data has limitations:

  • NAV vs Market Price: Mutual funds trade at NAV, not market prices

  • Daily Frequency: Most indicators designed for higher-frequency data

  • Fundamental Focus: Long-term mutual fund performance depends more on underlying holdings than technical patterns

  • Market Context: Technical signals should be considered alongside fundamental analysis and market conditions

Always consult with qualified financial advisors before making investment decisions.

Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


πŸ”₯ Generated with Claude Code

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Indian mutual fund NAV data through MFAPI.in, providing net asset value information and fund details.
      65 npm
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Comprehensive MCP server for Indian stock market with 60 tools covering NSE/BSE, derivatives, mutual funds, technicals, and more, requiring no API keys. Enables users to access live market data, analyze indicators, and manage investments through natural language.
      60
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI assistants with real-time Indian mutual fund NAV data from AMFI's official feed, requiring no API key.
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Indian mutual fund NAV analytics via DuckDB, offering tools for fund search, point-to-point returns, category rankings, and more, using local or Azure parquet data.
      -