StockPrice
This server provides tools for stock price data and screening Japanese stocks.
StockPrice: Fetches current and historical stock price information from Yahoo Finance for a given symbol (e.g.,
AAPL,7203.T). Returns details like price, volume, etc.ScreenStocks: Filters stocks on the Tokyo Stock Exchange Prime Market (default) based on a variety of financial metrics, including:
PER (trailing or forward)
PBR
Dividend yield
Market capitalization
Stock price
Trading volume (daily or 3-month average)
Day-over-day price change percentage
EPS, BPS, and 52-week price change
Supports custom filtering with operators (
gte,lte,gt,lt,eq) combined with AND logic.Optionally filter by one of 33 TSE industry sectors or specify target symbols.
Sort results by any supported metric (ascending/descending) and limit the number returned (up to 200).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@StockPriceWhat's the current price of AAPL?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
stock-mcp
Yahoo Finance から株価情報を取得する MCP サーバーです。
セットアップ
npm installRelated MCP server: YFinance MCP Server
開発起動
npm run devビルド
npm run buildMCP クライアント設定
このサーバーは stdio transport で起動します。MCP クライアントには、ビルド後の build/index.js を node で実行するように設定します。
事前にビルドしてください。
npm install
npm run buildCodex
~/.codex/config.toml またはプロジェクトの .codex/config.toml に設定します。
[mcp_servers.stock-mcp]
command = "node"
args = ["/path/to/stock-mcp/build/index.js"]CLI で追加する場合:
codex mcp add stock-mcp -- node /path/to/stock-mcp/build/index.jsClaude Code
Claude Code の MCP 設定は JSON の mcpServers 形式です。プロジェクトで共有する場合は .mcp.json に設定します。
{
"mcpServers": {
"stock-mcp": {
"command": "node",
"args": [
"/path/to/stock-mcp/build/index.js"
]
}
}
}CLI で追加する場合:
claude mcp add --transport stdio stock-mcp -- node /path/to/stock-mcp/build/index.js開発用設定
開発中に TypeScript のまま起動したい場合は、各クライアントで npm --prefix ... run dev を実行するように設定します。
Codex:
[mcp_servers.stock-mcp]
command = "npm"
args = [
"--prefix",
"/path/to/stock-mcp",
"run",
"dev",
]Claude Code:
{
"mcpServers": {
"stock-mcp": {
"command": "npm",
"args": [
"--prefix",
"/path/to/stock-mcp",
"run",
"dev"
]
}
}
}設定後、MCP クライアントを再起動すると StockPrice と ScreenStocks のツールを利用できます。
MCP ツール
サーバー名:
stock-mcpStockPrice:symbolに銘柄コードを指定して株価情報を取得します。ScreenStocks: 東証プライムの銘柄を、PER や配当利回りなどの条件で絞り込みます。
StockPrice
入力
パラメータ | 型 | 必須 | 説明 |
| string | Yes | 銘柄コード。米国株は |
例:
{
"symbol": "AAPL"
}出力
yahoo-finance2 の quote() の結果を、加工せず JSON 文字列にしてテキストコンテンツで返します。フィールドの内容は yahoo-finance2 および Yahoo Finance 側の仕様に従うため、詳細は下記を参照してください。
エラー時も yahoo-finance2 が投げた内容がそのまま MCP のツールエラーとして返ります。
ScreenStocks
指定した条件をすべて満たす銘柄だけを返します。
yahoo-finance2 にも screener() はありますが、指定できるのは day_gainers や undervalued_large_caps といった定義済みのプリセットで、任意の条件を組み立てることはできません。region パラメータはあるものの、JP を指定しても返るのは米国株でした。日本株を独自の条件で絞り込む用途には不十分なため、銘柄一覧を JPX から、指標を Yahoo Finance から取得して、絞り込みはこのサーバーで行います。
入力
パラメータ | 型 | 必須 | 説明 |
| array | Yes | 絞り込み条件。すべてを満たす銘柄が対象(AND 条件) |
| array | No | 対象銘柄。省略すると東証プライムの全銘柄が対象 |
| string | No | 33 業種区分での絞り込み(例: |
| string | No | 並び替えに使う指標 |
| string | No |
|
| number | No | 返す件数の上限。1〜200(既定: 20) |
symbols は証券コードのままでも指定できます。7203 や 166A のように先頭が数字の 4〜5 桁は .T を補って Yahoo Finance のシンボルに変換します(7203 → 7203.T)。. を含む文字列はそのまま使います。
filters の各要素は field(指標)、op(比較演算子)、value(しきい値)を持ちます。op は gte(以上)、lte(以下)、gt(超)、lt(未満)、eq(等しい)です。
指定できる field と sortBy:
指標 | 内容 |
| 実績 PER(倍) |
| 予想 PER(倍) |
| PBR(倍) |
| 配当利回り(%) |
| 時価総額(円) |
| 株価(円) |
| 出来高(株) |
| 平均出来高・3ヶ月(株) |
| 前日比(%) |
| EPS(円) |
| BPS(円) |
| 52 週騰落率(%) |
例(PER 15 倍以下・PBR 1 倍以下・配当利回り 3.5% 以上を、利回り順に 8 件):
{
"filters": [
{ "field": "trailingPE", "op": "lte", "value": 15 },
{ "field": "priceToBook", "op": "lte", "value": 1.0 },
{ "field": "dividendYield", "op": "gte", "value": 3.5 }
],
"sortBy": "dividendYield",
"order": "desc",
"limit": 8
}出力
条件と sortBy に使った指標だけを返します(株価は常に含みます)。全銘柄の生データは返しません。
{
"evaluated": 1559,
"fetched": 1558,
"matched": 171,
"returned": 8,
"elapsedMs": 2036,
"fieldLabels": { "trailingPE": "実績PER(倍)" },
"results": [
{
"symbol": "6358.T",
"name": "酒井重工業",
"sector": "機械",
"regularMarketPrice": 2135,
"trailingPE": 10.383737,
"priceToBook": 0.5794713,
"dividendYield": 6.06
}
]
}evaluated は対象銘柄数、fetched は指標を取得できた銘柄数です。指標が欠けている銘柄は条件を判定できないため対象外になります。
データの取得元と注意点
銘柄一覧は JPX の東証上場銘柄一覧(
data_j.xls)から取得し、市場・商品区分がプライム(内国株式)の銘柄を対象にします取得結果は
~/.cache/stock-mcp/jpx-prime.jsonに 7 日間キャッシュします。元ファイルが月次更新のため、上場・廃止の反映は最大 7 日遅れます株価・指標は Yahoo Finance から取得します。日本株は約 20 分遅延です
プライム全銘柄を対象にすると、Yahoo へのリクエストは 250 銘柄ずつ 7 回程度になります(実測 約 2 秒)
Available Tools
1 toolStockPriceB
Yahoo Finance から株価情報を取得します。
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of disclosing behavioral traits. It only states that the tool retrieves data, implying a read operation, but does not explain return format, error behavior, rate limits, or any side effects. This lack of transparency is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence, 'Yahoo Finance から株価情報を取得します。' It is front-loaded and contains no fluff or redundant information. It effectively communicates the core purpose in minimal space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, no annotations, and a very minimal input schema. The description does not compensate for this by explaining what the returned data looks like, how to format the symbol, or any limitations. It fails to provide adequate context for an agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one required parameter 'symbol' with no description, and the schema description coverage is 0%. The tool description does not mention the parameter at all, leaving the agent to infer that 'symbol' represents a stock ticker from the tool name. This minimal inference is insufficient for proper parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: it retrieves stock price information from Yahoo Finance. The verb '取得します' (retrieves) and the resource '株価情報' (stock price information) are specific and unambiguous. Since there are no sibling tools, no differentiation is needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool or under what circumstances. It does not mention alternatives, prerequisites, or typical use cases. There are no sibling tools, but the absence of any usage context leaves the agent without direction.
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 tool update
v1.0.0- First observed
StockPrice
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusing it with other tools. The tool's purpose is singular and unambiguous.
A single tool name 'StockPrice' is clear and self-descriptive. While there is no pattern to compare against, the naming is consistent and follows a standard camelCase convention.
The server has only one tool, which feels too few for a domain like stock prices that typically requires multiple operations (e.g., getting quotes, historical data, or search). The scope appears under-served.
The tool offers only a generic stock price fetch, but a complete stock information service would likely need historical data, symbol lookup, and perhaps market summaries. The current surface is too narrow for a 'StockPrice' server.
Maintenance
Related MCP Connectors
MCP server for stocksense-ai documentation, generated by doc2mcp.
Finnhub MCP — wraps Finnhub Stock API (finnhub.io)
MCP server with quote and live cryptocurrency price tools, local and cloud-deployed transports.
Alpaca MCP — real-time US stock market data via the Alpaca Market Data API
Related MCP Servers
- AlicenseAqualityAmaintenanceA simple MCP server for Yahoo Finance using yfinance. This server provides a set of tools to fetch stock data, news, and other financial information.15191MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that provides seamless access to Yahoo Finance stock market data, enabling retrieval of real-time quotes, historical data, charts, financial summaries, and market searches.35 npmISC
- AlicenseAqualityCmaintenanceAn MCP server that exposes comprehensive Yahoo Finance data (quotes, financials, options, news, and more) to AI agents via the yfinance library, requiring no API key.24MIT
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP server for accessing Yahoo Finance data, providing stock prices, history, company information, and financial statements.-