lottery-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lottery-mcpshow me Taiwan Lotto 649 results for March 2025"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Lottery MCP Server
This MCP (Model Context Protocol) server enables retrieval of Taiwan lottery data for a specified month. It currently supports four games: Super Lotto 638 (威力彩), Lotto 649 (大樂透), Daily Cash 539 (今彩539), and Lotto 4D (4星彩).
Requirements
Python 3.9+
uv (Python package manager)
Related MCP server: Taiwan Tender MCP
Usage
Install uv if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | shStart the server:
uv run main.pyRunning Locally with Claude App
To use this MCP server with Claude App, follow these steps:
Open
Settings > Developerin Claude App.Add or update your configuration as shown below, replacing
<absolute_path_to_the_folder>with the full path to your project directory:{ "mcpServers": { "lottery": { "command": "uv", "args": [ "--directory", "<absolute_path_to_the_folder>", "run", "main.py" ] } } }After connecting, a blue
runningtag will appear next to your server name in the Local MCP servers list.Access the server's tools by clicking the
Search and toolsbutton in the chat interface.
This confirms the MCP server is running and integrated with Claude App.
Troubleshoot
Unable to connect MCP server locally
If uv is already installed, it may mean that Claude cannot find it. Turn on the terminal and set a symlink:
sudo ln -s ~/.local/bin/uv /usr/local/bin/uv
Available Tools
4 toolsget_daily_cash_monthB
Get lottery, daily cash (今彩539), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| month | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full behavioral burden. It repeats the parameter types but doesn't disclose whether this is a read-only operation, authentication requirements, rate limits, or any retrieval behavior; only the limited Args list adds minimal context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and mostly front-loaded with the core action, but the Args section lacks formatting and includes redundant examples (e.g., 2024, 5) that could be structured more cleanly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter monthly data retrieval tool, the description tells the agent what it retrieves and which parameters to supply; since an output schema exists, return values need not be explained, so the description is nearly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description adds basic meaning for both year and month via the Args section, slightly compensating for the missing schema details even though the information (e.g., 2024, 5) is mostly inferable from the names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Get) and resource (lottery, daily cash 今彩539) with scope (specified month), distinguishing it from siblings like get_super_lotto_month by naming the game type. Clear purpose, though no explicit differentiation beyond the name.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage through the month scope but offers no explicit when-to-use vs alternatives or when-not; the description alone doesn't help the agent choose among the four month-based lotto tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_lotto_4d_monthC
Get lottery, lotto 4d (4星彩), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| month | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full behavioral disclosure. It implies a read-only fetch of historical lottery data but doesn't state whether it's read-only, if there are rate limits, whether data is paginated, or if it returns partial data. The Args section adds only examples, not behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the purpose, followed by a brief Args list. It's appropriately sized with no unnecessary sentences, though the Args formatting is slightly clunky.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values needn't be explained. However, with no annotations and 0% parameter schema coverage, the description should clarify more about parameter constraints and behavioral traits. It covers the bare minimum to invoke correctly but leaves gaps in usage guidance and parameter semantics.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It provides example values ('e.g. 2024', 'e.g. 5'), which is helpful but minimal. It doesn't clarify format constraints (e.g., 1-12 for month) or whether 'year' is full YYYY or two-digit.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a clear verb-resource pair ('Get lottery, lotto 4d data') and names the temporal scope (specified month). Siblings are other lottery types, and the name 'lotto 4d' distinguishes it, but the description doesn't explicitly say how it differs from get_super_lotto_month or get_lotto_649_month. The parenthetical '4星彩' clarifies the specific game.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus the sibling lottery tools (get_super_lotto_month, get_lotto_649_month, get_daily_cash_month). An agent must infer from the tool name which lottery game to pick. No exclusions or alternatives mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_lotto_649_monthC
Get lottery, super lotto 649 (大樂透), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| month | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It never states that this is a read-only operation, nor does it disclose any ordering, pagination, or missing-data behavior for the month range.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Short and front-loaded, with the core purpose first and the Args block second. The Args block largely restates the schema and could be trimmed, but there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained. Still, for a query tool with no annotations and 0% schema coverage, the description omits parameter ranges and any behavioral context, leaving gaps an agent must guess at.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It supplies example values (year: 2024, month: 5), which add some meaning, but gives no valid ranges, formatting rules, or timezone context for the two parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Get'), the resource (lottery 649 / 大樂透 data), and the scope (a specified month). However, the parenthetical '(大樂透)' alongside the sibling 'get_super_lotto_month' creates naming ambiguity about whether this is the same lottery as the sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this versus the three sibling lottery tools (get_super_lotto_month, get_daily_cash_month, get_lotto_4d_month). The agent must infer the distinction purely from the tool name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_super_lotto_monthB
Get lottery, super lotto 638 (威力彩), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| month | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral-disclosure burden. It only implies a read operation via 'Get' and says nothing about authentication, rate limits, pagination, empty results, or whether the operation can fail for invalid months.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and front-loads the core operation before listing arguments. The Args section is somewhat schema-like but earns its place because the schema itself has no parameter descriptions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained, and both parameters are documented. However, for a retrieval tool with no annotations, the description does not provide enough context about usage conditions or constraints to be fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must carry parameter semantics. It does document both parameters, explaining that 'year' is the target year with an example (2024) and 'month' is the target month with an example (5), which meaningfully compensates for the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Get') and resource ('super lotto 638 / 威力彩 data in the specified month'), which clearly identifies the tool. The named lottery game differentiates it from sibling tools like get_lotto_649_month and get_daily_cash_month, though it does not explicitly state the alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance on when to use this tool versus the sibling lottery tools or any other alternatives. The only implied usage is retrieving a specific game's monthly data, with no exclusions or prerequisite conditions mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
get_daily_cash_month - First observed
get_lotto_4d_month - First observed
get_lotto_649_month - First observed
get_super_lotto_month
TDQS
Scored across 4 tools
Each tool targets a distinct lottery game (super lotto 638, lotto 649, daily cash, lotto 4d) with no overlap. The game name in the tool name and description makes the purpose unambiguous.
All four tools follow a consistent get_<game>_month pattern. The naming is predictable and clearly indicates the action and resource.
Four tools is reasonable given the server covers four distinct lottery games. The scope is narrow but well-defined, and each tool earns its place.
The surface only provides monthly data retrieval for each game. There are no tools for fetching individual draws, latest results, or time ranges, which are common needs. CRUD operations are not applicable, but the read-only surface is limited to a single granularity.
Maintenance
Related MCP Connectors
Winning numbers for 30+ world lotteries, minutes after each draw. Free, no key, CC BY 4.0.
Taiwan finance open data: ETF, funds, TAIEX, sentiment, business climate, FX. Free & read-only.
Taiwan stock market data (TWMD): official-source, point-in-time-safe datasets via read-only tools.
Taiwan Stock Exchange (TWSE) open data as MCP tools: stock quotes, ETF data, 140+ public datasets.
Related MCP Servers
- AlicenseBqualityAmaintenanceProvides comprehensive access to Taiwan's Legislative Yuan data including bills, committees, gazettes, meeting records, interpellations, laws, legislators, and IVOD recordings through the Legislative Yuan API v2.426MIT
- FlicenseAqualityNot gradedmaintenanceEnables users to search and retrieve detailed information about Taiwan government procurement tenders through the Government Electronic Procurement System API. It supports searching tenders by keyword, category code, date, and government unit.6-
- AlicenseAqualityDmaintenanceEnables to access Taiwan Central Weather Administration data, including 3-day and 1-week weather forecasts for counties/cities and historical rainfall data.3MIT
- AlicenseAqualityDmaintenanceProvides tools to query Chinese lottery results, check prizes, and update data for 双色球 (Double Color Ball) and 大乐透 (Super Lotto).41MIT