Lottery MCP Server
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 MCP Servercheck double ball prize for numbers 3,11,14,19,29,30,15"
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
A Model Context Protocol (MCP) server for Chinese lottery data query and prize checking. Supports 双色球 (Double Color Ball) and 大乐透 (Super Lotto).
Features
🔄 Update lottery data - Fetch latest lottery results from official sources
🔍 Query results - Search lottery results by date range
🎯 Check prizes - Check if your numbers won any prizes
📊 Get latest results - Quick access to recent lottery draws
Related MCP server: lottery-mcp
Installation
pip install mcp requestsMCP Tools
Tool | Description |
| Update lottery data to local database |
| Query lottery results by date range |
| Check winning status for given numbers |
| Get recent lottery results |
Configuration
Add to your MCP config (e.g., .kiro/settings/mcp.json):
{
"mcpServers": {
"lottery": {
"command": "python",
"args": ["/path/to/lottery_mcp_server.py"],
"env": {
"LOTTERY_DATA_DIR": "/path/to/data"
},
"disabled": false,
"autoApprove": ["update_lottery", "query_lottery", "check_prize", "get_latest_results"]
}
}
}Environment Variables
Variable | Description | Default |
| Directory to store lottery data |
|
Usage Examples
Update lottery data
update_lottery("double_ball", "2025-12-01", "2026-01-18")
update_lottery("super_lotto", "2025-12-01", "2026-01-18")Query results
query_lottery("double_ball", "2025-12-01", "2026-01-18")Check prize (Double Color Ball: 6 red + 1 blue)
check_prize("double_ball", "2025-12-01", "2026-01-18", [3, 11, 14, 19, 29, 30, 15])Check prize (Super Lotto: 5 front + 2 back)
check_prize("super_lotto", "2025-12-01", "2026-01-18", [8, 13, 27, 30, 32, 2, 3])Get latest results
get_latest_results("double_ball", 5)
get_latest_results("super_lotto", 10)Lottery Types
Type | ID | Description | Numbers |
| 双色球 | Double Color Ball | 6 red (1-33) + 1 blue (1-16) |
| 大乐透 | Super Lotto | 5 front (1-35) + 2 back (1-12) |
Prize Levels
Double Color Ball (双色球)
Level | Red Match | Blue Match |
一等奖 | 6 | ✓ |
二等奖 | 6 | ✗ |
三等奖 | 5 | ✓ |
四等奖 | 5 or 4+blue | - |
五等奖 | 4 or 3+blue | - |
六等奖 | 0-2 | ✓ |
Super Lotto (大乐透)
Level | Front Match | Back Match |
一等奖 | 5 | 2 |
二等奖 | 5 | 1 |
三等奖 | 5 | 0 |
四等奖 | 4 | 2 |
五等奖 | 4 | 1 |
六等奖 | 3 | 2 |
七等奖 | 4+0 or 3+1 | - |
八等奖 | Various combinations | - |
Data Source
Data is fetched from 中国福彩网:
License
MIT License
Disclaimer
This tool is for educational and entertainment purposes only. Please gamble responsibly.
Available Tools
4 toolscheck_prizeA
检查指定号码在日期范围内的中奖情况
Args: lottery_type: 彩票类型,可选 'double_ball'(双色球) 或 'super_lotto'(大乐透) start_date: 开始日期,格式 YYYY-MM-DD end_date: 结束日期,格式 YYYY-MM-DD numbers: 号码列表 - 双色球: 7个数字,前6个为红球(1-33),最后1个为蓝球(1-16) - 大乐透: 7个数字,前5个为前区(1-35),后2个为后区(1-12)
Returns: 中奖结果,包含每期的匹配情况和中奖等级
| Name | Required | Description | Default |
|---|---|---|---|
| lottery_type | Yes | ||
| start_date | Yes | ||
| end_date | Yes | ||
| numbers | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It states the tool checks and returns match details and prize levels, which implies read-only behavior. While it does not explicitly say it is non-destructive, the verb 'check' strongly implies no side effects. It could be more explicit but is adequate for an agent.
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 concise and well-structured: one line for purpose, followed by clear Args and Returns sections. Every sentence provides necessary detail without redundancy. No fluff.
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?
The description covers all parameters and explains the return value (winning results with match details and prize level). It is complete for a moderately complex tool. It could be enhanced by mentioning default behavior or edge cases (e.g., what if no matches), but overall it provides sufficient context.
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 coverage is 0%, so the description must compensate. It thoroughly explains each parameter: lottery_type with two explicit options and their English/Chinese names, date format (YYYY-MM-DD), and numbers structure for both lottery types (red/blue ball ranges, positions). This adds significant meaning beyond the 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 clearly states the tool's purpose: checking winning status of specified lottery numbers within a date range. '检查指定号码在日期范围内的中奖情况' translates to 'Check the winning status of specified numbers within a date range'. It uses a specific verb ('check') and resource ('lottery numbers'), and the context of sibling tools (get_latest_results, query_lottery, update_lottery) indicates this tool is distinct in that it checks specific numbers for wins.
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?
The description implies usage context ('to check winning status') but does not explicitly state when to use this tool versus alternatives, nor does it provide exclusions or prerequisites. It lacks guidance on when not to use it or which sibling tool to prefer in different scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_latest_resultsB
获取最近几期的开奖结果
Args: lottery_type: 彩票类型,可选 'double_ball'(双色球) 或 'super_lotto'(大乐透) count: 获取的期数,默认5期
Returns: 最近几期的开奖结果
| Name | Required | Description | Default |
|---|---|---|---|
| lottery_type | Yes | ||
| count | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It states the tool 'gets' results (implying read-only) but does not disclose idempotency, side effects, error conditions, or any other behavioral traits beyond the basic operation.
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 concise, using a standard Python docstring format. It is front-loaded with the main purpose and clearly lists parameters. However, it could be slightly more succinct without the Args/Returns markers.
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?
Given 2 parameters and no output schema, the description is somewhat incomplete. It explains parameters but the return value is vague ('最近几期的开奖结果'). For a tool with no output schema, more detail on result structure would improve completeness.
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 description must compensate. It adds meaning by specifying allowed values for lottery_type ('double_ball' or 'super_lotto') and explaining the default for count (5), which the schema does not provide.
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 clearly states the tool retrieves recent lottery results for specified types (double_ball, super_lotto) and count. It uses a specific verb ('获取' meaning 'get') and resource ('开奖结果' meaning 'results'), but does not distinguish from sibling tools like check_prize or query_lottery.
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 is provided on when to use this tool versus alternatives. The description lacks context on prerequisites, exclusions, or scenarios where sibling tools would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_lotteryA
查询指定日期范围内的开奖结果
Args: lottery_type: 彩票类型,可选 'double_ball'(双色球) 或 'super_lotto'(大乐透) start_date: 开始日期,格式 YYYY-MM-DD end_date: 结束日期,格式 YYYY-MM-DD
Returns: 开奖结果列表
| Name | Required | Description | Default |
|---|---|---|---|
| lottery_type | Yes | ||
| start_date | Yes | ||
| end_date | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description indicates a read-only query operation, which is accurate. However, with no annotations provided, it does not disclose any additional behavioral traits such as authentication requirements, rate limits, or data freshness. The description is functional but minimal.
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 extremely concise: one sentence for purpose, then structured Args and Returns sections. Every sentence is necessary and front-loaded with the core purpose. No redundancy.
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?
The description covers input parameters and basic purpose, but lacks details on output format (beyond 'list of results'), error handling, or edge cases. Given no output schema and no annotations, more behavioral context would improve completeness.
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?
Despite 0% schema description coverage, the description's Args section provides meaningful explanations for each parameter: lottery_type options ('double_ball' and 'super_lotto'), and date format (YYYY-MM-DD). This adds value beyond the schema's property titles alone.
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 clearly states '查询指定日期范围内的开奖结果' (query lottery results within a specified date range), using a specific verb and resource. It implicitly distinguishes from siblings like get_latest_results (which gets only the latest) and check_prize (which checks a specific ticket).
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?
The description implies usage when needing results for a date range, but does not explicitly exclude scenarios where alternatives like get_latest_results or check_prize might be more suitable. No when-not-to-use guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_lotteryB
更新彩票开奖数据到本地数据库
Args: lottery_type: 彩票类型,可选 'double_ball'(双色球) 或 'super_lotto'(大乐透) start_date: 开始日期,格式 YYYY-MM-DD end_date: 结束日期,格式 YYYY-MM-DD
Returns: 更新结果,包含新增记录数和总记录数
| Name | Required | Description | Default |
|---|---|---|---|
| lottery_type | Yes | ||
| start_date | Yes | ||
| end_date | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description discloses that the tool performs a write operation and returns counts, but fails to specify whether data is overwritten or appended, or any potential side effects like deletion of existing data. No authentication or rate limit info is given.
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 extremely concise, using bullet-like formatting in a docstring. It front-loads the purpose and includes parameter details efficiently, with no extraneous content.
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?
Given the absence of annotations and output schema, the description provides the core function and return summary, but lacks details on failure modes, idempotency, or precise return structure. It is adequate but leaves some important gaps.
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?
The description adds value beyond the schema by enumerating allowed values for lottery_type ('double_ball', 'super_lotto') and specifying date format (YYYY-MM-DD) for start_date and end_date. However, it does not clarify whether end_date is inclusive or the exact behavior of the date range.
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 clearly states it updates lottery draw data to the local database, using the verb 'update' and specifying the resource. However, it does not explicitly distinguish from sibling tools (e.g., query_lottery), though the write nature is implied.
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 is provided on when to use this tool over alternatives. It does not mention prerequisites, context for use, or any restrictions.
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
check_prize - First observed
get_latest_results - First observed
query_lottery - First observed
update_lottery
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: checking prizes for a number, getting recent results, querying historical results by date range, and updating the local database. No overlap.
All tool names follow a consistent verb_noun pattern in snake_case (check_prize, get_latest_results, query_lottery, update_lottery), making them predictable and easy to understand.
With 4 tools, the server is well-scoped for its purpose: prize checking, result retrieval (recent and historical), and data maintenance. This is a reasonable number for a focused lottery MCP server.
The tool set covers core operations: checking prizes, fetching latest results, querying historical results, and updating data. Minor gaps like a tool to retrieve a specific draw by issue number or list supported types are not critical.
Maintenance
Related MCP Connectors
Winning numbers for 30+ world lotteries, minutes after each draw. Free, no key, CC BY 4.0.
Historical football results, teams, competitions and draw/streak statistics via 10 read-only tools.
China holidays and lunar calendar lookup, solar-to-lunar conversion and yearly schedule.
Read-only Bazi, True Solar Time, and Chinese almanac tools in English and Traditional Chinese.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides free Chinese A-share stock data including real-time quotes, historical K-lines, market scanning, and multi-factor stock screening via BaoStock and Sina Finance APIs.MIT
- AlicenseBqualityDmaintenanceEnables retrieval of Taiwan lottery data for a specified month, supporting Super Lotto 638, Lotto 649, Daily Cash 539, and Lotto 4D.4MIT
- AlicenseNot gradedqualityBmaintenanceProvides real-time weather data for Chinese cities and worldwide locations through wttr.in, with tools to query weather, list supported cities, and get server/author information.MIT
- AlicenseNot gradedqualityCmaintenanceProvides weather queries for major Chinese cities, hot news and news search, and text processing tools using free public APIs.MIT