Financial Datasets

ทางการ

API ตลาดหุ้นที่สร้างขึ้นสำหรับ AI agents

คุณทำอะไรได้บ้างด้วย Financial Datasets MCP?

  • Fetch income statements — Retrieve a company's income statements using get_income_statements.
  • Fetch balance sheets — Retrieve a company's balance sheets using get_balance_sheets.
  • Fetch cash flow statements — Retrieve a company's cash flow statements using get_cash_flow_statements.
  • Get current stock or crypto prices — Look up the latest price for a ticker via get_current_stock_price or get_current_crypto_price.
  • Get historical stock or crypto prices — Pull historical price data for a date range using get_historical_stock_prices or get_historical_crypto_prices.
  • Get company news — Retrieve recent news articles for a company with get_company_news.

เอกสาร

Financial Datasets MCP Server

บทนำ

นี่คือเซิร์ฟเวอร์ Model Context Protocol (MCP) ที่ให้การเข้าถึงข้อมูลตลาดหุ้นจาก Financial Datasets

ช่วยให้ Claude และผู้ช่วย AI อื่นๆ สามารถดึงงบกำไรขาดทุน งบดุล งบกระแสเงินสด ราคาหุ้น และข่าวสารตลาดได้โดยตรงผ่านอินเทอร์เฟซ MCP

เครื่องมือที่พร้อมใช้งาน

เซิร์ฟเวอร์ MCP นี้มีเครื่องมือดังต่อไปนี้:

  • get_income_statements: ดึงงบกำไรขาดทุนของบริษัท
  • get_balance_sheets: ดึงงบดุลของบริษัท
  • get_cash_flow_statements: ดึงงบกระแสเงินสดของบริษัท
  • get_current_stock_price: ดึงราคาปัจจุบัน/ล่าสุดของบริษัท
  • get_historical_stock_prices: ดึงราคาหุ้นในอดีตของบริษัท
  • get_company_news: ดึงข่าวสารของบริษัท
  • get_available_crypto_tickers: ดึงรายชื่อสัญลักษณ์คริปโตทั้งหมดที่มี
  • get_crypto_prices: ดึงราคาในอดีตของสกุลเงินคริปโต
  • get_historical_crypto_prices: ดึงราคาในอดีตของสกุลเงินคริปโต
  • get_current_crypto_price: ดึงราคาปัจจุบัน/ล่าสุดของสกุลเงินคริปโต

การติดตั้ง

ข้อกำหนดเบื้องต้น

  • Python 3.10 หรือสูงกว่า
  • ตัวจัดการแพ็คเกจ uv

ขั้นตอนการติดตั้ง

  1. โคลนที่เก็บนี้:

    git clone https://github.com/financial-datasets/mcp-server
    cd mcp-server
    
  2. หากคุณยังไม่ได้ติดตั้ง uv ให้ติดตั้ง:

    # macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Windows
    curl -LsSf https://astral.sh/uv/install.ps1 | powershell
    
  3. ติดตั้งแพ็คเกจที่จำเป็น:

    # Create virtual env and activate it
    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
    # Install dependencies
    uv add "mcp[cli]" httpx  # On Windows: uv add mcp[cli] httpx
    
    
  4. ตั้งค่าตัวแปรสภาพแวดล้อม:

    # Create .env file for your API keys
    cp .env.example .env
    
    # Set API key in .env
    FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key
    
  5. รันเซิร์ฟเวอร์:

    uv run server.py
    

การเชื่อมต่อกับ Claude Desktop

  1. ติดตั้ง Claude Desktop หากยังไม่ได้ติดตั้ง

  2. สร้างหรือแก้ไขไฟล์การกำหนดค่า Claude Desktop:

    # macOS
    mkdir -p ~/Library/Application\ Support/Claude/
    nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
  3. เพิ่มการกำหนดค่าต่อไปนี้:

    {
      "mcpServers": {
        "financial-datasets": {
          "command": "/path/to/uv",
          "args": [
            "--directory",
            "/absolute/path/to/financial-datasets-mcp",
            "run",
            "server.py"
          ]
        }
      }
    }
    

    แทนที่ /path/to/uv ด้วยผลลัพธ์ของ which uv และ /absolute/path/to/financial-datasets-mcp ด้วยพาธสัมบูรณ์ไปยังโปรเจกต์นี้

  4. รีสตาร์ท Claude Desktop

  5. คุณควรเห็นเครื่องมือทางการเงินพร้อมใช้งานในเมนูเครื่องมือของ Claude Desktop (ไอคอนค้อน)

  6. ลองถาม Claude ด้วยคำถามเช่น:

    • "งบกำไรขาดทุนล่าสุดของ Apple คืออะไร"
    • "แสดงราคาปัจจุบันของหุ้น Tesla"
    • "ดึงราคาในอดีตของ MSFT ตั้งแต่ 2024-01-01 ถึง 2024-12-31"