How sbjerome/etrade-oauth-mcp works
etrade-oauth-mcp is an MCP server that exposes E*TRADE account, market-data, order, and alert operations to AI clients. The main workflow is OAuth 2.1 client authorization, Bearer-protected MCP access, tool dispatch, then OAuth 1.0a requests to E*TRADE; credentials and OAuth state are stored in OpenBao. The README documents the tool capabilities and transports. Sampled source confirms key storage and API-call patterns, but several route and handler implementations were not included, so those internal links are kept at subsystem level.
Main entry points: mcp_server.py MCP tool handlers · etrade_client.py E*TRADE client · bao.py OpenBao secrets · auth.py OAuth 2.1 server
Components 14
Client access
- OAuth 2.1 server
auth.py - Bearer protection
auth.py
MCP runtime
- MCP transports
mcp_server.py - MCP tool handlers
mcp_server.py - MCP auth tools
mcp_server.py
E*TRADE capabilities
- Session tools
mcp_server.py - Account tools
mcp_server.py - Market tools
mcp_server.py - Order tools
mcp_server.py - Alert tools
mcp_server.py - E*TRADE client
etrade_client.py
Credential state
- OpenBao secrets
bao.py
Other components
- AI client
- E*TRADE API
Connections 19
- AI client → OAuth 2.1 server: requests tokens
- OAuth 2.1 server → OpenBao secrets: reads and writes
- AI client → MCP transports: calls tools
- MCP transports → Bearer protection: checks access
- Bearer protection → MCP tool handlers: allows requests
- MCP tool handlers → Session tools: dispatches
- MCP tool handlers → MCP auth tools: dispatches
- MCP tool handlers → Account tools: dispatches
- MCP tool handlers → Market tools: dispatches
- MCP tool handlers → Order tools: dispatches
- MCP tool handlers → Alert tools: dispatches
- Session tools → OpenBao secrets: reads and writes credentials
- Session tools → E*TRADE client: starts OAuth session
- MCP auth tools → OpenBao secrets: stores auth settings
- Account tools → E*TRADE client: calls account methods
- Market tools → E*TRADE client: calls market methods
- Order tools → E*TRADE client: calls order methods
- Alert tools → E*TRADE client: calls alert methods
- E*TRADE client → E*TRADE API: sends OAuth 1.0a requests