Skip to content

Repository files navigation

🧩 NYT Wordle AI Solver

Python LangGraph Package Manager: uv

A LangGraph-powered AI agent built to solve the daily New York Times Wordle puzzle using a structured workflow and MCP-enabled publishing.


✨ Features

  • 🧠 Graph-Based Intelligence: Uses a LangGraph workflow to manage guessing, validation, and publishing.
  • 🛠️ MCP Integration: Publishes results through external MCP tools (Slack, WhatsApp, NYT).
  • 💬 Slack Publishing: Sends the Wordle result grid to a configured Slack channel.
  • 📱 WhatsApp Integration: Automated WhatsApp messaging using pywhatkit.
  • 📝 NYT Commenting: Generates and posts friendly comments for the NYT community.
  • 🎨 Rich Terminal UI: Provides live feedback and polished terminal output.
  • 🧱 Modular Codebase: Clear separation between game logic, prompts, solver nodes, and publishing.

🚀 Project Structure

  • src/app.py — main application entrypoint
  • src/core/game.py — Wordle game rules, feedback, and grid rendering
  • src/core/graph_builder.py — LangGraph workflow construction and node transitions
  • src/agents/prompts.py — LLM prompt templates and chain configuration
  • src/agents/solver.py — solver node implementations for guessing and validation
  • src/agents/publisher.py — MCP publisher node
  • src/mcp/social-media-mcp.py — MCP server hosting Slack, WhatsApp, and NYT tools
  • src/mcp/whatsapp.py — WhatsApp messaging utility

🏗️ Architecture

The solver runs as a three-node state machine:

graph TD;
    __start__([__start__])
    GUESS(GUESS)
    VALIDATE(VALIDATE)
    PUBLISH(PUBLISH)
    __end__([__end__])

    __start__ --> GUESS;
    GUESS --> VALIDATE;
    VALIDATE -.-> GUESS;
    VALIDATE -.-> PUBLISH;
    PUBLISH --> __end__;
Loading

Getting Started

Prerequisites

  • uv
  • A compatible LLM backend configured via MODEL_NAME
  • A local or remote MCP endpoint

Installation

  1. Clone the repository:

    git clone https://github.com/Navin3d/NYT-Wordle-Solver.git
    cd NYT-Wordle-Solver
  2. Install dependencies:

    uv sync
  3. Configure environment variables by creating src/.env:

    SLACK_BOT_TOKEN=xoxb-111111-22221222-jhghg
    SLACK_CHANNEL_ID=#general
    WHATSAPP_CONTACTS_TO_SEND=+919442807217
    MODEL_NAME=gemma4:latest

🛠️ Running the MCP Server

Before running the solver, start the Social Media MCP server in a separate terminal:

uv run python src/mcp/social-media-mcp.py

The current publisher module is configured to use an MCP service at http://localhost:8010/mcp.


Usage

Run the solver from the project root:

uv run python src/app.py

Tech Stack

  • LangGraph / LangChain
  • Python 3.13
  • Rich
  • uv
  • FastMCP

References

About

This is an wordle solver agent once solves the wordle it shared the results in social media and also in New York Times Comments.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages