mcpField
T
Twelvedata

Twelvedata

远程服务
pipeworx.io金融数据05 周前更新

关于 Twelvedata

Twelvedata 是通过 Pipeworx 提供股票、ETF、外汇和加密货币数据的 MCP 服务,面向需要调用市场数据的 Agent。提供本地 stdio 独立运行方式,也可通过网关访问。

主要功能

  1. 01查询 OHLC 时间序列与报价
  2. 02获取外汇汇率并换算金额
  3. 03检索股票、ETF、指数及币种
  4. 04查看财报日历、分红与拆股

适用场景

  1. 01查看某股票的最新价格或历史行情
  2. 02换算两种货币间的金额
  3. 03筛选即将发布财报的公司
  4. 04查询 ETF、指数或加密货币标的

MCP 相关

向 MCP 客户端提供市场数据工具,支持 Pipeworx 网关连接及本地 stdio MCP 服务。网关连接还包含共享元工具;本地服务只提供此包的工具。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://gateway.pipeworx.io/twelvedata/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

工具

详细介绍

@pipeworx/twelvedata

Twelve Data MCP — 股票、ETF、外汇和加密货币数据。每天免费提供 800 次请求。

属于 Pipeworx — 一个将 AI Agent 连接到 1684+ 个实时数据源的 MCP 网关。

认证

  • 平台:PLATFORM_TWELVEDATA_KEY。自带密钥:?_apiKey=…。

工具

  • time_series(symbol, interval, exchange?, mic_code?, country?, type?, outputsize?, prepost?, dp?, order?, timezone?, date?, start_date?, end_date?, previous_close?, format?, delimiter?) — OHLC 时间序列
  • quote(symbol, interval?, exchange?, country?, format?, dp?, prepost?, timezone?, eod?) — 报价快照
  • price(symbol, format?, prepost?) — 最新价格
  • eod(symbol, exchange?, mic_code?, country?, type?, prepost?, dp?, format?) — 日终报价
  • exchange_rate(symbol, format?, dp?, timezone?) — 外汇汇率(例如 EUR/USD)
  • currency_conversion(symbol, amount, format?, dp?) — 外汇换算
  • stocks(symbol?, exchange?, mic_code?, country?, type?, format?) — 股票代码
  • forex_pairs(symbol?, currency_base?, currency_quote?, format?) — 外汇货币对
  • cryptocurrencies(symbol?, exchange?, currency_base?, currency_quote?, format?) — 加密货币代码
  • etfs(symbol?, exchange?, mic_code?, country?, page?, outputsize?) — 分页获取 ETF 代码(默认 200 行;count 为总数)。股票代码会返回 empty_reason: wrong_instrument_class,并指向 stocks。
  • indices(symbol?, country?, exchange?, mic_code?, page?, outputsize?) — 分页获取指数代码。仅包含约 1,300 个非美国指数:Twelve Data 的参考列表中没有美国指数(SPX、DJI、IXIC),查询它们需要 Grow 或更高级别的密钥,通过 _apiKey 提供;筛选美国指数时会返回拒绝响应,而不是空列表。
  • earnings(symbol, exchange?, country?, mic_code?, type?, period?, outputsize?, format?, dp?, start_date?, end_date?) — 财报日历
  • earnings_calendar(start_date?, end_date?, country?, format?, dp?) — 综合财报日历
  • dividends(symbol, exchange?, country?, mic_code?, range?, start_date?, end_date?) — 股息
  • splits(symbol, exchange?, country?, mic_code?, range?, start_date?, end_date?) — 拆股
  • profile(symbol, exchange?, country?, mic_code?) — 公司简介

数据源

https://api.twelvedata.com

快速开始

添加到你的 MCP 客户端(Claude Desktop、Cursor、Windsurf 等):

{
  "mcpServers": {
    "twelvedata": {
      "url": "https://gateway.pipeworx.io/twelvedata/mcp"
    }
  }
}
此端点实际提供的内容

https://gateway.pipeworx.io/twelvedata/mcp 上的 tools/list 会返回上表中的工具,以及 Pipeworx 通用元工具 — ask_pipeworx、 discover_tools、search_within、remember/recall 和网关通用工具集中的其他工具。因此,你看到的工具数量会多于此表:目前,单个工具包端点除了该工具包自身的工具外,还会列出约 30 个通用工具。连接的 initialize 响应会说明其确切范围,是当天情况的权威依据。

这是有意设计的,并非意外的多路复用。元工具让限定范围的连接也能通过 ask_pipeworx 回答此工具包未涵盖的问题;该工具会在整个目录中路由,因此你无需再添加第二个 MCP 服务。目前无法挂载不包含这些元工具的工具包端点;如果额外的架构定义占用的上下文超过路由功能带来的价值,可以改为连接一次完整网关,而不是连接多个工具包端点。

或者连接完整的 Pipeworx 网关,直接列出每个工具包的工具,而不只是当前工具包的工具:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://gateway.pipeworx.io/mcp"
    }
  }
}

两个 URL 都连接到同一个网关和相同的 1684+ 个数据源。唯一的区别是哪些工具包的工具会被直接列出;无论连接哪个端点,ask_pipeworx 都能访问所有工具。

没有 MCP 客户端?通过 HTTP 调用

curl -X POST https://gateway.pipeworx.io/v1/tools/time_series \
  -H 'Content-Type: application/json' \
  -d '{"symbol":"AAPL","interval":"1h"}'

首次调用无需账户。查看任意工具:GET https://gateway.pipeworx.io/v1/tools/time_series。查找工具:使用 {"query":"..."} 调用 POST https://gateway.pipeworx.io/v1/tools/search_packs。

独立运行(无需网关账户)

此软件包也可作为本地 stdio MCP 服务运行,无需 Pipeworx 账户,也无需经过网关往返:

{
  "mcpServers": {
    "twelvedata": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-twelvedata"]
    }
  }
}

也可以直接运行,确认它能正常启动:

npx -y @pipeworx/mcp-twelvedata

它通过 stdin/stdout 使用 MCP 通信,并针对仅限此软件包的工具响应 initialize/tools/list/tools/call——不包含上方网关连接所添加的任何共享元工具。相同的源代码,相同的工具,无需 ask_pipeworx 路由。

使用 ask_pipeworx

你也可以用通俗的英语提问,而不是直接调用工具——这既适用于上方的软件包端点,也适用于完整网关:

ask_pipeworx({ question: "your question about Twelvedata data" })

网关会选择合适的工具并自动填写参数。

更多信息

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。