TWSEMCPServer
台灣證交所OpenAPI 的 MCP Server
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:
- Clone the repository: git clone https://github.com/twjackysu/TWStockMCPServer.git
- Navigate to the project directory: cd TWStockMCPServer
- 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
- 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
web-eval-agent
An MCP server that autonomously evaluates web applications.
mcp-neo4j
Neo4j Labs Model Context Protocol servers
mcp-aktools
📈 提供股票、加密货币的数据查询和分析功能MCP服务器
Gitingest
mcp server for gitingest
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.