openmarkets


Nameopenmarkets JSON
Version 0.1.0.dev116 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
upload_time2025-07-28 05:25:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseAGPL-3.0-or-later
keywords finance financial data retrieval investment machinelearning mcp modelcontextprotocol yahoo finance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PyPI](https://img.shields.io/pypi/v/openmarkets)
[![PyPI - Downloads](https://static.pepy.tech/badge/openmarkets)](https://pepy.tech/project/openmarkets)
![PyPI - Monthly Downloads](https://static.pepy.tech/badge/openmarkets/month)

# Open Markets

A Model Context Protocol (MCP) server for agentic retrieval of financial data from Yahoo Finance. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.

This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop, n8n, and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.

## Features

- Get basic stock information (price, market cap, sector, etc.)
- Fetch historical price data with customizable periods
- Retrieve analyst recommendations
- Download data for multiple stocks simultaneously
- Access dividend history

## Usage

This MCP server can be used with various LLM applications that support the Model Context Protocol:

- **Claude Desktop**: Anthropic's desktop application for Claude
- **Cursor**: AI-powered code editor with MCP support
- **Custom MCP clients**: Any application implementing the MCP client specification

## Usage with Claude Desktop

1. Install Claude Desktop from https://claude.ai/download
2. Open your Claude Desktop configuration:

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

3. Add the following configuration:

```json
{
  "mcpServers": {
    "openmarkets": {
      "command": "uvx",
      "args": [
        "openmarkets@latest"
      ]
    }
  }
}
```

4. Restart Claude Desktop

## Usage with VS Code

For quick installation, use one of the one-click installation buttons below:

[![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=openmarkets&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=openmarkets&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D&quality=insiders)

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.

Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 

> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.

#### UVX

```json
{
  "mcp": {
    "servers": {
      "openmarkets": {
        "command": "uvx",
        "args": [
          "openmarkets@latest"
        ]
      }
    }
  }
}
```

### Available Tools
This MCP server provides a variety of tools for retrieving financial data. Below is a list of available tools and their main arguments:

---
#### Stock Information
- **get_stock_info(ticker: str)**  
  Get basic information about a stock.

#### Historical Data
- **get_historical_data(ticker: str, period: str = "1mo", interval: str = "1d")**  
  Get historical price data for a stock.
- **get_multiple_tickers(tickers: list[str], period: str = "1d")**  
  Get data for multiple stocks at once.
- **download_bulk_data(tickers: list[str], period: str = "1mo", interval: str = "1d", ...)**  
  Download bulk historical data for multiple tickers.
- **get_ticker_history_metadata(ticker: str)**  
  Get available periods, intervals, and metadata for a ticker.

#### Analyst Data
- **get_recommendations(ticker: str)**  
  Get analyst recommendations for a stock.
- **get_analyst_price_targets(ticker: str)**  
  Get analyst price targets.
- **get_upgrades_downgrades(ticker: str)**  
  Get recent upgrades and downgrades.
- **get_recommendations_summary(ticker: str)**  
  Get recommendations summary.

#### Corporate Actions
- **get_dividends(symbol: str, period: str = "5y")**  
  Get dividend history for a stock.
- **get_splits_history(symbol: str, period: str = "5y")**  
  Get stock split history.

#### Market Data
- **get_market_status()**  
  Get current US market status.
- **get_trending_tickers(region: str = "US", count: int = 10)**  
  Get trending/popular tickers.
- **get_sector_performance()**  
  Get sector performance using ETFs.
- **get_index_data(indices: list[str] = None)**  
  Get data for major market indices.

#### Calendar & Market Hours
- **get_market_calendar_info(ticker: str)**  
  Get market calendar and session info.
- **get_market_hours(ticker: str)**  
  Get market hours and session information.
- **get_exchange_info(ticker: str)**  
  Get detailed exchange and trading information.

#### Screener & Search
- **screen_stocks_by_criteria(...)**  
  Screen stocks by market cap, P/E, dividend yield, sector, etc.
- **get_similar_stocks(ticker: str, count: int = 5)**  
  Find similar stocks by sector and market cap.
- **get_top_performers(period: str = "1mo", sector: str = None, count: int = 10)**  
  Get top performing stocks.

#### Technical Analysis
- **get_technical_indicators(ticker: str, period: str = "6mo")**  
  Get technical indicators (SMA, price position, etc.).
- **get_volatility_metrics(ticker: str, period: str = "1y")**  
  Get volatility and risk metrics.
- **get_support_resistance_levels(ticker: str, period: str = "6mo")**  
  Get support and resistance levels.

#### Options
- **get_options_expiration_dates(ticker: str)**  
  Get available options expiration dates.
- **get_option_chain(ticker: str, expiration_date: str = None)**  
  Get option chain for a ticker.
- **get_options_volume_analysis(ticker: str, expiration_date: str = None)**  
  Analyze options volume and open interest.
- **get_options_by_moneyness(ticker: str, expiration_date: str = None, moneyness_range: float = 0.1)**  
  Filter options by proximity to current price.

#### Financial Statements
- **get_financials_summary(ticker: str)**  
  Get key financial metrics summary.

#### Funds & ETFs
- **get_fund_profile(ticker: str)**  
  Get fund/ETF profile.
- **get_fund_holdings(ticker: str, count: int = 20)**  
  Get top holdings of a fund/ETF.
- **get_fund_sector_allocation(ticker: str)**  
  Get sector allocation of a fund/ETF.
- **get_fund_performance(ticker: str)**  
  Get fund/ETF performance metrics.
- **compare_funds(tickers: list[str])**  
  Compare multiple funds/ETFs.

#### Crypto
- **get_crypto_info(crypto_symbol: str)**  
  Get cryptocurrency info.
- **get_crypto_historical_data(crypto_symbol: str, period: str = "1mo", interval: str = "1d")**  
  Get historical data for a cryptocurrency.
- **get_top_cryptocurrencies(count: int = 10)**  
  Get data for top cryptocurrencies.
- **get_crypto_fear_greed_proxy(crypto_symbols: list[str] = None)**  
  Get a proxy for crypto fear/greed index.

#### Currency & Validation
- **get_currency_data(base_currency: str = "USD", target_currencies: list[str] = None)**  
  Get currency exchange rates.
- **validate_tickers(tickers: list[str])**  
  Validate if tickers are valid and available.

---

This list reflects the tools registered in the codebase and their main arguments. For more details, see the respective files in tools.

## Development

To test the MCP server locally, install the `uvx` and `npx` and run the following command:

```bash
npx @modelcontextprotocol/inspector uvx openmarkets@latest
```

This command will start the MCP server and open the MCP Inspector in your default web browser. You can then interact with the server and test its functionality.

## License

AGPLv3+ License - see [LICENSE](LICENSE) for details.

## Contributing

1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a pull request
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openmarkets",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "finance, financial data retrieval, investment, machinelearning, mcp, modelcontextprotocol, yahoo finance",
    "author": null,
    "author_email": "Dobri Danchev <python-dist@danchev.net>",
    "download_url": "https://files.pythonhosted.org/packages/8f/89/2e01f8186416a9eb656fb97282bfec6c018225bfe4a0e253617082e6bdbb/openmarkets-0.1.0.dev116.tar.gz",
    "platform": null,
    "description": "![PyPI](https://img.shields.io/pypi/v/openmarkets)\n[![PyPI - Downloads](https://static.pepy.tech/badge/openmarkets)](https://pepy.tech/project/openmarkets)\n![PyPI - Monthly Downloads](https://static.pepy.tech/badge/openmarkets/month)\n\n# Open Markets\n\nA Model Context Protocol (MCP) server for agentic retrieval of financial data from Yahoo Finance. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.\n\nThis MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop, n8n, and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.\n\n## Features\n\n- Get basic stock information (price, market cap, sector, etc.)\n- Fetch historical price data with customizable periods\n- Retrieve analyst recommendations\n- Download data for multiple stocks simultaneously\n- Access dividend history\n\n## Usage\n\nThis MCP server can be used with various LLM applications that support the Model Context Protocol:\n\n- **Claude Desktop**: Anthropic's desktop application for Claude\n- **Cursor**: AI-powered code editor with MCP support\n- **Custom MCP clients**: Any application implementing the MCP client specification\n\n## Usage with Claude Desktop\n\n1. Install Claude Desktop from https://claude.ai/download\n2. Open your Claude Desktop configuration:\n\n   - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n   - Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n3. Add the following configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"openmarkets\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"openmarkets@latest\"\n      ]\n    }\n  }\n}\n```\n\n4. Restart Claude Desktop\n\n## Usage with VS Code\n\nFor quick installation, use one of the one-click installation buttons below:\n\n[![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=openmarkets&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=openmarkets&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D&quality=insiders)\n\nFor manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.\n\nOptionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. \n\n> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.\n\n#### UVX\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"openmarkets\": {\n        \"command\": \"uvx\",\n        \"args\": [\n          \"openmarkets@latest\"\n        ]\n      }\n    }\n  }\n}\n```\n\n### Available Tools\nThis MCP server provides a variety of tools for retrieving financial data. Below is a list of available tools and their main arguments:\n\n---\n#### Stock Information\n- **get_stock_info(ticker: str)**  \n  Get basic information about a stock.\n\n#### Historical Data\n- **get_historical_data(ticker: str, period: str = \"1mo\", interval: str = \"1d\")**  \n  Get historical price data for a stock.\n- **get_multiple_tickers(tickers: list[str], period: str = \"1d\")**  \n  Get data for multiple stocks at once.\n- **download_bulk_data(tickers: list[str], period: str = \"1mo\", interval: str = \"1d\", ...)**  \n  Download bulk historical data for multiple tickers.\n- **get_ticker_history_metadata(ticker: str)**  \n  Get available periods, intervals, and metadata for a ticker.\n\n#### Analyst Data\n- **get_recommendations(ticker: str)**  \n  Get analyst recommendations for a stock.\n- **get_analyst_price_targets(ticker: str)**  \n  Get analyst price targets.\n- **get_upgrades_downgrades(ticker: str)**  \n  Get recent upgrades and downgrades.\n- **get_recommendations_summary(ticker: str)**  \n  Get recommendations summary.\n\n#### Corporate Actions\n- **get_dividends(symbol: str, period: str = \"5y\")**  \n  Get dividend history for a stock.\n- **get_splits_history(symbol: str, period: str = \"5y\")**  \n  Get stock split history.\n\n#### Market Data\n- **get_market_status()**  \n  Get current US market status.\n- **get_trending_tickers(region: str = \"US\", count: int = 10)**  \n  Get trending/popular tickers.\n- **get_sector_performance()**  \n  Get sector performance using ETFs.\n- **get_index_data(indices: list[str] = None)**  \n  Get data for major market indices.\n\n#### Calendar & Market Hours\n- **get_market_calendar_info(ticker: str)**  \n  Get market calendar and session info.\n- **get_market_hours(ticker: str)**  \n  Get market hours and session information.\n- **get_exchange_info(ticker: str)**  \n  Get detailed exchange and trading information.\n\n#### Screener & Search\n- **screen_stocks_by_criteria(...)**  \n  Screen stocks by market cap, P/E, dividend yield, sector, etc.\n- **get_similar_stocks(ticker: str, count: int = 5)**  \n  Find similar stocks by sector and market cap.\n- **get_top_performers(period: str = \"1mo\", sector: str = None, count: int = 10)**  \n  Get top performing stocks.\n\n#### Technical Analysis\n- **get_technical_indicators(ticker: str, period: str = \"6mo\")**  \n  Get technical indicators (SMA, price position, etc.).\n- **get_volatility_metrics(ticker: str, period: str = \"1y\")**  \n  Get volatility and risk metrics.\n- **get_support_resistance_levels(ticker: str, period: str = \"6mo\")**  \n  Get support and resistance levels.\n\n#### Options\n- **get_options_expiration_dates(ticker: str)**  \n  Get available options expiration dates.\n- **get_option_chain(ticker: str, expiration_date: str = None)**  \n  Get option chain for a ticker.\n- **get_options_volume_analysis(ticker: str, expiration_date: str = None)**  \n  Analyze options volume and open interest.\n- **get_options_by_moneyness(ticker: str, expiration_date: str = None, moneyness_range: float = 0.1)**  \n  Filter options by proximity to current price.\n\n#### Financial Statements\n- **get_financials_summary(ticker: str)**  \n  Get key financial metrics summary.\n\n#### Funds & ETFs\n- **get_fund_profile(ticker: str)**  \n  Get fund/ETF profile.\n- **get_fund_holdings(ticker: str, count: int = 20)**  \n  Get top holdings of a fund/ETF.\n- **get_fund_sector_allocation(ticker: str)**  \n  Get sector allocation of a fund/ETF.\n- **get_fund_performance(ticker: str)**  \n  Get fund/ETF performance metrics.\n- **compare_funds(tickers: list[str])**  \n  Compare multiple funds/ETFs.\n\n#### Crypto\n- **get_crypto_info(crypto_symbol: str)**  \n  Get cryptocurrency info.\n- **get_crypto_historical_data(crypto_symbol: str, period: str = \"1mo\", interval: str = \"1d\")**  \n  Get historical data for a cryptocurrency.\n- **get_top_cryptocurrencies(count: int = 10)**  \n  Get data for top cryptocurrencies.\n- **get_crypto_fear_greed_proxy(crypto_symbols: list[str] = None)**  \n  Get a proxy for crypto fear/greed index.\n\n#### Currency & Validation\n- **get_currency_data(base_currency: str = \"USD\", target_currencies: list[str] = None)**  \n  Get currency exchange rates.\n- **validate_tickers(tickers: list[str])**  \n  Validate if tickers are valid and available.\n\n---\n\nThis list reflects the tools registered in the codebase and their main arguments. For more details, see the respective files in tools.\n\n## Development\n\nTo test the MCP server locally, install the `uvx` and `npx` and run the following command:\n\n```bash\nnpx @modelcontextprotocol/inspector uvx openmarkets@latest\n```\n\nThis command will start the MCP server and open the MCP Inspector in your default web browser. You can then interact with the server and test its functionality.\n\n## License\n\nAGPLv3+ License - see [LICENSE](LICENSE) for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a pull request",
    "bugtrack_url": null,
    "license": "AGPL-3.0-or-later",
    "summary": "A Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.",
    "version": "0.1.0.dev116",
    "project_urls": {
        "Documentation": "https://danchev.github.io/openmarkets/",
        "Homepage": "https://openmarkets.dev",
        "Issues": "https://github.com/danchev/openmarkets/issues",
        "Source": "https://github.com/danchev/openmarkets"
    },
    "split_keywords": [
        "finance",
        " financial data retrieval",
        " investment",
        " machinelearning",
        " mcp",
        " modelcontextprotocol",
        " yahoo finance"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2681f0443c3b154a5cc3a4010a667651ccceb11fca015036d70732d0882f2739",
                "md5": "796dede814ee284c46d7f324b776afa5",
                "sha256": "f99cd4e9202a836574da1a09ac1770c7e9cd372ea2c348aac3b76238eca6b396"
            },
            "downloads": -1,
            "filename": "openmarkets-0.1.0.dev116-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "796dede814ee284c46d7f324b776afa5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 45790,
            "upload_time": "2025-07-28T05:25:44",
            "upload_time_iso_8601": "2025-07-28T05:25:44.685291Z",
            "url": "https://files.pythonhosted.org/packages/26/81/f0443c3b154a5cc3a4010a667651ccceb11fca015036d70732d0882f2739/openmarkets-0.1.0.dev116-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8f892e01f8186416a9eb656fb97282bfec6c018225bfe4a0e253617082e6bdbb",
                "md5": "740583cc55068dd177f114c2016ce750",
                "sha256": "7aee2e575d2197f21dd4e546ae416a80fc33768f5a18a272ea5b59dcf24344b5"
            },
            "downloads": -1,
            "filename": "openmarkets-0.1.0.dev116.tar.gz",
            "has_sig": false,
            "md5_digest": "740583cc55068dd177f114c2016ce750",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 73556,
            "upload_time": "2025-07-28T05:25:46",
            "upload_time_iso_8601": "2025-07-28T05:25:46.140480Z",
            "url": "https://files.pythonhosted.org/packages/8f/89/2e01f8186416a9eb656fb97282bfec6c018225bfe4a0e253617082e6bdbb/openmarkets-0.1.0.dev116.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 05:25:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "danchev",
    "github_project": "openmarkets",
    "github_not_found": true,
    "lcname": "openmarkets"
}
        
Elapsed time: 0.45248s