# Stock Market MCP Server - Quotes, Key Stats & Price History (`rjmacarthy/stock-market-mcp-server`) Actor

MCP server for AI agents (Claude, Cursor, n8n): stock, ETF, index, crypto, currency and futures quotes, key statistics, price history with a whole-range summary, and side-by-side comparison from public Yahoo Finance pages. No API key. $0.01 per answered call.

- **URL**: https://apify.com/rjmacarthy/stock-market-mcp-server.md
- **Developed by:** [rj](https://apify.com/rjmacarthy) (community)
- **Categories:** MCP servers, AI, Developer tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 answered tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stock Market MCP Server - Quotes, Key Stats & Price History

Give Claude, Cursor or any MCP agent live market data from public Yahoo Finance pages: quotes, key statistics, price history and side-by-side comparisons for stocks, ETFs, indices, crypto, currencies and futures. No API key and no login. It costs **$0.01 per answered call**, half the $0.02 of the leading Yahoo Finance MCP server, and failed calls are free. Price history comes with a summary of the **whole range**, so an agent sees a 10-year trend without pulling thousands of rows into its context.

### What an agent can ask

- "How is Apple trading today, and when are its next earnings?"
- "Compare Microsoft, Alphabet and Amazon on P/E, yield and 52-week range."
- "How much has the S\&P 500 moved over 10 years, and what were its high and low?"
- "What are Nvidia's margins and return on equity?"
- "Show Bitcoin's weekly closes for the last 6 months."

### Tools

| Tool | Arguments | Returns |
|---|---|---|
| `get_quote` | `ticker` | Price, daily change, day and 52-week range, volume, market cap, P/E, EPS, dividend yield, next earnings date, analyst target |
| `get_key_statistics` | `ticker`, `section` (`valuation`, `profitability`, `balance_sheet`, `cash_flow`, `shares`, `all`) | Valuation, margins, returns, balance sheet, cash flow, share and short-interest data (stocks only) |
| `get_price_history` | `ticker`, `range` (`1mo` to `10y`, `ytd`, `max`), `interval` (`daily`, `weekly`, `monthly`) | Latest 20 OHLCV bars plus a whole-range summary |
| `compare_tickers` | `tickers` (2 to 5) | One row per ticker; a ticker that fails is listed in `errors` |

Tickers are Yahoo symbols: `AAPL`, `BRK-B`, `VOD.L`, `SPY`, `^GSPC`, `BTC-USD`, `EURUSD=X`, `GC=F`.

Example calls:

```json
{ "name": "get_quote", "arguments": { "ticker": "AAPL" } }
{ "name": "get_key_statistics", "arguments": { "ticker": "NVDA", "section": "profitability" } }
{ "name": "get_price_history", "arguments": { "ticker": "^GSPC", "range": "10y", "interval": "monthly" } }
{ "name": "compare_tickers", "arguments": { "tickers": ["AAPL", "MSFT", "NVDA"] } }
```

### How to connect

Endpoint: `https://rjmacarthy--stock-market-mcp-server.apify.actor/mcp`, with the header `Authorization: Bearer <APIFY_TOKEN>`.

**Claude Code:**

```bash
claude mcp add --transport http stock-market https://rjmacarthy--stock-market-mcp-server.apify.actor/mcp --header "Authorization: Bearer <APIFY_TOKEN>"
```

**Claude Desktop** (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "stock-market": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://rjmacarthy--stock-market-mcp-server.apify.actor/mcp", "--header", "Authorization: Bearer <APIFY_TOKEN>"]
    }
  }
}
```

**Cursor** (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "stock-market": {
      "url": "https://rjmacarthy--stock-market-mcp-server.apify.actor/mcp",
      "headers": { "Authorization": "Bearer <APIFY_TOKEN>" }
    }
  }
}
```

### Pricing

| Event | Price |
|---|---|
| `tool-call` (one answered call) | $0.01 |
| `apify-actor-start` | $0.00005 |

100 answered calls cost about $1. A failed call (unknown ticker, block, timeout) costs nothing. `compare_tickers` is one call for up to 5 tickers, and is charged if at least one ticker is answered.

### What data can you get

| Data | Stocks | ETFs | Indices | Crypto | Currencies | Futures |
|---|---|---|---|---|---|---|
| Quote and comparison | Yes | Yes | Yes | Yes | Yes | Yes |
| Price history with summary | Yes | Yes | Yes | Yes | Yes | Yes |
| Key statistics | Yes | No | No | No | No | No |

Fields that do not apply or are not published are left out of the answer.

### Use cases

- Research assistants that answer market questions with current numbers
- Portfolio check-ins and watchlist comparisons in an agent workflow
- Trend summaries over long periods with little context use
- Valuation and margin screens across a handful of named companies

### Run it without an agent

A normal run executes one tool and saves the rows to the dataset:

```json
{ "tool": "compare_tickers", "tickers": ["AAPL", "MSFT", "NVDA"] }
```

```json
{ "tool": "get_price_history", "tickers": ["AAPL"], "range": "5y", "interval": "weekly" }
```

### Output example

A real `compare_tickers` row:

```json
{"symbol":"AAPL","name":"Apple Inc.","type":"EQUITY","currency":"USD","price":342.56,"change":-6.649994,"changePercent":-1.9042965,"marketCap":4978144444416,"peRatio":38.146996,"dividendYield":0.32,"yearLow":243.42,"yearHigh":360.83,"url":"https://finance.yahoo.com/quote/AAPL/"}
```

### Tips and limits

- **Not investment advice.** Prices can be delayed, exactly as they are on Yahoo's pages.
- **Not included:** ticker search by company name, options, financial statements and news. Use the exact Yahoo symbol.
- Percent-like values are in percent: `0.32` means 0.32%. `debtToEquity` is too, as Yahoo reports it.
- Prices are in `currency`. London stocks quote in pence (`GBp`), Johannesburg in cents (`ZAc`) and Tel Aviv in agorot (`ILA`), while market cap is in the major currency: read it with `marketCapCurrency`. If a company reports in another currency, `get_key_statistics` adds `financialCurrency` (Vodafone: price in `GBp`, statements in `EUR`).
- Calls run one at a time and each has a 50-second limit. A call that hits it returns an error and is not charged.

### FAQ

**Do I need a Yahoo account or API key?** No, only an Apify token.

**Why did a ticker fail?** The symbol may not exist on Yahoo, or Yahoo may have refused the request for the moment. The error says which, and you are not charged.

**Why no key statistics for an ETF or Bitcoin?** Yahoo has no such page for those types. Use `get_quote`.

**Does it use proxies?** No. It reads public pages directly.

**Is it legal?** It reads public data only, with no login and no personal data. You are responsible for using the data in line with the laws and terms that apply to you.

### Integrations

Use it from any MCP client (Claude, Cursor, n8n), or run it as a normal Actor through the Apify API, Make, Zapier or n8n.

### Changelog

- **0.1** First release: `get_quote`, `get_key_statistics`, `get_price_history`, `compare_tickers`.

### More scrapers by the same developer

- [RAG Web Search - Search the Web, Get Markdown for AI Agents](https://apify.com/rjmacarthy/rag-web-search)
- [Website Content Crawler - Markdown for LLM, RAG & AI Agents](https://apify.com/rjmacarthy/website-content-crawler)
- [AI Visibility Tracker: ChatGPT, Perplexity, Gemini, Claude](https://apify.com/rjmacarthy/ai-search-visibility-tracker)
- [Apple App Store Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/app-store-scraper)
- [Bulk File Downloader - PDFs, Images & Files from URL Lists](https://apify.com/rjmacarthy/bulk-file-downloader)
- [Domain WHOIS Lookup - Bulk RDAP, Expiry, DNS & Availability](https://apify.com/rjmacarthy/domain-whois-lookup)

Browse all my Actors on [my Apify Store profile](https://apify.com/rjmacarthy).

### Support

Found a wrong number or a ticker that fails? Open an issue on the Actor's Issues tab with the tool, arguments and time of the call.

# Actor input Schema

## `tool` (type: `string`):

Which tool to run.

## `tickers` (type: `array`):

Yahoo symbols, e.g. AAPL, BRK-B, VOD.L, SPY, ^GSPC, BTC-USD, EURUSD=X, GC=F. Compare uses 2 to 5; the other tools use the first one.

## `range` (type: `string`):

Price history only: the period the summary covers.

## `interval` (type: `string`):

Price history only: bar size.

## Actor input object example

```json
{
  "tool": "compare_tickers",
  "tickers": [
    "AAPL",
    "MSFT",
    "NVDA"
  ],
  "range": "1mo",
  "interval": "daily"
}
```

# Actor output Schema

## `quotes` (type: `string`):

Quotes and comparisons (table).

## `bars` (type: `string`):

Price history (table).

## `allFields` (type: `string`):

Every field of every row.

## `summary` (type: `string`):

Tool, arguments, counts, errors and requests.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tool": "compare_tickers",
    "tickers": [
        "AAPL",
        "MSFT",
        "NVDA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rjmacarthy/stock-market-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tool": "compare_tickers",
    "tickers": [
        "AAPL",
        "MSFT",
        "NVDA",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("rjmacarthy/stock-market-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tool": "compare_tickers",
  "tickers": [
    "AAPL",
    "MSFT",
    "NVDA"
  ]
}' |
apify call rjmacarthy/stock-market-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rjmacarthy/stock-market-mcp-server"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BaLSYafg2MXNf292p/builds/QgieI6DR2DGar2YqS/openapi.json
