JS

jesusrs1/stock-trade-finance-api

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

138 stars 312 forks 质量 52 趋势 44NOASSERTION

Tiingo的股票交易MCP服务器通过MCP程序化提供股票价格、新闻、外汇和基本面信息

概览

一个模型上下文协议(MCP)服务器,将各种Tiingo API端点作为工具开放。该服务器允许通过MCP协议程序化访问包括股票价格、新闻、外汇、基本面和公司行为在内的金融数据。 - Node.js(推荐v18或更高版本)- npm(自带Node.js)- Tiingo API密钥- 兼容MCP的客户端或运行器(例如VSCode扩展、CLI) 3. 使用该服务器需要 Tiingo API 令牌。1. 如果没有 Tiingo 账户,请注册。2. 访问您的 Tiingo 账户页面,进入 API 令牌部分(或直接访问:https://www.tiingo.com/account/api/token). 3.复制您的 API 令牌。您需要将该令牌提供给 MCP 客户端以进行 Tiingo API 认证。注意:Tiingo 不支持程序注册或登录功能;API 令牌是唯一的认证方式。 4. 该服务器需要您的Tiingo API密钥。

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,将各种Tiingo API端点作为工具开放。该服务器允许通过MCP协议程序化访问包括股票价格、新闻、外汇、基本面和公司行为在内的金融数据。

先修条件

  • Node.js(推荐v18或更高版本)
  • NPM(随Node.js附赠)
  • Tiingo API 密钥
  • 兼容MCP的客户端或运行器(例如,VSCode扩展,CLI)

布置

  1. 克隆仓库或确保你在项目目录中。

  2. 安装依赖:

  3. 获取你的Tiingo API密钥: 要使用这个服务器,你需要一个Tiingo API令牌。

  4. 如果你还没有Tiingo账户,请注册。

  5. 访问你的Tiingo账户页面,进入API令牌部分(或直接访问:https://www.tiingo.com/account/api/token).

  6. 复制你的 API 令牌。你需要将该令牌提供给你的 MCP 客户端,以便通过 Tiingo API 进行身份验证。 注意:Tiingo不支持程序注册或登录;API令牌是唯一的认证方式。

  7. Set tiingo API Key: 该服务器需要你的Tiingo API密钥。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Stock Trade MCP Server

A Model Context Protocol (MCP) server that exposes various Tiingo API endpoints as tools. This server allows programmatic access to financial data including stock prices, news, forex, fundamentals, and corporate actions via the MCP protocol.

Prerequisites

  • Node.js (v18 or later recommended)
  • npm (comes with Node.js)
  • A Tiingo API Key
  • MCP-compatible client or runner (e.g., VSCode extension, CLI)

Setup

  1. Clone the repository or ensure you are in the project directory.

  2. Install dependencies:

    npm install
    
  3. Obtain Your Tiingo API Key: To use this server, you need a Tiingo API token.

    1. Register for a Tiingo account if you don’t have one.
    2. Go to your Tiingo Account page and navigate to the API Token section (or directly visit: https://www.tiingo.com/account/api/token).
    3. Copy your API Token. You will need to provide this token to your MCP client to authenticate with the Tiingo API. Note: Programmatic registration or logins are not supported by Tiingo; the API token is the sole method for authentication.
  4. Set Tiingo API Key: This server requires your Tiingo API key. You can typically provide the API key in your MCP client’s configuration (see “Running the Server” below for an example).

  5. Build the server:

    npm run build
    

    This will create a build directory with the compiled JavaScript code.

Running the Server

  • Via MCP runner: Configure your MCP client to run the server using stdio transport. You can provide the TIINGO_API_TOKEN in the env block of the configuration. Example MCP settings entry:
    "mcp-tiingo": {
      "transportType": "stdio",
      "command": "node",
      "args": [
        "/path/to/mcp-tiingo/build/index.js"
      ],
      "env": {
        "TIINGO_API_TOKEN": "YOUR_API_KEY_HERE"
      }
      // ... other optional settings ...
    }
    
    (Replace /path/to/mcp-tiingo and YOUR_API_KEY_HERE accordingly)

Available Tools

The server exposes the following Tiingo API endpoints as tools via MCP:

get_end_of_day_prices

  • Description: Fetches End-of-Day prices for a given ticker symbol with optional date range and format.
  • Key Inputs: ticker, startDate, endDate, resampleFreq

get_news

  • Description: Fetches news articles from Tiingo with various filtering options.
  • Key Inputs: tickers, tags, sources, startDate, endDate, limit

get_forex_prices

  • Description: Fetches historical intraday Forex prices for a given ticker symbol with optional date range and frequency.
  • Key Inputs: ticker, startDate, endDate, resampleFreq

get_forex_top_of_book

  • Description: Fetches real-time Forex Top-of-Book/Last data for one or more ticker symbols.
  • Key Inputs: ticker or tickers

get_fundamentals_definitions

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →