Skip to main content

Add your description here

Project description

SET-MCP

SET-MCP is a Python package that provides tools for serving Model Context Protocol which can access the Securities Exchange of Thailand (SET). It allows AI agents to retrieve comprehensive financial statements including income statements, balance sheets, and cash flow statements for listed companies.

Features

  • Retrieve financial statements for SET-listed companies
  • Support for multiple financial statement types:
    • Income Statement
    • Balance Sheet
    • Cash Flow Statement
  • Historical data retrieval with customizable date ranges
  • Command-line interface for easy integration
  • FastMCP integration for enhanced functionality

Installation

The package requires Python 3.11 or higher. You can install it using pip:

pip install set-mcp

Usage

Command Line Interface

The package provides a command-line interface for easy access to financial data:

set-mcp --transport stdio

Using with uvx

Run

uvx set-mcp

Using with pipx

pipx install set-mcp
pipx run set-mcp

MCP.json example

{
    "mcpServers": {
      "set_mcp": {
        "command": "/path/to/bin/uvx", // Edit to your uvx path
        "args": [
            "set-mcp"
        ],
      }
    }
}

Available options:

  • --port: Port to listen on for SSE (default: 8000)
  • --host: Host to listen on (default: 0.0.0.0)
  • --transport: Transport type (choices: stdio, sse, default: stdio)

Note: SSE is not yet implemented

Python API

You can also use the package programmatically in your Python code:

from set_mcp import get_financial_statement

# Get financial statements for a specific company
result = await get_financial_statement(
    symbol="PTT",  # Company symbol
    from_year=2023,
    to_year=2024
)

Development

Setup Development Environment

  1. Clone the repository:
git clone https://github.com/yourusername/set-mcp.git
cd set-mcp
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install development dependencies:
pip install -e ".[dev]"

Running Tests

python test_client.py

The output should be no error

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

set_mcp-0.2.0.tar.gz (77.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

set_mcp-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file set_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: set_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 77.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for set_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f7e7a61438bfb9e38bbc9ac8f1f012fabef2bd466c64b12bbe1ee486013f8d01
MD5 cfd0e64d3c1727d590b1849474ebd527
BLAKE2b-256 5ea5aaa26714cfeac86af5d956aae95e4fcf137c5d58a1705d1fa5c9eed87051

See more details on using hashes here.

Provenance

The following attestation bundles were made for set_mcp-0.2.0.tar.gz:

Publisher: python-publish.yml on batprem/set-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file set_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: set_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for set_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1896263ef411236437c37a1d45f920847da5435af517246f15a3f43308f99555
MD5 cb796c661108447d61456da76e2d7f79
BLAKE2b-256 4109b93d48bd9e5e8a6dc0abf6f00a2da1e6c964d13131e274a6de20ef0a4b62

See more details on using hashes here.

Provenance

The following attestation bundles were made for set_mcp-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on batprem/set-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page