An MCP (Model Context Protocol) server that exposes ETRADE API operations as tools for AI agents. This allows AI assistants like Claude and GitHub Copilot to interact with ETRADE's trading platform.
| Package | Version | Downloads |
|---|---|---|
| OpenEtradeMcp | ||
| OpenEtradeMcp.Server |
- OAuth 1.0a Authentication: Interactive OAuth flow designed to work seamlessly with AI agents
- E*TRADE API Tools: Auto-generated tools from E*TRADE's OpenAPI specification
- Sandbox Support: Test safely with E*TRADE's sandbox environment
- Global Tool: Install as a .NET global tool for easy access
- .NET 8.0 or 9.0 SDK
- E*TRADE Developer Account with API access
- Consumer Key and Consumer Secret from E*TRADE Developer Portal
dotnet tool install --global OpenEtradeMcp.Servergit clone https://github.com/kerryjiang/OpenEtradeMcp.git
cd OpenEtradeMcp
dotnet buildexport ETRADE_ConsumerKey="your-consumer-key"
export ETRADE_ConsumerSecret="your-consumer-secret"
export ETRADE_UseSandbox="true" # Optional: use sandbox environmentetrade-mcp --ConsumerKey=your-key --ConsumerSecret=your-secret --UseSandbox=trueetrade-mcpcd src/OpenEtradeMcp.Server
dotnet runAdd to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"etrade": {
"command": "/Users/{YourUserName}/.dotnet/tools/etrade-mcp",
"env": {
"ETRADE_ConsumerKey": "your-consumer-key",
"ETRADE_ConsumerSecret": "your-consumer-secret",
"ETRADE_UseSandbox": "true"
}
}
}
}Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"etrade": {
"command": "C:\\\\Users\\{YourUserName}\\.dotnet\\tools\\etrade-mcp",
"env": {
"ETRADE_ConsumerKey": "your-consumer-key",
"ETRADE_ConsumerSecret": "your-consumer-secret",
"ETRADE_UseSandbox": "true"
}
}
}
}Configure in your VS Code MCP settings to use the etrade-mcp command with appropriate environment variables.
The server provides interactive OAuth tools that allow an AI agent to guide users through authentication:
Begins the authentication process and returns an authorization URL.
Agent: "I'll start the E*TRADE authentication process."
[Calls etrade_oauth_start]
Agent: "Please click this link to authorize: https://us.etrade.com/e/t/etws/authorize?..."
After the user authorizes and receives the verifier code:
User: "I got the code: ABC123"
Agent: "Great, let me complete the authentication."
[Calls etrade_oauth_complete with verifierCode="ABC123"]
Agent: "Authentication successful! You can now use E*TRADE API tools."
etrade_oauth_status- Check authentication statusetrade_oauth_renew- Renew access token (tokens expire at midnight Eastern)etrade_oauth_revoke- Log out and revoke access token
| Tool | Description |
|---|---|
etrade_oauth_start |
Start OAuth authentication flow |
etrade_oauth_complete |
Complete OAuth with verifier code |
etrade_oauth_status |
Check authentication status |
etrade_oauth_renew |
Renew access token |
etrade_oauth_revoke |
Revoke access token |
Tools are auto-generated from the E*TRADE OpenAPI specification and include:
- Account Management - List accounts, view account details
- Portfolio - View positions and holdings
- Orders - Place, preview, and manage orders
- Market Data - Get quotes, option chains, and market information
- Alerts - Manage price and trading alerts
OpenEtradeMcp/
├── src/
│ ├── OpenEtradeMcp/ # Core library with E*TRADE API definitions
│ │ └── etrade-api.yaml # E*TRADE OpenAPI specification
│ └── OpenEtradeMcp.Server/ # MCP server executable
├── Directory.Build.props # Shared build properties
├── Directory.Packages.props # Centralized package management
└── OpenEtradeMcp.sln # Solution file
- Never commit credentials - Use environment variables for your consumer key/secret
- Memory-only tokens - Access tokens are stored in memory and not persisted to disk
- Use sandbox first - Test with sandbox environment before using production credentials
Ensure the etrade-api.yaml file is in the output directory. Rebuild the project.
Set the ConsumerKey and ConsumerSecret environment variables.
- Verify your credentials are correct
- Ensure sandbox credentials are used with
UseSandbox=true - Check that the verifier code is entered correctly (no extra spaces)
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Kerry Jiang - GitHub