open-stocks-mcp


Nameopen-stocks-mcp JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryMCP Server based on open stock API packages like Robin Stocks
upload_time2025-07-14 22:12:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords api finance mcp robin-stocks stocks trading
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # open-stocks-mcp

**🚧 UNDER CONSTRUCTION 🚧**

An MCP (Model Context Protocol) server providing access to stock market data through open-source APIs like Robin Stocks.

## Project Intent

This project aims to create a standardized interface for LLM applications to access stock market data, portfolio information, and trading capabilities through the Model Context Protocol.

### Planned Features
- Real-time stock price data
- Portfolio management tools  
- Market analysis capabilities
- Historical data access
- Trading alerts and notifications

## Status

- ✅ **Foundation**: MCP server scaffolding complete
- ✅ **Infrastructure**: CI/CD, testing, and publishing pipeline established
- ✅ **Package**: Published to PyPI as `open-stocks-mcp` (v0.3.0)
- ✅ **Authentication**: Robin Stocks authentication with device verification support
- ✅ **Containerization**: Production-ready Docker deployment with security features
- ✅ **Communication**: Server/client MCP communication verified working
- ✅ **Core Tools**: 56 MCP tools implemented across 10 categories
- ✅ **Advanced Data**: Market intelligence, dividend tracking, and system monitoring
- ✅ **Phase 3**: Options trading, watchlist management, account features, and user profiles
- 📋 **Next**: Trading capabilities and order placement

## Installation

Install the Open Stocks MCP server via pip:

```bash
pip install open-stocks-mcp
```

For development installation from source:

```bash
git clone https://github.com/Open-Agent-Tools/open-stocks-mcp.git
cd open-stocks-mcp
uv pip install -e .
```

## Credential Management

The Open Stocks MCP server uses Robin Stocks for market data access, which requires Robinhood account credentials.

### Setting Up Credentials

1. Create a `.env` file in your project root:

```bash
ROBINHOOD_USERNAME=your_email@example.com
ROBINHOOD_PASSWORD=your_password
```

2. Secure your credentials:
   - Never commit the `.env` file to version control
   - Ensure proper file permissions: `chmod 600 .env`
   - Consider using a password manager or secure credential storage

### Device Verification and MFA

The Open Stocks MCP server includes enhanced authentication that handles Robinhood's device verification requirements:

**Device Verification Process:**
- When logging in for the first time, Robinhood may require device verification
- Check your Robinhood mobile app for verification prompts
- Approve the device when prompted
- The server will automatically handle the verification workflow

**Multi-Factor Authentication (MFA):**
- If your account has MFA enabled, you'll receive a push notification in the Robinhood mobile app
- Keep your mobile app accessible during the login process
- The server supports both SMS and app-based verification methods

**Troubleshooting Authentication:**
- **"Device verification required"**: Check your mobile app and approve the device
- **"Interactive verification required"**: Ensure you have access to your mobile device
- **Session persistence**: Authentication sessions are cached to reduce verification frequency

## Starting the MCP Server Locally

### Via Command Line

**STDIO Transport (Default)**
Start the server in stdio transport mode (for MCP clients):

```bash
# Using the installed package
open-stocks-mcp-server --transport stdio

# For development with auto-reload
uv run open-stocks-mcp-server --transport stdio
```

**HTTP Transport (New in v0.4.0)**
Start the server with HTTP transport for better reliability and session management:

```bash
# Using the installed package with default settings (localhost:3000)
open-stocks-mcp-server --transport http

# Custom host and port
open-stocks-mcp-server --transport http --host localhost --port 3000

# For development with auto-reload
uv run open-stocks-mcp-server --transport http --port 3000
```

**Available Endpoints (HTTP Transport):**
- JSON-RPC 2.0: `http://localhost:3000/mcp`
- Server-Sent Events: `http://localhost:3000/sse`
- Health Check: `http://localhost:3000/health`
- Server Status: `http://localhost:3000/status`
- API Documentation: `http://localhost:3000/docs`

### Testing the Server

Use the MCP Inspector for interactive testing:

```bash
# Run the inspector with the server (mcp CLI required)
uv run mcp dev src/open_stocks_mcp/server/app.py
```

Note: The `mcp` command is installed with the `mcp[cli]` package dependency.

## Adding the MCP Client to an ADK Agent

To integrate Open Stocks MCP with your ADK (Agent Development Kit) agent:

### 1. Update MCP Settings

**STDIO Transport (Legacy)**
Add the server to your MCP settings configuration:

```json
{
  "mcpServers": {
    "open-stocks": {
      "command": "open-stocks-mcp-server",
      "args": ["--transport", "stdio"],
      "env": {}
    }
  }
}
```

**HTTP Transport (Recommended)**
For better reliability and session management:

```json
{
  "mcpServers": {
    "open-stocks": {
      "command": "http://localhost:3000/mcp",
      "transport": "http"
    }
  }
}
```

### 2. Claude Desktop Integration

For Claude Desktop app, add to your configuration:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

**STDIO Transport:**
```json
{
  "mcpServers": {
    "open-stocks": {
      "command": "open-stocks-mcp-server",
      "args": ["--transport", "stdio"]
    }
  }
}
```

**HTTP Transport (Recommended):**
```json
{
  "mcpServers": {
    "open-stocks": {
      "command": "http://localhost:3000/mcp"
    }
  }
}
```

**Note**: When using HTTP transport, start the server first:
```bash
open-stocks-mcp-server --transport http
```


### 3. Available Tools

Once connected, your agent will have access to 61 MCP tools across 10 categories covering account management, market data, options trading, watchlists, user profiles, and system monitoring. Use the `list_tools` command for the complete current list.

## Docker Deployment

The Open Stocks MCP server includes production-ready Docker containerization with enhanced security features.

### Quick Start with Docker

```bash
# Clone the repository
git clone https://github.com/Open-Agent-Tools/open-stocks-mcp.git
cd open-stocks-mcp/examples/open-stocks-mcp-docker

# Create credentials file
cp .env.example .env
# Edit .env with your Robinhood credentials

# Start the server
docker-compose up -d

# Check logs
docker-compose logs -f

# Stop the server
docker-compose down
```

### Docker Features

**Security:**
- Non-root user execution (UID 1001)
- Health checks with automatic restart
- Resource limits and reservations
- Environment variable isolation

**Production Ready:**
- Automatic session persistence
- Device verification handling
- Comprehensive logging
- Port exposure (3001) for MCP clients

**See the [Docker Example README](examples/open-stocks-mcp-docker/README.md) for complete documentation.**

## Current Functionality (v0.4.0)

### Core Features
- **61 MCP Tools**: Complete trading and analysis toolkit
- **HTTP Transport**: New HTTP transport with SSE for better reliability and session management
- **Enhanced Authentication**: Device verification, MFA support, session persistence
- **Production Ready**: Docker deployment, comprehensive error handling
- **Advanced Analytics**: Portfolio analysis, dividend tracking, options trading
- **Real-time Data**: Market data, news, earnings, analyst ratings
- **Health Monitoring**: Built-in health checks and status endpoints

## Testing

### Basic Tests
Run the basic test suite:

```bash
uv run pytest
```

### Login Flow Integration Tests
Test the complete login flow with real credentials from `.env`:

```bash
# Run all tests including integration tests
uv run pytest -m integration

# Run specific login flow tests
uv run pytest tests/test_server_login_flow.py -v

# Run without integration tests (no credentials needed)
uv run pytest -m "not integration"
```

**Note**: Integration tests require valid `ROBINHOOD_USERNAME` and `ROBINHOOD_PASSWORD` in your `.env` file. These tests mock the actual Robin Stocks API calls to avoid real authentication attempts.

### Test Categories
- **Unit tests**: Basic functionality without external dependencies
- **Integration tests**: Login flow tests using real credentials (but mocked API calls)
- **Slow tests**: Performance and stress tests (marked with `@pytest.mark.slow`)

For development with auto-reloading:

```bash
uv run pytest --watch
```

## Development Roadmap

**Current Status (v0.4.0)**: 61 MCP tools, HTTP transport with SSE, complete read-only functionality  
**Next Phase**: Live trading capabilities (order placement and management)

For detailed development history and roadmap, see `TODO.md`.

## Intentionally Excluded

The following Robin Stocks API functionality is **deliberately excluded** from the Open Stocks MCP server as it falls outside the project's scope and intent:

### **Cryptocurrency Functions**
- `get_crypto_positions()` - Current crypto holdings
- `get_crypto_quote(symbol)` - Real-time crypto prices  
- `get_crypto_historicals(symbol)` - Historical crypto data
- `get_crypto_info(symbol)` - Crypto asset information
- `get_crypto_currency_pairs()` - Available trading pairs
- `load_crypto_profile()` - Crypto account profile
- `get_crypto_id(symbol)` - Get crypto asset ID

**Rationale**: This project focuses specifically on **stock and options trading**. Cryptocurrency trading represents a different asset class with distinct regulatory, technical, and market characteristics that would significantly expand the project scope beyond its core mission.

### **Document Management Functions**
- `get_documents()` - Account documents list
- `download_document()` - Download specific document
- `download_all_documents()` - Download all documents

**Rationale**: Document management is primarily an administrative function rather than a trading or analysis tool. The MCP protocol is designed for real-time data and trading operations, not file management.

### **Banking & Transfer Functions**
- `get_wire_transfers()` - Wire transfer history
- `get_card_transactions()` - Card transaction history  
- `get_linked_bank_accounts()` - Connected bank accounts
- `get_unified_transfers()` - Unified transfer history

**Rationale**: Banking and transfer functions are account management features that fall outside the scope of market data analysis and trading operations. These functions are better handled through Robinhood's native interface.

### **Currency Trading Functions**
- `get_currency_pairs()` - Forex currency pairs
- Foreign exchange trading capabilities

**Rationale**: Forex trading is a specialized market with different characteristics from stock and options trading. Including forex would require additional expertise and significantly expand the project's complexity.

## Project Scope

The Open Stocks MCP server is intentionally focused on:
- ✅ **Stock market data and analysis**
- ✅ **Options trading and analysis**
- ✅ **Portfolio management and tracking**
- ✅ **Dividend and income analysis**
- ✅ **Account and user profile management**
- ✅ **Trading order placement and management** (Phase 4)

This focused approach ensures the project remains manageable, maintainable, and aligned with its core mission of providing comprehensive **stock and options trading capabilities** through the MCP protocol.

## License

Apache License 2.0 - see LICENSE file for details.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "open-stocks-mcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Wes Etheredge <jwesleye@gmail.com>",
    "keywords": "api, finance, mcp, robin-stocks, stocks, trading",
    "author": null,
    "author_email": "Wes Etheredge <jwesleye@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/9f/ddca1494a05dcc59c467fe255a9fef6ee1a138039b20785061f0371c4380/open_stocks_mcp-0.5.0.tar.gz",
    "platform": null,
    "description": "# open-stocks-mcp\n\n**\ud83d\udea7 UNDER CONSTRUCTION \ud83d\udea7**\n\nAn MCP (Model Context Protocol) server providing access to stock market data through open-source APIs like Robin Stocks.\n\n## Project Intent\n\nThis project aims to create a standardized interface for LLM applications to access stock market data, portfolio information, and trading capabilities through the Model Context Protocol.\n\n### Planned Features\n- Real-time stock price data\n- Portfolio management tools  \n- Market analysis capabilities\n- Historical data access\n- Trading alerts and notifications\n\n## Status\n\n- \u2705 **Foundation**: MCP server scaffolding complete\n- \u2705 **Infrastructure**: CI/CD, testing, and publishing pipeline established\n- \u2705 **Package**: Published to PyPI as `open-stocks-mcp` (v0.3.0)\n- \u2705 **Authentication**: Robin Stocks authentication with device verification support\n- \u2705 **Containerization**: Production-ready Docker deployment with security features\n- \u2705 **Communication**: Server/client MCP communication verified working\n- \u2705 **Core Tools**: 56 MCP tools implemented across 10 categories\n- \u2705 **Advanced Data**: Market intelligence, dividend tracking, and system monitoring\n- \u2705 **Phase 3**: Options trading, watchlist management, account features, and user profiles\n- \ud83d\udccb **Next**: Trading capabilities and order placement\n\n## Installation\n\nInstall the Open Stocks MCP server via pip:\n\n```bash\npip install open-stocks-mcp\n```\n\nFor development installation from source:\n\n```bash\ngit clone https://github.com/Open-Agent-Tools/open-stocks-mcp.git\ncd open-stocks-mcp\nuv pip install -e .\n```\n\n## Credential Management\n\nThe Open Stocks MCP server uses Robin Stocks for market data access, which requires Robinhood account credentials.\n\n### Setting Up Credentials\n\n1. Create a `.env` file in your project root:\n\n```bash\nROBINHOOD_USERNAME=your_email@example.com\nROBINHOOD_PASSWORD=your_password\n```\n\n2. Secure your credentials:\n   - Never commit the `.env` file to version control\n   - Ensure proper file permissions: `chmod 600 .env`\n   - Consider using a password manager or secure credential storage\n\n### Device Verification and MFA\n\nThe Open Stocks MCP server includes enhanced authentication that handles Robinhood's device verification requirements:\n\n**Device Verification Process:**\n- When logging in for the first time, Robinhood may require device verification\n- Check your Robinhood mobile app for verification prompts\n- Approve the device when prompted\n- The server will automatically handle the verification workflow\n\n**Multi-Factor Authentication (MFA):**\n- If your account has MFA enabled, you'll receive a push notification in the Robinhood mobile app\n- Keep your mobile app accessible during the login process\n- The server supports both SMS and app-based verification methods\n\n**Troubleshooting Authentication:**\n- **\"Device verification required\"**: Check your mobile app and approve the device\n- **\"Interactive verification required\"**: Ensure you have access to your mobile device\n- **Session persistence**: Authentication sessions are cached to reduce verification frequency\n\n## Starting the MCP Server Locally\n\n### Via Command Line\n\n**STDIO Transport (Default)**\nStart the server in stdio transport mode (for MCP clients):\n\n```bash\n# Using the installed package\nopen-stocks-mcp-server --transport stdio\n\n# For development with auto-reload\nuv run open-stocks-mcp-server --transport stdio\n```\n\n**HTTP Transport (New in v0.4.0)**\nStart the server with HTTP transport for better reliability and session management:\n\n```bash\n# Using the installed package with default settings (localhost:3000)\nopen-stocks-mcp-server --transport http\n\n# Custom host and port\nopen-stocks-mcp-server --transport http --host localhost --port 3000\n\n# For development with auto-reload\nuv run open-stocks-mcp-server --transport http --port 3000\n```\n\n**Available Endpoints (HTTP Transport):**\n- JSON-RPC 2.0: `http://localhost:3000/mcp`\n- Server-Sent Events: `http://localhost:3000/sse`\n- Health Check: `http://localhost:3000/health`\n- Server Status: `http://localhost:3000/status`\n- API Documentation: `http://localhost:3000/docs`\n\n### Testing the Server\n\nUse the MCP Inspector for interactive testing:\n\n```bash\n# Run the inspector with the server (mcp CLI required)\nuv run mcp dev src/open_stocks_mcp/server/app.py\n```\n\nNote: The `mcp` command is installed with the `mcp[cli]` package dependency.\n\n## Adding the MCP Client to an ADK Agent\n\nTo integrate Open Stocks MCP with your ADK (Agent Development Kit) agent:\n\n### 1. Update MCP Settings\n\n**STDIO Transport (Legacy)**\nAdd the server to your MCP settings configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"open-stocks\": {\n      \"command\": \"open-stocks-mcp-server\",\n      \"args\": [\"--transport\", \"stdio\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n**HTTP Transport (Recommended)**\nFor better reliability and session management:\n\n```json\n{\n  \"mcpServers\": {\n    \"open-stocks\": {\n      \"command\": \"http://localhost:3000/mcp\",\n      \"transport\": \"http\"\n    }\n  }\n}\n```\n\n### 2. Claude Desktop Integration\n\nFor Claude Desktop app, add to your configuration:\n\n**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n**STDIO Transport:**\n```json\n{\n  \"mcpServers\": {\n    \"open-stocks\": {\n      \"command\": \"open-stocks-mcp-server\",\n      \"args\": [\"--transport\", \"stdio\"]\n    }\n  }\n}\n```\n\n**HTTP Transport (Recommended):**\n```json\n{\n  \"mcpServers\": {\n    \"open-stocks\": {\n      \"command\": \"http://localhost:3000/mcp\"\n    }\n  }\n}\n```\n\n**Note**: When using HTTP transport, start the server first:\n```bash\nopen-stocks-mcp-server --transport http\n```\n\n\n### 3. Available Tools\n\nOnce connected, your agent will have access to 61 MCP tools across 10 categories covering account management, market data, options trading, watchlists, user profiles, and system monitoring. Use the `list_tools` command for the complete current list.\n\n## Docker Deployment\n\nThe Open Stocks MCP server includes production-ready Docker containerization with enhanced security features.\n\n### Quick Start with Docker\n\n```bash\n# Clone the repository\ngit clone https://github.com/Open-Agent-Tools/open-stocks-mcp.git\ncd open-stocks-mcp/examples/open-stocks-mcp-docker\n\n# Create credentials file\ncp .env.example .env\n# Edit .env with your Robinhood credentials\n\n# Start the server\ndocker-compose up -d\n\n# Check logs\ndocker-compose logs -f\n\n# Stop the server\ndocker-compose down\n```\n\n### Docker Features\n\n**Security:**\n- Non-root user execution (UID 1001)\n- Health checks with automatic restart\n- Resource limits and reservations\n- Environment variable isolation\n\n**Production Ready:**\n- Automatic session persistence\n- Device verification handling\n- Comprehensive logging\n- Port exposure (3001) for MCP clients\n\n**See the [Docker Example README](examples/open-stocks-mcp-docker/README.md) for complete documentation.**\n\n## Current Functionality (v0.4.0)\n\n### Core Features\n- **61 MCP Tools**: Complete trading and analysis toolkit\n- **HTTP Transport**: New HTTP transport with SSE for better reliability and session management\n- **Enhanced Authentication**: Device verification, MFA support, session persistence\n- **Production Ready**: Docker deployment, comprehensive error handling\n- **Advanced Analytics**: Portfolio analysis, dividend tracking, options trading\n- **Real-time Data**: Market data, news, earnings, analyst ratings\n- **Health Monitoring**: Built-in health checks and status endpoints\n\n## Testing\n\n### Basic Tests\nRun the basic test suite:\n\n```bash\nuv run pytest\n```\n\n### Login Flow Integration Tests\nTest the complete login flow with real credentials from `.env`:\n\n```bash\n# Run all tests including integration tests\nuv run pytest -m integration\n\n# Run specific login flow tests\nuv run pytest tests/test_server_login_flow.py -v\n\n# Run without integration tests (no credentials needed)\nuv run pytest -m \"not integration\"\n```\n\n**Note**: Integration tests require valid `ROBINHOOD_USERNAME` and `ROBINHOOD_PASSWORD` in your `.env` file. These tests mock the actual Robin Stocks API calls to avoid real authentication attempts.\n\n### Test Categories\n- **Unit tests**: Basic functionality without external dependencies\n- **Integration tests**: Login flow tests using real credentials (but mocked API calls)\n- **Slow tests**: Performance and stress tests (marked with `@pytest.mark.slow`)\n\nFor development with auto-reloading:\n\n```bash\nuv run pytest --watch\n```\n\n## Development Roadmap\n\n**Current Status (v0.4.0)**: 61 MCP tools, HTTP transport with SSE, complete read-only functionality  \n**Next Phase**: Live trading capabilities (order placement and management)\n\nFor detailed development history and roadmap, see `TODO.md`.\n\n## Intentionally Excluded\n\nThe following Robin Stocks API functionality is **deliberately excluded** from the Open Stocks MCP server as it falls outside the project's scope and intent:\n\n### **Cryptocurrency Functions**\n- `get_crypto_positions()` - Current crypto holdings\n- `get_crypto_quote(symbol)` - Real-time crypto prices  \n- `get_crypto_historicals(symbol)` - Historical crypto data\n- `get_crypto_info(symbol)` - Crypto asset information\n- `get_crypto_currency_pairs()` - Available trading pairs\n- `load_crypto_profile()` - Crypto account profile\n- `get_crypto_id(symbol)` - Get crypto asset ID\n\n**Rationale**: This project focuses specifically on **stock and options trading**. Cryptocurrency trading represents a different asset class with distinct regulatory, technical, and market characteristics that would significantly expand the project scope beyond its core mission.\n\n### **Document Management Functions**\n- `get_documents()` - Account documents list\n- `download_document()` - Download specific document\n- `download_all_documents()` - Download all documents\n\n**Rationale**: Document management is primarily an administrative function rather than a trading or analysis tool. The MCP protocol is designed for real-time data and trading operations, not file management.\n\n### **Banking & Transfer Functions**\n- `get_wire_transfers()` - Wire transfer history\n- `get_card_transactions()` - Card transaction history  \n- `get_linked_bank_accounts()` - Connected bank accounts\n- `get_unified_transfers()` - Unified transfer history\n\n**Rationale**: Banking and transfer functions are account management features that fall outside the scope of market data analysis and trading operations. These functions are better handled through Robinhood's native interface.\n\n### **Currency Trading Functions**\n- `get_currency_pairs()` - Forex currency pairs\n- Foreign exchange trading capabilities\n\n**Rationale**: Forex trading is a specialized market with different characteristics from stock and options trading. Including forex would require additional expertise and significantly expand the project's complexity.\n\n## Project Scope\n\nThe Open Stocks MCP server is intentionally focused on:\n- \u2705 **Stock market data and analysis**\n- \u2705 **Options trading and analysis**\n- \u2705 **Portfolio management and tracking**\n- \u2705 **Dividend and income analysis**\n- \u2705 **Account and user profile management**\n- \u2705 **Trading order placement and management** (Phase 4)\n\nThis focused approach ensures the project remains manageable, maintainable, and aligned with its core mission of providing comprehensive **stock and options trading capabilities** through the MCP protocol.\n\n## License\n\nApache License 2.0 - see LICENSE file for details.",
    "bugtrack_url": null,
    "license": "Apache License\n                                   Version 2.0, January 2004\n                                http://www.apache.org/licenses/\n        \n           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n        \n           1. Definitions.\n        \n              \"License\" shall mean the terms and conditions for use, reproduction,\n              and distribution as defined by Sections 1 through 9 of this document.\n        \n              \"Licensor\" shall mean the copyright owner or entity authorized by\n              the copyright owner that is granting the License.\n        \n              \"Legal Entity\" shall mean the union of the acting entity and all\n              other entities that control, are controlled by, or are under common\n              control with that entity. For the purposes of this definition,\n              \"control\" means (i) the power, direct or indirect, to cause the\n              direction or management of such entity, whether by contract or\n              otherwise, or (ii) ownership of fifty percent (50%) or more of the\n              outstanding shares, or (iii) beneficial ownership of such entity.\n        \n              \"You\" (or \"Your\") shall mean an individual or Legal Entity\n              exercising permissions granted by this License.\n        \n              \"Source\" form shall mean the preferred form for making modifications,\n              including but not limited to software source code, documentation\n              source, and configuration files.\n        \n              \"Object\" form shall mean any form resulting from mechanical\n              transformation or translation of a Source form, including but\n              not limited to compiled object code, generated documentation,\n              and conversions to other media types.\n        \n              \"Work\" shall mean the work of authorship, whether in Source or\n              Object form, made available under the License, as indicated by a\n              copyright notice that is included in or attached to the work\n              (an example is provided in the Appendix below).\n        \n              \"Derivative Works\" shall mean any work, whether in Source or Object\n              form, that is based on (or derived from) the Work and for which the\n              editorial revisions, annotations, elaborations, or other modifications\n              represent, as a whole, an original work of authorship. For the purposes\n              of this License, Derivative Works shall not include works that remain\n              separable from, or merely link (or bind by name) to the interfaces of,\n              the Work and Derivative Works thereof.\n        \n              \"Contribution\" shall mean any work of authorship, including\n              the original version of the Work and any modifications or additions\n              to that Work or Derivative Works thereof, that is intentionally\n              submitted to Licensor for inclusion in the Work by the copyright owner\n              or by an individual or Legal Entity authorized to submit on behalf of\n              the copyright owner. For the purposes of this definition, \"submitted\"\n              means any form of electronic, verbal, or written communication sent\n              to the Licensor or its representatives, including but not limited to\n              communication on electronic mailing lists, source code control systems,\n              and issue tracking systems that are managed by, or on behalf of, the\n              Licensor for the purpose of discussing and improving the Work, but\n              excluding communication that is conspicuously marked or otherwise\n              designated in writing by the copyright owner as \"Not a Contribution.\"\n        \n              \"Contributor\" shall mean Licensor and any individual or Legal Entity\n              on behalf of whom a Contribution has been received by Licensor and\n              subsequently incorporated within the Work.\n        \n           2. Grant of Copyright License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              copyright license to reproduce, prepare Derivative Works of,\n              publicly display, publicly perform, sublicense, and distribute the\n              Work and such Derivative Works in Source or Object form.\n        \n           3. Grant of Patent License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              (except as stated in this section) patent license to make, have made,\n              use, offer to sell, sell, import, and otherwise transfer the Work,\n              where such license applies only to those patent claims licensable\n              by such Contributor that are necessarily infringed by their\n              Contribution(s) alone or by combination of their Contribution(s)\n              with the Work to which such Contribution(s) was submitted. If You\n              institute patent litigation against any entity (including a\n              cross-claim or counterclaim in a lawsuit) alleging that the Work\n              or a Contribution incorporated within the Work constitutes direct\n              or contributory patent infringement, then any patent licenses\n              granted to You under this License for that Work shall terminate\n              as of the date such litigation is filed.\n        \n           4. Redistribution. You may reproduce and distribute copies of the\n              Work or Derivative Works thereof in any medium, with or without\n              modifications, and in Source or Object form, provided that You\n              meet the following conditions:\n        \n              (a) You must give any other recipients of the Work or\n                  Derivative Works a copy of this License; and\n        \n              (b) You must cause any modified files to carry prominent notices\n                  stating that You changed the files; and\n        \n              (c) You must retain, in the Source form of any Derivative Works\n                  that You distribute, all copyright, patent, trademark, and\n                  attribution notices from the Source form of the Work,\n                  excluding those notices that do not pertain to any part of\n                  the Derivative Works; and\n        \n              (d) If the Work includes a \"NOTICE\" text file as part of its\n                  distribution, then any Derivative Works that You distribute must\n                  include a readable copy of the attribution notices contained\n                  within such NOTICE file, excluding those notices that do not\n                  pertain to any part of the Derivative Works, in at least one\n                  of the following places: within a NOTICE text file distributed\n                  as part of the Derivative Works; within the Source form or\n                  documentation, if provided along with the Derivative Works; or,\n                  within a display generated by the Derivative Works, if and\n                  wherever such third-party notices normally appear. The contents\n                  of the NOTICE file are for informational purposes only and\n                  do not modify the License. You may add Your own attribution\n                  notices within Derivative Works that You distribute, alongside\n                  or as an addendum to the NOTICE text from the Work, provided\n                  that such additional attribution notices cannot be construed\n                  as modifying the License.\n        \n              You may add Your own copyright statement to Your modifications and\n              may provide additional or different license terms and conditions\n              for use, reproduction, or distribution of Your modifications, or\n              for any such Derivative Works as a whole, provided Your use,\n              reproduction, and distribution of the Work otherwise complies with\n              the conditions stated in this License.\n        \n           5. Submission of Contributions. Unless You explicitly state otherwise,\n              any Contribution intentionally submitted for inclusion in the Work\n              by You to the Licensor shall be under the terms and conditions of\n              this License, without any additional terms or conditions.\n              Notwithstanding the above, nothing herein shall supersede or modify\n              the terms of any separate license agreement you may have executed\n              with Licensor regarding such Contributions.\n        \n           6. Trademarks. This License does not grant permission to use the trade\n              names, trademarks, service marks, or product names of the Licensor,\n              except as required for reasonable and customary use in describing the\n              origin of the Work and reproducing the content of the NOTICE file.\n        \n           7. Disclaimer of Warranty. Unless required by applicable law or\n              agreed to in writing, Licensor provides the Work (and each\n              Contributor provides its Contributions) on an \"AS IS\" BASIS,\n              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n              implied, including, without limitation, any warranties or conditions\n              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n              PARTICULAR PURPOSE. You are solely responsible for determining the\n              appropriateness of using or redistributing the Work and assume any\n              risks associated with Your exercise of permissions under this License.\n        \n           8. Limitation of Liability. In no event and under no legal theory,\n              whether in tort (including negligence), contract, or otherwise,\n              unless required by applicable law (such as deliberate and grossly\n              negligent acts) or agreed to in writing, shall any Contributor be\n              liable to You for damages, including any direct, indirect, special,\n              incidental, or consequential damages of any character arising as a\n              result of this License or out of the use or inability to use the\n              Work (including but not limited to damages for loss of goodwill,\n              work stoppage, computer failure or malfunction, or any and all\n              other commercial damages or losses), even if such Contributor\n              has been advised of the possibility of such damages.\n        \n           9. Accepting Warranty or Additional Liability. While redistributing\n              the Work or Derivative Works thereof, You may choose to offer,\n              and charge a fee for, acceptance of support, warranty, indemnity,\n              or other liability obligations and/or rights consistent with this\n              License. However, in accepting such obligations, You may act only\n              on Your own behalf and on Your sole responsibility, not on behalf\n              of any other Contributor, and only if You agree to indemnify,\n              defend, and hold each Contributor harmless for any liability\n              incurred by, or claims asserted against, such Contributor by reason\n              of your accepting any such warranty or additional liability.\n        \n           END OF TERMS AND CONDITIONS\n        \n           APPENDIX: How to apply the Apache License to your work.\n        \n              To apply the Apache License to your work, attach the following\n              boilerplate notice, with the fields enclosed by brackets \"[]\"\n              replaced with your own identifying information. (Don't include\n              the brackets!)  The text should be enclosed in the appropriate\n              comment syntax for the file format. We also recommend that a\n              file or class name and description of purpose be included on the\n              same \"printed page\" as the copyright notice for easier\n              identification within third-party archives.\n        \n           Copyright [yyyy] [name of copyright owner]\n        \n           Licensed under the Apache License, Version 2.0 (the \"License\");\n           you may not use this file except in compliance with the License.\n           You may obtain a copy of the License at\n        \n               http://www.apache.org/licenses/LICENSE-2.0\n        \n           Unless required by applicable law or agreed to in writing, software\n           distributed under the License is distributed on an \"AS IS\" BASIS,\n           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n           See the License for the specific language governing permissions and\n           limitations under the License.",
    "summary": "MCP Server based on open stock API packages like Robin Stocks",
    "version": "0.5.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Open-Agent-Tools/open-stocks-mcp/issues",
        "Documentation": "https://github.com/Open-Agent-Tools/open-stocks-mcp#readme",
        "Homepage": "https://github.com/Open-Agent-Tools/open-stocks-mcp",
        "Source Code": "https://github.com/Open-Agent-Tools/open-stocks-mcp"
    },
    "split_keywords": [
        "api",
        " finance",
        " mcp",
        " robin-stocks",
        " stocks",
        " trading"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "978bef6caf25b5ed28ba091e26a6fb42a23e49ed490a18bf918026b6f778b428",
                "md5": "607e61f605ad0f4fda7f870f62ad0cdc",
                "sha256": "4aca93c8184fe66b9ba8770920a9ed549660db2c3ebe35f0642a43a4f0e1f238"
            },
            "downloads": -1,
            "filename": "open_stocks_mcp-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "607e61f605ad0f4fda7f870f62ad0cdc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 75039,
            "upload_time": "2025-07-14T22:12:17",
            "upload_time_iso_8601": "2025-07-14T22:12:17.628979Z",
            "url": "https://files.pythonhosted.org/packages/97/8b/ef6caf25b5ed28ba091e26a6fb42a23e49ed490a18bf918026b6f778b428/open_stocks_mcp-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a69fddca1494a05dcc59c467fe255a9fef6ee1a138039b20785061f0371c4380",
                "md5": "ffb2bdec7fba71fe8da905e24dd8ed3c",
                "sha256": "17b2f50ced282397e508dcd22eef8fbd4d2ab0b6315e4c2b1020d9818f1059d5"
            },
            "downloads": -1,
            "filename": "open_stocks_mcp-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ffb2bdec7fba71fe8da905e24dd8ed3c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 100124,
            "upload_time": "2025-07-14T22:12:19",
            "upload_time_iso_8601": "2025-07-14T22:12:19.115841Z",
            "url": "https://files.pythonhosted.org/packages/a6/9f/ddca1494a05dcc59c467fe255a9fef6ee1a138039b20785061f0371c4380/open_stocks_mcp-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 22:12:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Open-Agent-Tools",
    "github_project": "open-stocks-mcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "open-stocks-mcp"
}
        
Elapsed time: 1.11374s