Skip to main content
Glama
twolven

StockScreen MCP Server

by twolven

StockScreen MCP

A typed FastMCP server for Yahoo Finance-backed technical, fundamental, options, news, custom, and watchlist screening. It supports local stdio and containerized Streamable HTTP transports.

Tools

  • run_stock_screen(screen_type, criteria, watchlist=None, save_result=None)

  • get_stock_news(symbol, days_back=30)

  • manage_watchlist(action, name, symbols=None)

  • get_screening_result(name)

Legacy inputs and the five original screen categories are retained. Unknown criteria are rejected rather than silently ignored. Technical screens support the original price, volume, SMA-50/SMA-200, RSI, and ATR criteria. Fundamental screens include minimum/maximum market cap, P/E, dividend, revenue growth, profit margin, debt/equity, price/book, AUM, expense ratio, and volume. Options screens include IV, option volume, put/call ratio, spread, expiration-day, and earnings-day bounds. ETF, news, and nested custom criteria retain their original names. Explicit symbols or a watchlist are preferred. With neither, the server uses yfinance's documented screen query with size=250, US-region filters, category-aware EquityQuery/ETFQuery predicates, and assets/market-cap descending order. Universe metadata includes source, category, requested/returned size, sort, and as-of time. Missing requested metrics reject a symbol instead of becoming zero, and every rejected symbol retains reasons. Persistence names are restricted and normalized JSON writes are atomic under ~/.stockscreen; no migration runs during import.

uv sync --locked
uv run python stockscreen.py

The server uses stdio and emits no logs or migration messages to stdout. Yahoo Finance is an unofficial personal-use source and may be delayed, incomplete, rate-limited, or structurally changed. Results are not investment advice or guaranteed real-time data.

Related MCP server: Yahoo Finance MCP Server

Docker / Streamable HTTP

The container runs as an unprivileged user, installs the locked production dependencies, and serves MCP at http://127.0.0.1:8000/mcp. Start it with:

docker compose up --build -d
Invoke-RestMethod http://127.0.0.1:8000/health

Connect a Streamable HTTP-capable MCP client to http://127.0.0.1:8000/mcp. The named stockscreen-data volume persists watchlists and saved results across container replacement. To avoid a port collision when running multiple servers, set MCP_HOST_PORT before starting Compose, for example $env:MCP_HOST_PORT=8002. Stop the container with docker compose down; add --volumes only when you intentionally want to delete the persisted data.

The Compose mapping intentionally binds to localhost. The endpoint has no authentication or TLS and must not be exposed to an untrusted network without a properly configured reverse proxy and access control.

Binding to loopback alone does not make the endpoint private: a browser can still reach it through DNS rebinding, so the server validates Host and Origin headers before a request reaches an MCP session. Requests carrying a foreign Host are answered with 421 Misdirected Request and those carrying a foreign Origin with 403 Forbidden, while same-origin loopback traffic and non-browser clients that send no Origin are unaffected.

Variable

Default

Purpose

MCP_TRANSPORT

stdio

stdio, http, or streamable-http.

MCP_HOST

127.0.0.1

Interface the HTTP server binds.

MCP_PORT

8000

Port inside the container.

MCP_PATH

/mcp

Streamable HTTP endpoint path.

MCP_HOST_PORT

8000

Host port Compose publishes on 127.0.0.1.

MCP_HOST_ORIGIN_PROTECTION

true

true, auto, or false. Disable only behind a proxy that performs the same validation.

MCP_ALLOWED_HOSTS

unset

Comma-separated extra hostnames permitted in Host.

MCP_ALLOWED_ORIGINS

unset

Comma-separated extra browser origins permitted in Origin.

Put the reverse-proxy hostname in MCP_ALLOWED_HOSTS when fronting the container, otherwise the guard rejects the proxied Host. Running uv run python stockscreen.py remains the stdio-compatible default outside Docker.

Run validation with uv lock --check, uv run ruff check ., uv run mypy ., uv run pytest, uv build, and uv run python scripts/verify_wheel.py. CI also builds the container and performs health plus MCP tool-discovery checks over Streamable HTTP. Domain/provider/persistence branch coverage is gated at 90%. Set YFINANCE_LIVE=1 to opt into live shape smoke tests.

Available Tools

4 tools
get_screening_resultC

Retrieve a saved screening result.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSafe persistence name

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataYes
successYes
providerYes
warningsYes
timestampYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Retrieve' implies a read-only operation, but there is no statement about side effects, failure behavior (e.g., missing name), permissions, or whether results can only be read. This is minimal coverage for an unannotated tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a short single sentence with no filler and the verb is front-loaded. However, it is so minimal that it leans toward under-specification rather than purposeful conciseness; it could have added a short usage note without losing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter retrieval tool with an output schema, the description is adequate but not thorough. It doesn't confirm read-only semantics or clarify the relationship between the input name and previously run screens, but the output schema does resolve some return-value ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the name property already carries its own description ('Safe persistence name'), so the tool description adds no parameter meaning. Per the rubric, a baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Retrieve') and a clear resource ('saved screening result'), which distinguishes it from sibling tools like run_stock_screen that would create or run a new screen. It doesn't describe what the result contains, but the core action is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance on when to use this tool versus siblings such as run_stock_screen. The word 'saved' implies it is for previously stored results, but the description never states a direct comparison, when not to use it, or what makes it preferable over running a new screen.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_stock_newsB

Get normalized recent Yahoo Finance news.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesYahoo Finance ticker symbol
days_backNoMaximum news age in days

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataYes
successYes
providerYes
warningsYes
timestampYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are absent, so the description must carry the full burden of disclosing behavior. It only states that the output is normalized news and recent, which gives a minimal idea of the data nature but does not mention what exactly happens (e.g., returns a list, sorting, pagination, rate limits, or whether it is strictly read-only). This is adequate only at the most basic level.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no redundant words or promotional fluff. It directly achieves its purpose and is perfectly sized for the tool's simplicity. Nothing extra needs to be removed or rewritten.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, has only two parameters fully described in the schema, and has an output schema, so the description need not explain return values. The overall context is clear enough to call the tool correctly, though adding 'from a given Yahoo Finance symbol' would make it even more self-contained. Still, given the combined context, it is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not add meaning beyond the input schema, but the schema itself has 100% description coverage for both parameters ('Yahoo Finance ticker symbol' and 'Maximum news age in days'), so the baseline of 3 is appropriate. The description word 'recent' does loosely reflect days_back, but no extra detail is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Get') and resource ('normalized recent Yahoo Finance news'), clearly indicating a news retrieval operation. It does not explicitly differentiate itself from sibling tools like run_stock_screen or get_screening_result, but the nature of these sibling tools is clearly distinct, so the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus the sibling tools. The description does not mention typical use cases, alternatives, or any conditions that would steer the agent toward or away from this tool. The only contextual clue is the name and the schema, which is insufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

manage_watchlistA

Create, update, delete, or retrieve a safely persisted watchlist.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSafe persistence name
actionYesWatchlist action
symbolsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataYes
successYes
providerYes
warningsYes
timestampYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the disclosure burden. It does state that the watchlist is safely persisted and includes destructive delete operations, which is helpful. However, it does not explain what 'safely persisted' actually means, whether operations are reversible, or whether any authentication or permissions are required.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence that directly communicates the tool's scope with no wasted words. Every part of the sentence contributes to understanding the tool, despite some slight vagueness in 'safely persisted.'

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description and output schema cover basic invocation but leave important semantics unstated. In particular, it is unclear how 'update' behaves relative to 'create' and 'delete' (replace, overwrite, or mutate), what the preconditions are for each action, and what 'safely persisted' implies for cleanup or consistency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes two of three parameters with meaningful details (action enum and name pattern), though symbols is more generic. The description does not add further parameter-level meaning, which is acceptable at 67% schema description coverage but does not exceed the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly names the tool's purpose with specific actions (create, update, delete, retrieve) and the resource being acted on (a persisted watchlist). It also distinguishes itself from sibling tools like run_stock_screen and get_stock_news, which are not watchlist management operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (whenever the agent needs to manage a watchlist) but does not explicitly articulate when not to use it or how it relates to the sibling tools. It provides no direct comparison or exclusion guidance, leaving the agent to infer context from the tool name and sibling set.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_stock_screenB

Run a legacy technical, fundamental, options, news, or custom screen.

ParametersJSON Schema
NameRequiredDescriptionDefault
criteriaYesCriteria for the selected legacy screen category
watchlistNo
save_resultNo
screen_typeYesLegacy stock-screen category

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataYes
successYes
providerYes
warningsYes
timestampYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing side effects. The parameters watchlist and save_result suggest possible persistence or retrieval, but their purpose is not explained in the description. The tool might write results or consult a watchlist, yet the description only says 'run a screen', which is ambiguous regarding side effects and state changes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no redundant wording. It efficiently communicates the core purpose and enumerates the screen types without unnecessary detail, making it easy to parse and understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters including a nested object and an output schema, the description is far too brief. It does not explain the structure of the criteria object, the meaning of watchlist and save_result, the expected behavior for each screen_type, or what the returned data will look like. The agent cannot confidently invoke the tool correctly based on this description alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 50% (criteria and screen_type have meaningful descriptions; watchlist and save_result only have the generic 'Safe persistence name'). The tool description does not add any clarification for these parameters, nor does it explain what 'criteria' should contain or how watchlist and save_result are used. The description fails to compensate for the missing schema detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Run') and the resource ('stock screen'), and enumerates the specific screen categories (technical, fundamental, options, news, custom). It distinguishes the tool from siblings such as manage_watchlist, get_screening_result, and get_stock_news, which handle different aspects of screening work.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus the sibling tools. It does not mention that it is for executing a screen to get results, nor does it contrast with retrieve_screening_result or manage_watchlist. The phrase 'legacy' hints at a deprecated nature but is not elaborated, leaving the agent without clear selection criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv2.0.0
    • First observedget_screening_result
    • First observedget_stock_news
    • First observedmanage_watchlist
    • First observedrun_stock_screen

TDQS

B3.3/5.0

Scored across 4 tools

Disambiguation4/5

Each tool targets a distinct purpose: screening, watchlist management, result retrieval, and news. However, get_screening_result could be confused with run_stock_screen if users expect immediate output from the latter, though descriptions help clarify.

Naming Consistency4/5

Tool names are consistent in verb_noun format (run_, manage_, get_, get_). The only minor deviation is manage_watchlist using 'manage' instead of a more specific action verb, but the pattern is largely uniform.

Tool Count4/5

Four tools is reasonable for a stock screening and watchlist server, though the scope could justify a few more (e.g., get_watchlist separate from manage). It is slightly thin but not inadequate for core functionality.

Completeness3/5

The server covers screening, saving results, retrieving saved results, and watchlist management. However, it lacks tools for updating or deleting screening results, or performing actions beyond retrieval on these results, leaving notable lifecycle gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to retrieve real-time stock data, manage watchlists, and perform comprehensive technical analysis using Yahoo Finance API. Provides 18+ tools for stock price tracking, trend analysis, volatility assessment, and financial indicators through MCP integration.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to retrieve stock market data and financial information from Yahoo Finance using the yfinance Python library. Supports querying stock prices, historical data, and other financial metrics through natural language.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides comprehensive financial data from Yahoo Finance, enabling retrieval of stock prices, company information, financial statements, options data, analyst recommendations, and market news through natural language queries.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides real-time stock quotes, historical data, and stock search via Yahoo Finance, enabling AI assistants to access and analyze financial market data.
    18
    19
    MIT