Skip to main content
Glama

MCP Stock Market

by ctoouli

MCP股票市场

一个使用 Alpha Vantage API 检索股票市场数据的模型上下文协议 (MCP) 工具。该工具通过简单的 MCP 界面提供任何股票代码的每日股票市场数据访问。

要求

  • Node.js v18 或更高版本
  • Alpha Vantage API 密钥(提供免费套餐)

设置

  1. 安装依赖项
    npm install
  2. 根据.env.example创建一个.env文件并添加您的 Alpha Vantage API 密钥
    ALPHA_VANTAGE_API_KEY=your_api_key_here
    您可以从Alpha Vantage获取免费的 API 密钥。
  3. 构建项目
    npm run build

MCP 客户端配置

要将此工具与您的 MCP 客户端一起使用,您需要更新 MCP 服务器配置。请将以下内容添加到您的客户端配置中:

{ "mcpServers": { "stock-market": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-stock-market/build/index.js" ] } } }

确保将/ABSOLUTE/PATH/TO/PARENT/FOLDER替换为包含此存储库的父目录的实际绝对路径。

可用工具

获取股票数据

检索特定股票代码的每日股票市场数据。

参数:

  • symbol :股票代码(例如 IBM、AAPL、MSFT、GOOG、AMZN)

MCP 客户端中的示例用法:

@stock-market get-stock-data symbol=AAPL

响应示例:

Stock: AAPL Last Updated: 2025-03-12 Time Zone: US/Eastern Daily Prices: Date: 2025-03-12 Open: $178.35 High: $180.13 Low: $177.53 Close: $179.63 Volume: 58,492,206 --- Date: 2025-03-11 Open: $177.99 High: $179.70 Low: $176.86 Close: $178.95 Volume: 62,630,570 ---

发展

项目结构

  • src/index.ts - 包含 MCP 服务器和工具实现的主应用程序文件
  • build/ ——编译后的 JavaScript 输出
  • .env - 环境变量(API 密钥)

命令

  • npm run build构建 TypeScript 代码

API 使用说明

此工具使用 Alpha Vantage API 检索股票市场数据。Alpha Vantage 的免费套餐有以下限制:

  • 每天 25 次 API 调用
  • 每分钟 5 次 API 调用

如果您需要更多容量,请考虑升级到他们的高级计划。

故障排除

如果您遇到问题:

  1. 确保您的 Alpha Vantage API 密钥在.env文件中正确设置
  2. 检查您是否正在使用 Node.js 版本 18 或更高版本
  3. 验证 MCP 客户端配置中的路径是否正确
  4. 重启 MCP 客户端
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议工具,使用 Alpha Vantage API 检索任何股票代码的每日股票市场数据。

  1. 要求
    1. 设置
      1. MCP 客户端配置
        1. 可用工具
          1. 获取股票数据
        2. 发展
          1. 项目结构
          2. 命令
        3. API 使用说明
          1. 故障排除

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol (MCP) server that provides real-time access to financial market data through the free Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes and company information.
              Last updated -
              5
              30
              Python
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              Allows Claude and other MCP clients to access real-time and historical stock market data from Alpha Vantage API, including intraday and daily stock data with customizable intervals.
              Last updated -
              3
              3
              TypeScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.
              Last updated -
              9
              2
              Python
              MIT License
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that enables LLMs to access comprehensive financial data from Alpha Vantage API, including stock prices, fundamentals, forex, crypto, and economic indicators.
              Last updated -
              94
              12
              JavaScript

            View all related MCP servers

            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/ctoouli/mcp-stock-market'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server