E*TRADE MCP Server

E*TRADE MCP Server

Enables comprehensive E\*TRADE integration with OAuth authentication, account management, risk calculations, watch lists, and trading operations. Includes built-in risk management guardrails, portfolio tracking, market data access, and trading validation for safe automated trading operations.

Category
Visit Server

README

E*TRADE MCP Server

A comprehensive Model Context Protocol (MCP) server for E*TRADE integration with OAuth authentication, account management, risk calculations, watch lists, and trading guardrails.

Features

🔐 OAuth Authentication

  • Complete E*TRADE OAuth 1.0a flow
  • Token management and renewal
  • Secure credential handling

💰 Account Management

  • Account balance retrieval
  • Transaction history
  • Portfolio viewing
  • Real-time account data

📊 Risk Management

  • R-multiple risk calculations
  • Daily loss tracking
  • Position sizing guardrails
  • Risk validation before orders

📋 Watch Lists

  • Create, read, update, delete watch lists
  • Symbol management
  • Independent from portfolio positions

📈 Market Data

  • Option chains with expiration dates
  • Real-time quotes
  • Security lookup by company name

🚨 Alerts

  • Price alerts management
  • Alert notifications
  • Custom alert conditions

Installation

Prerequisites

  • Python 3.11+
  • E*TRADE developer account with API keys

Install via UVX (Recommended)

uvx --from git+https://github.com/davdunc/mcp_etrade.git mcp_etrade

Install via pip

pip install git+https://github.com/davdunc/mcp_etrade.git

Development Install

git clone https://github.com/davdunc/mcp_etrade.git
cd mcp_etrade
pip install -e .

Configuration

Set your E*TRADE API credentials:

export ETRADE_OAUTH_CONSUMER_KEY="your_consumer_key"
export ETRADE_OAUTH_CONSUMER_SECRET="your_consumer_secret"

Usage

Standalone Server

python -m mcp_etrade.server

With Colosseum Framework

Add to ~/.config/colosseum/mcp.json:

{
  "etrade": {
    "type": "etrade",
    "command": "uvx",
    "args": ["--from", "git+https://github.com/davdunc/mcp_etrade.git", "mcp_etrade"],
    "env": {
      "ETRADE_OAUTH_CONSUMER_KEY": "${ETRADE_OAUTH_CONSUMER_KEY}",
      "ETRADE_OAUTH_CONSUMER_SECRET": "${ETRADE_OAUTH_CONSUMER_SECRET}"
    }
  }
}

Available Tools

Authentication

  • get_request_token - Start OAuth flow
  • get_authorization_url - Get user authorization URL
  • get_access_token - Complete OAuth flow
  • renew_access_token - Refresh tokens
  • revoke_access_token - Revoke access

Account Management

  • get_account_balance - Get account balance and details
  • list_transactions - List account transactions
  • get_transaction_details - Get specific transaction details
  • view_portfolio - View portfolio positions

Risk Management

  • calculate_risk_parameters - Calculate R-multiple risk parameters
  • validate_order_risk - Validate order against risk limits
  • get_daily_risk_status - Get current daily risk utilization
  • record_actual_loss - Record actual trading losses

Watch Lists

  • create_watch_list - Create new watch list
  • get_watch_lists - Get all watch lists
  • update_watch_list - Update existing watch list
  • delete_watch_list - Delete watch list

Market Data

  • get_option_chains - Get option chains for symbols
  • get_option_expire_dates - Get option expiration dates
  • get_quotes - Get real-time quotes
  • lookup_product - Search securities by company name

Alerts

  • list_alerts - List price alerts
  • delete_alerts - Delete alerts
  • get_alert_details - Get alert details

Risk Management

The server includes comprehensive risk management features:

  • Daily Risk Limits: Configurable percentage of account balance
  • Position Size Limits: Maximum 50% of account per order
  • Loss Tracking: Both potential and actual loss tracking
  • Validation: Pre-order risk validation with detailed messages

Example risk validation:

# Validate order before placement
result = await call_tool("validate_order_risk", {
    "account_id": "your_account",
    "order_value": 1000.00,
    "risk_amount": 50.00,
    "risk_percentage": 1.0
})

Testing

Run the comprehensive test suite:

pytest

Test Coverage:

  • 105 passing tests
  • OAuth authentication flows
  • Account management operations
  • Risk calculation accuracy
  • Watch list CRUD operations
  • Market data retrieval
  • Alert management

Architecture

  • Clean JSON Output: Structured responses for agent consumption
  • Comprehensive Error Handling: Graceful failure modes
  • Mock Data Support: Full functionality without live API calls
  • Modular Design: Separate concerns for OAuth, risk, data, etc.

Integration

Designed for integration with:

  • Colosseum: Multi-agent trading framework
  • LangChain: Agent tooling and orchestration
  • MCP Clients: Any MCP-compatible system

License

GNU General Public License v3.0

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

Support

For issues and questions:

  • GitHub Issues: https://github.com/davdunc/mcp_etrade/issues
  • Documentation: See inline code documentation

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured