AngelOne MCP server

Integrates AngelOne India trading platform to provide real-time market data access, order management, and portfolio tracking for automated financial analysis and trading operations.
Back to servers
Setup instructions
Provider
baba786
Release date
Dec 04, 2024
Language
Python

The Angle One MCP Server provides financial data and analysis capabilities through a standardized Model Context Protocol interface. It integrates with Angle One's trading APIs to access market data and execute trading operations.

Installation

Prerequisites

  • Python 3.7+
  • Angle One trading account with API credentials

Setup Steps

  1. Clone the repository:

    git clone https://github.com/baba786/angleone-mcp-server.git
    cd angleone-mcp-server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure your environment: Create a .env file in the root directory with your Angle One API credentials:

    ANGLEONE_API_KEY=your_api_key
    ANGLEONE_CLIENT_ID=your_client_id
    ANGLEONE_PASSWORD=your_password
    ANGLEONE_TOKEN=your_token
    

Usage

Starting the Server

Launch the MCP server with:

python src/main.py

Once started, the server will be accessible at http://localhost:8000

Available Features

  • Real-time Market Data: Access current market prices and trends
  • Order Management: Place, modify, and cancel trading orders
  • Portfolio Tracking: Monitor your investments and positions
  • MCP-compliant API: Use standardized endpoints following the Model Context Protocol

API Examples

To interact with the server, you can use standard HTTP requests to the MCP endpoints. For example:

# Get market data for a specific symbol
curl http://localhost:8000/market-data?symbol=RELIANCE

# Place a buy order
curl -X POST http://localhost:8000/orders \
  -H "Content-Type: application/json" \
  -d '{"symbol": "RELIANCE", "quantity": 10, "price": 2500, "type": "BUY"}'

Configuration Options

The server behavior can be customized by modifying the configuration settings in your .env file:

  • PORT: Change the default port (8000)
  • LOG_LEVEL: Set logging verbosity (INFO, DEBUG, ERROR)
  • CACHE_TIMEOUT: Set market data cache timeout in seconds

Troubleshooting

Common Issues

  • Connection Errors: Verify your Angle One credentials in the .env file
  • API Rate Limiting: If you encounter rate limits, implement pauses between requests
  • Data Retrieval Problems: Ensure the requested symbols are valid and available through Angle One

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "angleone-mcp-server" '{"command":"python","args":["src/main.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "angleone-mcp-server": {
            "command": "python",
            "args": [
                "src/main.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "angleone-mcp-server": {
            "command": "python",
            "args": [
                "src/main.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later