market-pulse-mcp
market-pulse-mcp
一个小巧、专注的 MCP(Model Context Protocol)服务器,为 LLM 提供实时加密货币市场数据:现货价格、OHLCV K 线、订单簿快照、永续合约资金费率,以及若干从头计算的技术指标。每个数据源都是公开的、无需密钥的交易所 API,因此无需任何配置,也无需创建账户。
由 Brandon Perez(@remybanks77)构建,作为作品集项目,展示了一个简洁的 MCP 服务器实现:类型化 Python、很小的依赖体积,以及手写的指标计算,而非从 pandas 或 ta-lib 引入。
它能做什么
market-pulse-mcp 通过 MCP stdio 传输暴露六个工具:
工具 | 描述 | 数据源 |
| 当前现货价格、最优买/卖价、24 小时成交量 | Coinbase Exchange |
| OHLCV K 线 | Coinbase Exchange |
| 最优盘口快照、价差、买卖挂单失衡 | Coinbase Exchange |
| 永续合约资金费率、标记价格、未平仓量 | Hyperliquid |
| RSI(14)、EMA(20/50)、ATR(14)、已实现波动率 | Coinbase Exchange(本地计算) |
| 结合上述数据的紧凑多资产表格 | Coinbase Exchange + Hyperliquid |
符号是简单的基础代码:"BTC"、"ETH"、"SOL"。尾部的 -USD 或 /USD 会被容忍并自动剥离,因此 "BTC-USD" 和 "BTC" 是等价的。
Related MCP server: MCP Crypto Market Data Server
安装
使用 uv(推荐)
git clone https://github.com/remybanks77/market-pulse-mcp.git
cd market-pulse-mcp
uv venv
uv pip install -e ".[dev]"使用 pip
git clone https://github.com/remybanks77/market-pulse-mcp.git
cd market-pulse-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"两种方式都会安装一个 market-pulse-mcp 控制台脚本,用于通过 stdio 运行服务器。
在 Claude Code 中配置
将以下内容添加到项目的 .mcp.json 中(或运行 claude mcp add):
{
"mcpServers": {
"market-pulse": {
"command": "market-pulse-mcp",
"args": []
}
}
}如果你没有安装到活动的 virtualenv 中,请将 command 直接指向该 venv 的二进制文件,例如 /path/to/market-pulse-mcp/.venv/bin/market-pulse-mcp。
在 Claude Desktop 中配置
将以下内容添加到 claude_desktop_config.json(macOS:~/Library/Application Support/Claude/claude_desktop_config.json,Windows:%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"market-pulse": {
"command": "/absolute/path/to/market-pulse-mcp/.venv/bin/market-pulse-mcp"
}
}
}保存后重启 Claude Desktop。market-pulse 服务器应出现在锤子/工具图标下,并列出其六个工具。
示例对话
User: What's BTC doing right now, and is it overbought?
Claude: [calls get_price("BTC")]
[calls compute_indicators("BTC", granularity="1h", limit=200)]
BTC is at $109,842 (bid $109,838 / ask $109,846). On the 1h chart:
- RSI(14): 68.4, approaching overbought but not there yet (>70)
- EMA(20) $109,510 above EMA(50) $108,220: short-term trend is bullish
- ATR(14): $412, so a typical 1h range is roughly 0.4% of price
- Realized vol (annualized): 47.9%
Not screaming overbought, but RSI is climbing. Want me to check the order
book for signs of resistance near current price, or pull funding rates to
see how leveraged longs are positioned?
User: Check funding, and give me a quick scan of BTC, ETH, and SOL.
Claude: [calls get_funding_rate("BTC")]
[calls market_summary(["BTC", "ETH", "SOL"])]
Funding on BTC perps (Hyperliquid): 0.0057% per 8h (about 6.2% annualized).
Mildly long-skewed, nothing extreme.
Quick scan:
BTC $109,842 RSI 68.4 bullish funding +6.2%/yr
ETH $3,912 RSI 61.2 bullish funding +4.8%/yr
SOL $198.30 RSI 54.9 flat funding +2.1%/yr
All three trending up on the hourly with positive funding. Nothing at a
extreme RSI level right now.设计说明
为什么手写指标计算,而不是使用 pandas 或 ta-lib。 这个服务器的全部意义就在于成为一个小型、可审计的依赖:只有 mcp 和 httpx,没有其他。引入 pandas 来实现四个指标公式,所带来的依赖会比服务器自身的逻辑沉重得多。market_pulse_mcp/indicators.py 直接在普通 Python 列表上实现了 SMA、EMA、Wilder RSI、Wilder ATR 以及年化已实现波动率(基于对数收益率),每个公式都针对手工推导的固定值进行了单元测试,从而验证了数学计算本身,而不仅仅是围绕它的接线。
为什么专门选择 Coinbase 和 Hyperliquid。 两者都在无需 API 密钥的情况下提供完整的市场数据:Coinbase Exchange 的公共 REST 端点(api.exchange.coinbase.com)覆盖行情、K 线和订单簿;Hyperliquid 的公共 info API(api.hyperliquid.xyz/info)通过单次 metaAndAssetCtxs 请求即可覆盖永续合约资金费率和标记价格。这使得该项目真正做到零配置:克隆它、安装它、运行它,无需注册。
速率限制处理。 Coinbase 的公共层级对速率限制非常严格(每秒仅允许几个请求)。exchanges.py 将每个请求包装在一个带指数退避的小型重试循环中:遇到 HTTP 429 和 5xx 响应时重试(最多 3 次,每次退避时间翻倍),而对于其他 4xx 错误则快速失败,因为这些错误表示请求本身有问题,而不是暂时性状况。market_summary 按符号顺序依次调用该逻辑,而不是并发发送请求,这样虽然更慢,但能让多符号扫描远低于公共速率限制。
错误处理理念。 每个工具都会捕获来自交易所客户端和指标计算的异常,并返回 {"error": "..."},而不是让 traceback 通过 MCP 传输传播出去。这样调用模型就能得到一条可读的、可据此采取行动的消息(重试、请用户更换符号等),而不是一次不透明的工具失败。
测试
pytest # offline tests only (default; see pyproject.toml)
pytest -m integration # also hit live Coinbase / Hyperliquid APIs离线测试套件(tests/test_indicators.py、tests/test_exchanges.py)是完全确定性的:指标值会与手工算出的固定值进行核对(参见每个测试中的注释),而交易所辅助函数(符号规范化、粒度解析)则是无网络访问的纯函数。集成测试套件(tests/test_integration.py)标记为 @pytest.mark.integration,默认跳过,因为它依赖实时价格和外部服务的可用性;当你想要确认客户端代码仍然匹配真实的 API 结构时,可以显式运行它。
项目结构
market_pulse_mcp/
server.py # MCPServer-based server: tool definitions, stdio entry point
exchanges.py # Coinbase + Hyperliquid HTTP clients, symbol/granularity helpers
indicators.py # RSI, EMA, ATR, realized volatility (stdlib only)
tests/
test_indicators.py # offline, fixture-based
test_exchanges.py # offline, pure-function tests
test_integration.py # live API tests, opt-in via -m integration许可证
MIT,参见 LICENSE。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides real-time and historical cryptocurrency market data from 100+ exchanges including prices, OHLCV data, market statistics, and order books through the CCXT library with intelligent caching.
- Flicense-qualityDmaintenanceProvides real-time and historical cryptocurrency market data from major exchanges through CCXT. Supports live price lookups, historical OHLCV queries, and includes lightweight caching for improved performance.
- Flicense-qualityCmaintenanceProvides real-time and historical cryptocurrency market data using ccxt, enabling users to fetch live prices, historical candlestick data, and stream real-time ticker updates across multiple exchanges.14
- AlicenseAqualityCmaintenanceProvides live cryptocurrency market data from over 100 exchanges, enabling AI agents to fetch prices, order books, funding rates, and more for trading analysis and arbitrage opportunities.131MIT
Related MCP Connectors
Live crypto data: funding rates, funding arbitrage, OI pressure, Fear & Greed. Free, no API key.
Provide real-time cryptocurrency price data and market analysis.
Real-time crypto prices from Binance, Coinbase, Kraken, OKX, and Bybit
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/remybanks77/market-pulse-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server