
CNN Fear & Greed Index
io.github.wildsurfer由 GitHub 帳號 wildsurfer 發布v2.2.0更新於 Oct 24, 2026
CNN's Fear & Greed index for the US stock market: score, rating, indicators and daily history.
概覽
讓助理取得 CNN 美國股市恐懼與貪婪指數,包含目前分數、評級、各分項指標與每日歷史資料。
- 可以做什麼
- 以 stdio 在本機執行 MCP 伺服器,只提供一個工具 get_fear_and_greed,可選參數 include_history。它回傳目前 0-100 的分數與評級、前收盤、一週前、一個月前與一年前的數值、約一年的每日歷史,以及七個分項指標(市場動能、股價強度、股價廣度、賣權/買權選擇權、市場波動率、垃圾債需求、避險需求),每項都有自己的分數、評級與原始數值序列。同一個 Go 模組也提供命令列工具與函式庫。
- 適用情境
- 適合助理需要目前或歷史美國市場情緒讀數時使用,例如摘要市場情緒、把今天的分數與過去時段比較,或查看哪些分項指標正在推動指數。它是唯讀資料來源,不是交易或分析引擎。
- 執行需求
- 需要本機執行環境:以 mcp 參數啟動 cnnfag 執行檔(可透過 Go 安裝,或使用已發布的容器映像)。MCP 用戶端必須能找到該執行檔,若未繼承 PATH 可能需要填寫完整路徑。需要連線至 CNN 資料端點的對外網路;未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 CNN Fear & Greed Index,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
cnn-fear-and-greed-parse
[Go Reference] [CI] [Coverage Status] [License: MIT] [Glama score]
Go package for CNN's Fear & Greed Index, a 0–100 gauge of US stock market sentiment. It returns the current score and rating, the values for the previous close, week, month and year, about a year of daily history, and the seven component indicators (market momentum, stock price strength, stock price breadth, put/call options, market volatility, junk bond demand, safe haven demand), each with its own score, rating and history of raw values. The module also ships a CLI and an MCP server, and has no dependencies outside the Go standard library.
Install
Usage
Output:
An Indicator's History holds the raw underlying series (the S&P 500 level for momentum, the VIX level for volatility, ratios and spreads for the rest), and its Score is CNN's 0–100 normalization. To use your own http.Client (timeout, proxy), replace cnnfag.HTTPClient.
CLI
For cron jobs and shell pipelines, without writing Go:
-json prints the full result, including the daily history. -timeout changes the request timeout (default 15s).
MCP server
cnnfag mcp runs a Model Context Protocol server over stdio, so AI assistants can query the index. It exposes one tool, get_fear_and_greed, with an optional include_history argument. Configuration for MCP clients:
The client must be able to find the binary: use the full path (usually ~/go/bin/cnnfag) if your MCP client does not inherit your shell's PATH. Like the rest of the module, the server is built on the standard library only.
The server is also published to the MCP Registry as io.github.wildsurfer/cnnfag, with a container image at ghcr.io/wildsurfer/cnnfag for clients that prefer Docker over a local binary.
How it works
CNN does not offer a documented public API. This package requests the JSON endpoint that the Fear & Greed page itself uses:
The endpoint rejects requests that do not look like they come from a browser, so the package sends browser-like User-Agent and Referer headers. This is the same data source used by the known wrappers in other languages.
A scheduled CI job runs the test suite against the real endpoint once a week, so a change on CNN's side is detected within days.
Migrating from v1
v2 is a full rewrite: CNN removed the HTML page that v1 parsed, so v1 stopped working and its data model no longer matches what CNN publishes. Update the import path first:
Then adjust the calls:
Scores changed from rounded integers to the exact floats CNN serves, so 44 in v1 corresponds to something like 43.71 in v2. Round with %.0f or math.Round if you need the old look.
Project history
v1 (2021) parsed the HTML of money.cnn.com/data/fear-and-greed with goquery and could also download the index needle image. CNN removed that page, which broke parsing, and the image no longer exists. v2 (2026) is a rewrite on the JSON endpoint with a smaller API, historical data and zero dependencies. The last v1 release is tagged v1.2.0.
Data disclaimer
This package is not affiliated with or endorsed by CNN. The Fear & Greed Index and its values belong to CNN (Warner Bros. Discovery). The MIT license covers only the code in this repository and gives you no rights to CNN's data. CNN's Terms of Use permit personal use of site content and restrict commercial exploitation. If you use this data in a product, compliance is your responsibility, and the endpoint can change or disappear at any time.
License
來源:README.md,提交 e1955e7
工具
0版本歷史
1- v2.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分