Get the FREE Ultimate OpenClaw Setup Guide →

TWSEMCPServer

台灣證交所OpenAPI 的 MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio twjackysu-twsemcpserver uvx twstockmcpserver \
  --env TWSE_MCP_API_KEY="optional" \
  --env TWSE_MCP_BIND_HOST="0.0.0.0" \
  --env TWSE_MCP_BIND_PORT="8000"

How to use

TWSEMCPServer is a Python-based MCP server tailored for TWSE data analysis, covering real-time stock information, financial statements, ESG data, and trend analysis. The server exposes a modular MCP endpoint set that can be consumed by MCP clients to fetch stock trends, institutional activity, market hot spots, dividend schedules, and ESG risk assessments. You can run the server using uvx as the execution entry point and connect to the MCP network via the standard MCP transport. Once running, you can query endpoints such as real-time quotes, earnings data, ESG scores, and screening utilities to support analytical workflows or automated dashboards.

How to install

Prerequisites:

  • Python 3.13+ (recommended)
  • Git
  • Internet access to fetch dependencies

Install and run locally:

  1. Clone the repository: git clone https://github.com/twjackysu/TWStockMCPServer.git
  2. Navigate to the project directory: cd TWStockMCPServer
  3. Install the UV tooling (uvx) if you don't have it already. One common approach is to use pipx: pipx install uvx

    or, if you prefer a direct Python path installation

    pip install uvx

  4. Start the MCP server via uvx (the package name used in this project is TWStockMCPServer): uvx twstockmcpserver

Note: If your environment uses environment variables for binding or authentication, you can configure them as TWSE_MCP_BIND_HOST, TWSE_MCP_BIND_PORT, and TWSE_MCP_API_KEY respectively. Adjust port and host as needed for your network setup.

Additional notes

Tips and common issues:

  • Ensure Python 3.13+ is installed and accessible in your PATH.
  • If uvx isn't recognized, verify that the uvx installation path is on your system PATH or use the full invocation path.
  • The default bind host/port can be overridden via environment variables TWSE_MCP_BIND_HOST and TWSE_MCP_BIND_PORT.
  • For production deployments, consider running behind a reverse proxy and enabling TLS where MCP clients connect.
  • If you need to disable certain endpoints, consult the server configuration to adjust feature flags or modules.
  • Check the repository's API_TODO.md or docs for a list of all available MCP endpoints and their input/output structures.

Related MCP Servers

Sponsor this space

Reach thousands of developers