Skip to main content
Glama
parrotsoft

Lotería MCP

by parrotsoft

🎟️ MCP 복권

복권 결과 API를 통해 복권 및 결과를 조회하기 위한 MCP 서버입니다.

모든 호환 가능한 MCP 클라이언트(Claude Desktop, Cursor 등)가 채팅에서 직접 호출할 수 있는 두 가지 도구를 제공합니다.


📋 요구 사항

도구

최소 버전

Python

3.10+

uv

최신


Related MCP server: Marvel MCP

⚙️ 설치

1. 저장소 복제

git clone https://github.com/parrotsoft/loteria-mcp
cd loteria

2. 가상 환경 생성 및 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

특정 날짜의 복권 결과를 반환합니다.

매개변수

유형

설명

date

str

YYYY-MM-DD 형식의 날짜. 비워두면 가장 최근 결과

응답 예시:

{
  "data": [
    { "lottery": "Lotería Nacional", "result": "1234", "date": "2026-04-24" }
  ]
}

🧪 개발 모드 실행

터미널에서 서버를 직접 테스트하려면 다음을 실행하세요:

uv run mcp dev loteria.py

브라우저에서 MCP Inspector가 열리며, 여기서 대화형으로 도구를 호출할 수 있습니다.


📦 의존성

패키지

설명

httpx

API 호출을 위한 비동기 HTTP 클라이언트

mcp[cli]

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 tools
get_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", ...}, ...]}
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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", ...}]}
ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 2 tool updatesv0.1.0
    • First observedget_lotteries
    • First observedget_resultados

TDQS

A4/5.0

Scored across 2 tools

Disambiguation5/5

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.

Naming Consistency5/5

Both tools follow a consistent 'get_<resource>' pattern in snake_case, using the same language (Spanish) throughout.

Tool Count3/5

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.

Completeness3/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers