npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

alphabots-mcp-server

v1.0.12

Published

Model Context Protocol (MCP) server for Alphabots trading platform - provides advanced portfolio insights, options analysis, and Indian market data integration with enhanced symbol processing

Readme

Alphabots MCP Server

A self-contained Model Context Protocol (MCP) server for Alphabots trading platform integration with advanced Indian market support.

Features

  • Portfolio Insights: Get comprehensive portfolio holdings and financial insights
  • Real-time Data: Fetch live trading data from Alphabots platform with Yahoo Finance integration
  • Enhanced Symbol Processing: Support for exchange prefixes (NSE:, BSE:) and complex symbol formats
  • Weekly Expiry Support: Advanced parsing for weekly options with YYMDD format
  • Options Analysis: Intelligent detection and analysis of CE/PE options contracts
  • Indian Market Focus: Optimized for NSE, BSE, and Indian derivatives
  • MCP Compatible: Fully compliant with Model Context Protocol stdio transport
  • Self-contained: No external file dependencies, runs as standalone package
  • Docker Ready: Easy deployment with Docker and Docker Compose

Quick Start

Using npx (Recommended)

# Set your MCP token
export MCP_TOKEN=your_mcp_token_here

# Run the server
npx alphabots-mcp-server

Using Docker

  1. Build and run with Docker Compose:
# Set your MCP token in environment
export MCP_TOKEN=your_mcp_token_here

# Build and start the container
docker-compose up --build
  1. Or build and run manually:
# Build the image
docker build -t alphabots-mcp-server .

# Run the container
docker run -e MCP_TOKEN=your_mcp_token_here alphabots-mcp-server

Local Development

# Clone and install dependencies
npm install

# Set environment variable
export MCP_TOKEN=your_mcp_token_here

# Start the server
npm start

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | MCP_TOKEN | Yes | Your Alphabots MCP authentication token |

Available Tools

get_user_broker_insights

Retrieves comprehensive portfolio data including:

  • Total invested amount
  • Current portfolio value
  • Total profit/loss
  • Top gaining and losing positions
  • Detailed holdings with individual P&L

Usage:

{
  "name": "get_user_broker_insights",
  "arguments": {}
}

get_advanced_portfolio_analysis

Provides advanced portfolio analysis with enhanced features:

  • Options Analysis: Detailed analysis of CE/PE options contracts
  • Real-time Pricing: Live market data integration via Yahoo Finance
  • Symbol Intelligence: Advanced symbol mapping and normalization
  • Weekly Expiry Support: Parsing for weekly options (YYMDD format)
  • Exchange Prefix Handling: Support for NSE:, BSE: prefixed symbols
  • Enhanced Insights: Comprehensive market data and analytics

Usage:

{
  "name": "get_advanced_portfolio_analysis",
  "arguments": {}
}

refresh_broker_insights

Triggers a refresh of broker insights data from the Alphabots platform. This tool should be used when:

  • User specifically requests a data refresh
  • Holdings data is stale (more than 1 day old)
  • Real-time data synchronization is needed

Important Notes:

  • Refresh operation can take up to 10 seconds to complete
  • Use sparingly to avoid unnecessary API load
  • Prefer user-initiated refresh requests

Usage:

{
  "name": "refresh_broker_insights",
  "arguments": {}
}

Supported Symbol Formats

The server intelligently handles various Indian market symbol formats:

Stock Symbols

  • RELIANCE - Direct stock symbols
  • NSE:RELIANCE - Exchange prefixed symbols
  • BSE:RELIANCE - BSE exchange symbols

Options Contracts

  • NIFTY24JAN17000CE - Monthly expiry options
  • NIFTY24125CE - Weekly expiry options (YYMDD format)
  • BANKNIFTY24FEB45000PE - Bank Nifty options
  • NSE:SENSEX24125CE - Exchange prefixed options

Index Symbols

  • NIFTY, BANKNIFTY, SENSEX, FINNIFTY
  • Automatic mapping to Yahoo Finance format (^NSEI, etc.)

Docker Deployment

Production Deployment

  1. Create environment file:
echo "MCP_TOKEN=your_actual_token_here" > .env
  1. Deploy with Docker Compose:
docker-compose up -d
  1. Check logs:
docker-compose logs -f

Docker Commands

# Build image
docker build -t alphabots-mcp-server .

# Run container
docker run -d --name mcp-server -e MCP_TOKEN=your_token alphabots-mcp-server

# View logs
docker logs mcp-server

# Stop container
docker stop mcp-server

# Remove container
docker rm mcp-server

Configuration

The server validates the MCP token on startup. Ensure your token:

  • Starts with mcp_
  • Is longer than 10 characters
  • Has valid Alphabots API access

Troubleshooting

Common Issues

  1. Invalid Token Error:

    • Verify your MCP_TOKEN is correctly set
    • Ensure token starts with mcp_ and is valid
  2. API Connection Issues:

    • Check network connectivity
    • Verify token has proper API permissions
  3. Docker Issues:

    • Ensure Docker is running
    • Check environment variables are properly set

Logs

The server provides detailed logging:

  • Startup information
  • API request/response details
  • Error messages with context

Security

  • Runs as non-root user in Docker
  • Environment variables for sensitive data
  • No hardcoded credentials
  • Minimal attack surface

Requirements

  • Node.js 18+ (for local development)
  • Docker (for containerized deployment)
  • Valid Alphabots MCP token

Repository

License

MIT License