Skip to main content

Lanzakit Tester

Python 3.11+ License MIT

Tests de pytest generados por IA, y verificados antes de que los veas.

Lanzakit Tester es un MCP server que lee tu código Python, genera tests con Claude y los ejecuta para confirmar que compilan y pasan. Dejas de revisar tests que ni siquiera corren.

Features

  • 🧪 Generación de tests con Claude: analiza tu código y produce tests pytest listos para usar.
  • ✅ Validación automática: verifica la sintaxis y ejecuta pytest antes de entregarte el resultado.
  • 🔌 MCP nativo: funciona con Claude Desktop y cualquier cliente compatible con MCP.
  • 🌳 Análisis con AST: entiende funciones, clases y firmas antes de armar el prompt.
  • 🇪🇸 Español-first: comentarios de los tests y documentación en español.
  • 🔓 Open source: licencia MIT, sin lock-in.

Requisitos

  • Python 3.11+
  • Una API key de Anthropic (ANTHROPIC_API_KEY)
  • Acceso al modelo claude-sonnet-5

Instalación

pip install lanzakit-tester
echo "ANTHROPIC_API_KEY=tu_api_key" > .env

El archivo .env contiene tu API key. Nunca lo subas a git.

Opción A: Vía Claude Desktop (MCP config)

Agrega el server a tu claude_desktop_config.json:

{
  "mcpServers": {
    "lanzakit-tester": {
      "command": "lanzakit-tester"
    }
  }
}

Reinicia Claude Desktop y las 3 tools aparecerán disponibles.

Opción B: Vía Python

Sin cliente MCP, puedes invocar las tools directamente desde Python:

python -c "from lanzakit_tester import generate_and_validate_tests; print(generate_and_validate_tests('/ruta/a/tu_archivo.py')['summary'])"

Para contribuir

git clone https://github.com/lanzakit/starter-kit.git
cd starter-kit
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"

Uso

Tienes un archivo hola_claude.py (ver examples/hola_claude.py, versión simplificada):

import os

from anthropic import Anthropic
from dotenv import load_dotenv

load_dotenv()
client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))


def saludar():
    message = client.messages.create(
        model="claude-sonnet-5",
        max_tokens=512,
        messages=[{"role": "user", "content": "Hola Claude"}]
    )
    print(message.content[0].text)

Desde Claude Desktop, pídele:

Genera y valida tests para /ruta/a/tu_archivo.py

Claude llama a la tool generate_and_validate_tests y obtienes un resumen como este:

✅ 8 tests generados y pasaron. Guardado en: /ruta/a/test_tu_archivo.py

El archivo test_tu_archivo.py queda junto a tu código, listo para correr con pytest.

Tools disponibles

Tool Qué hace
analyze_python_file Analiza la estructura del código con AST.
generate_tests_for_file Genera tests pytest con Claude.
generate_and_validate_tests Genera, valida sintaxis, guarda y ejecuta pytest.

Cómo funciona

código .py
   │
   ▼
análisis AST  ──►  prompt a Claude  ──►  tests generados
                                              │
                                              ▼
                      resultado  ◄──  ejecución pytest  ◄──  validación sintáctica
  1. Lee tu archivo y extrae su estructura con AST.
  2. Arma un prompt con el código y su contexto, y se lo envía a Claude (claude-sonnet-5).
  3. Limpia la respuesta (por ejemplo, quita markdown fences).
  4. Valida que los tests tengan sintaxis Python correcta.
  5. Guarda el archivo y ejecuta pytest.
  6. Devuelve un resumen: cuántos pasaron, fallaron o dieron error.

Roadmap

  • 3 tools funcionales
  • Validación end-to-end
  • Empaquetado como paquete pip
  • Publicación en PyPI
  • Landing en lanzakit.dev
  • Soporte para más frameworks de testing

Contribuir

¿Encontraste un bug o tienes una idea? Abre un issue o envía un PR. Lee CONTRIBUTING.md para conocer el flujo de trabajo.

Licencia

Distribuido bajo licencia MIT. Consulta el archivo LICENSE.


@lanzakit · Construido en Bolivia 🇧🇴 para devs hispanohablantes

Metadata

Release files for lanzakit-tester 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lanzakit-tester 0.1.0
File Size Uploaded Provenance Actions
lanzakit_tester-0.1.0.tar.gz 13.5 kB Without provenance Details for lanzakit_tester-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lanzakit-tester 0.1.0
File Interpreter ABI Platform Actions
lanzakit_tester-0.1.0-py3-none-any.whl Python 3 none any Details for lanzakit_tester-0.1.0-py3-none-any.whl

Total release size: 23.5 kB

Release files / lanzakit_tester-0.1.0.tar.gz

Download URL lanzakit_tester-0.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fb4fbd14a742dc2d505afbf83110364f5a15c6d2f3b6c0eb4b8ef7cb52869992
BLAKE2b-256 checksum
How to use checksums
6f52d217c96f29652134df049c78e6f595ee753327863f0f734ed73a742eb052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / lanzakit_tester-0.1.0-py3-none-any.whl

Download URL lanzakit_tester-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10801a9c92bf9b00a83cd740c77708fc09b477841cb5abe01a0b01fb0b1cfed8
BLAKE2b-256 checksum
How to use checksums
7e998dca23e2704c441690e304e870a571494b0cc46f605ef3432b428f2cb4fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for lanzakit-tester 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page