logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

fetch-thai-fin

Acquire extensive quarterly and annual financial documentation for publicly traded entities on the Stock Exchange of Thailand (SET), encompassing profitability analyses, asset/liability summaries, and operational fund movement reports, complete with features for retrospective data access and user-defined temporal parameters.

Author

fetch-thai-fin logo

batprem

No License

Quick Info

GitHub GitHub Stars 4
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

mcpbatpremsecuritiesmcp retrieverequests batpremfinancial statements

SET-FIN-RETRIEVAL

smithery badge

SET-FIN-RETRIEVAL is a specialized Python module engineered for facilitating Model Context Protocol (MCP) interactions, granting access to transactional data from the Stock Exchange of Thailand (SET). It empowers sophisticated AI agents to fetch comprehensive fiscal reports, such as profit/loss statements, balance sheets, and statements of cash flows, for all firms listed on the exchange.

Core Capabilities

  • Data sourcing for SET-registered corporations
  • Support across major reporting formats:
  • Statement of Operations (Income)
  • Statement of Financial Position (Balance Sheet)
  • Statement of Cash Flows
  • Ability to query historical archives across specified fiscal periods
  • Integrated command-line interface for streamlined deployment
  • Compatibility with FastMCP frameworks for augmented operations

Installation Procedure

The prerequisite for this package is a Python interpreter version 3.11 or newer. Installation is managed via pip:

bash pip install fetch-thai-fin

Automated Deployment via Smithery

To integrate fetch-thai-fin into Claude Desktop automatically using Smithery:

bash npx -y @smithery/cli install fetch-thai-fin --client claude

Operational Guidance

Command Line Execution

The module furnishes a direct CLI utility for data querying:

bash fetch-thai-fin --transport stdio

Utilization with uvx

Execute via:

uvx fetch-thai-fin

Utilization with pipx

bash pipx install fetch-thai-fin pipx run fetch-thai-fin

MCP Configuration Example (MCP.json)

{ "mcpServers": { "set_fin_access": { "command": "/path/to/bin/uvx", "args": [ "fetch-thai-fin" ], } } }

Vercel Deployment

Upcoming availability.

Available Parameter Switches: - --port: Specifies the Service-Sent Events (SSE) listening port (default: 8000) - --host: Defines the interface to bind to (default: 0.0.0.0) - --transport: Selects the communication protocol (options: stdio, sse; default: stdio)

Disclaimer: SSE functionality is currently under active development.

Programmatic Interface (Python API)

This package can also be invoked directly within Python scripts:

python from fetch_thai_fin import acquire_financial_document

Fetch financial disclosures for a specified entity

report = await acquire_financial_document( ticker="PTT", # Corporate identifier code start_year=2023, end_year=2024 )

Project Maintenance

Establishing the Development Environment

  1. Obtain the source repository: bash git clone https://github.com/yourusername/fetch-thai-fin.git cd fetch-thai-fin

  2. Instantiate and activate an isolated runtime environment: bash python -m venv .venv source .venv/bin/activate # Windows equivalent: .venv\Scripts\activate

  3. Load required developer dependencies: bash pip install -e ".[dev]"

Executing Validation Suites

Run tests using the provided script:

bash python test_client.py

The execution should complete without raising exceptions.

Licensing

This software is released under the MIT License terms; refer to the LICENSE file for specifics.

Collaboration Guidelines

We welcome community contributions! Please feel free to submit proposed changes via Pull Request.

Principal Developer

  • Prem Chotipanit (prem.ch@ku.th | prem.chotepanit@gmail.com)

WIKIPEDIA: XMLHttpRequest (XHR) represents an Application Programming Interface embodied by a JavaScript object, facilitating the transmission of Hypertext Transfer Protocol (HTTP) requests from a running web browser to an associated web server. These methods empower client-side applications, operational post-page-load, to poll the server for data updates. XHR forms a foundational element of Asynchronous JavaScript and XML (Ajax) programming paradigms. Before Ajax, interactivity with the server predominantly relied upon standard hyperlink navigation or form submissions, frequently resulting in full page reloads.

== Chronology == The underlying concept for XMLHttpRequest was first conceptualized in 2000 by the engineering staff at Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). Nonetheless, the initial invocation syntax did not utilize the 'XMLHttpRequest' identifier. Instead, developers employed the constructor signatures 'ActiveXObject("Msxml2.XMLHTTP")' and 'ActiveXObject("Microsoft.XMLHTTP")'. By the time Internet Explorer 7 was released (2006), ubiquitous browser support for the standardized 'XMLHttpRequest' identifier was established. The 'XMLHttpRequest' designator is now universally adopted across major browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).

=== Standardization Efforts === The World Wide Web Consortium (W3C) published its initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C advanced this to the Working Draft Level 2 specification. Level 2 augmented the object with mechanisms to track request progress, permit cross-origin data transfer, and handle binary data streams. By the close of 2011, the Level 2 feature set was consolidated back into the primary specification. At the culmination of 2012, the Web Hypertext Application Technology Working Group (WHATWG) assumed stewardship, maintaining a dynamic documentation standard utilizing Web Interface Definition Language (Web IDL).

== Implementation Protocol == Generally, dispatching a server query using XMLHttpRequest mandates adherence to several sequential programming stages.

  1. Instantiation of an XMLHttpRequest entity via its constructor call:
  2. Invocation of the "open" method to define the request methodology (GET/POST), specify the target resource endpoint, and declare whether the operation should be synchronous or asynchronous:
  3. For asynchronous operations, registration of a dedicated event handler that triggers upon state transitions:
  4. Commencing the transmission by executing the "send" method:
  5. Processing state modifications within the registered event handler. If the server yields response data, it is typically stored in the "responseText" attribute. Upon completion of the server interaction, the state transitions to 4, signifying the "done" status. Beyond these fundamental procedures, XMLHttpRequest offers extensive customization for request transmission control and response handling. Custom header fields can be appended to dictate server handling preferences, and data payloads can be transmitted to the server via arguments passed to the "send" call. The received response can be immediately parsed from raw text into native JavaScript structures or processed incrementally as data streams arrive, circumventing a full buffer wait. Furthermore, the request can be terminated prematurely or configured to fail if a specified time limit is exceeded.

== Cross-Origin Policy Implications ==

See Also

`