Skip to content

feat(mcp): expose FLATFILES tools on the MCP server #431

@userFRM

Description

@userFRM

Problem

tools/mcp/src/main.rs registers MDDS endpoint tools off the MddsClient registry but exposes nothing for the FLATFILES surface. MCP consumers cannot pull whole-universe daily blobs through the JSON-RPC tool surface even though the Rust core supports it via ThetaDataDx::flatfile_request*.

Proposed solution

Add MCP tools mirroring the Rust unified surface:

  • flatfile_request — args (sec_type, req_type, date, output_path, format); returns the written path.
  • flatfile_request_decoded — args (sec_type, req_type, date); returns rows (gate behind a row-count cap; prefer file output for whole-universe blobs).
  • The 9 convenience wrappers (flatfile_option_open_interest, flatfile_option_trade_quote, flatfile_option_trade, flatfile_option_quote, flatfile_option_eod, flatfile_stock_*).
  • Validate sec_type ∈ {Option, Stock}, req_type ∈ {Trade, Quote, TradeQuote, OpenInterest, Eod}, date as YYYYMMDD, format ∈ {csv, jsonl}.

Wire registration the same way MDDS endpoints are wired today.

Impact

MCP consumers reach parity with the Rust SDK for the third public surface.

Vendor reference: https://http-docs.thetadata.us/operations/get-v2-flat-file-getting-started.html

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions