Lotería MCP
🎟️ Lotería MCP
用于通过 API de Resultados de Loterías 查询彩票和结果的 MCP 服务器。
它提供了两个工具,任何兼容的 MCP 客户端(如 Claude Desktop、Cursor 等)都可以直接从聊天界面调用。
📋 要求
工具 | 最低版本 |
Python | 3.10+ |
latest |
Related MCP server: Marvel MCP
⚙️ 安装
1. 克隆仓库
git clone https://github.com/parrotsoft/loteria-mcp
cd loteria2. 创建虚拟环境并使用 uv 安装依赖
uv sync这将自动创建 .venv 环境并安装 pyproject.toml 中声明的所有依赖项。
🚀 在 Claude Desktop 中使用
将以下配置添加到 Claude Desktop 配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"loteria": {
"command": "uv",
"args": [
"--directory",
"/ruta/absoluta/al/proyecto/loteria",
"run",
"loteria.py"
]
}
}
}注意: 将
/ruta/absoluta/al/proyecto/loteria替换为您机器上项目的实际路径。
重启 Claude Desktop,服务器即可使用。
🛠️ 可用工具
get_lotteries
返回 API 中可用的完整彩票列表。
无参数。
响应示例:
{
"data": [
{ "id": 1, "name": "Lotería Nacional", "country": "MX" },
{ "id": 2, "name": "Melate", "country": "MX" }
]
}get_resultados
返回特定日期的彩票结果。
参数 | 类型 | 描述 |
|
| 日期格式为 |
响应示例:
{
"data": [
{ "lottery": "Lotería Nacional", "result": "1234", "date": "2026-04-24" }
]
}🧪 在开发模式下运行
要直接从终端测试服务器:
uv run mcp dev loteria.py这将在浏览器中打开 MCP Inspector,您可以在其中以交互方式调用工具。
📦 依赖项
包 | 描述 |
| 用于 API 调用的异步 HTTP 客户端 |
| Model Context Protocol 框架 |
📁 项目结构
loteria/
├── loteria.py # Servidor MCP con las herramientas expuestas
├── main.py # Punto de entrada alternativo
├── pyproject.toml # Configuración del proyecto y dependencias
├── uv.lock # Lock file de dependencias (uv)
├── .gitignore
└── README.md📄 许可证
MIT
Available Tools
2 toolsget_lotteriesA
Obtiene el listado de todas las loterías disponibles.
Consulta el endpoint `/lotteries` de la API de resultados de loterías
y retorna la información de cada lotería registrada (nombre, país, etc.).
Returns:
dict[str, Any] | None: Diccionario con la lista de loterías disponibles,
o None si ocurre un error de red o la API no responde.
Example:
>>> await get_lotteries()
{"data": [{"id": 1, "name": "Lotería Nacional", ...}, ...]}
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It explicitly states the tool returns a dict or None on network error, and that it queries an API. It does not mention auth or rate limits, but for a read-only list tool, this is adequate.
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 with three parts: purpose, endpoint, and return type with example. Each sentence adds value without redundancy, making it well-structured and efficient.
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 low complexity, no parameters, and existence of an output schema, the description fully suffices. It explains the return structure and includes an example, meeting completeness requirements.
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 input schema has no parameters, and schema coverage is 100%. Per the guidelines, a baseline of 4 is assigned for zero parameters, and the description adds no further parameter info, which is appropriate.
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 obtains the list of all available lotteries by querying the /lotteries endpoint, providing specific verb and resource. The sibling tool 'get_resultados' is for results, so this tool is distinct.
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 does not provide explicit guidance on when to use this tool versus alternatives, nor does it mention prerequisites or exclusions. Usage is implied by the tool's purpose but not articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_resultadosA
Obtiene los resultados de loterías para una fecha específica.
Consulta el endpoint `/results/{date}` de la API cuando se proporciona
una fecha, o `/results` para obtener los resultados más recientes.
Args:
date (str): Fecha en formato `YYYY-MM-DD` para filtrar los resultados.
Si se pasa una cadena vacía, retorna los resultados más recientes.
Returns:
dict[str, Any] | None: Diccionario con los resultados de loterías
para la fecha indicada, o None si ocurre un error de red o la API
no responde.
Example:
>>> await get_resultados("2026-04-24")
{"data": [{"lottery": "Lotería Nacional", "result": "1234", ...}]}
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully carries the burden. It explains that it queries an API endpoint, returns a dict or None on network error, and includes an example. This is adequate disclosure of behavior.
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?
Description is structured in sections (Args, Returns, Example) and front-loaded. It is slightly verbose but still efficient for the information provided.
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 tool's simplicity (1 param, output schema present), the description covers purpose, parameter semantics, return type, and error cases. It does not mention the sibling tool, but completeness is acceptable.
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%, but the description contains an extensive 'Args' section explaining the single parameter 'date'—format, behavior when empty, and example. It 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 obtains lottery results for a specific date ('Obtiene los resultados de loterías para una fecha específica'). It distinguishes from the sibling tool 'get_lotteries' which likely lists lotteries, but does not explicitly contrast them.
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 instead of the sibling 'get_lotteries'. The description provides parameter usage (empty string for most recent) but not tool selection context.
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.
2 tool updates
v0.1.0- First observed
get_lotteries - First observed
get_resultados
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one lists all available lotteries, the other retrieves results for a specific date. There is no risk of confusion.
Both tools follow a consistent 'get_<resource>' pattern in snake_case, using the same language (Spanish) throughout.
Two tools is minimal but reasonable for a simple read-only lottery information server. It borders on feeling thin but does not warrant a lower score.
The server covers listing lotteries and fetching results by date, but lacks features like filtering by lottery or retrieving historical results beyond a single date.
Maintenance
Related MCP Connectors
MCP server for Google search results via SERP API
Public MCP server for summaries, DNS lookup, catalog, replies, and JSON checks.
The official MCP Server for the Mux API
Related MCP Servers
- -licenseNot gradedqualityAmaintenanceMCP Server for the Google Maps API.11,868 npm90,196MIT
- AlicenseBqualityFmaintenanceMCP Server for the Marvel Developer API, enabling interaction with characters and comics data.752 npm14MIT
- FlicenseAqualityDmaintenanceMCP server for the Concept2 Logbook API, enabling user profile management, workout result operations, and challenge queries.14-
- FlicenseNot gradedqualityDmaintenanceA simple MCP server to call RMV APIs for nearby stations and departure boards.-