CharTyr/STS2-Agent

杀戮尖塔2的MOD,将杀戮尖塔2的游戏状态与操作暴露为本地 HTTP API 包装成 MCP Server,供支持 MCP 的AI客户端直接调用

What it solves

This project provides an AI-powered companion and autonomous gameplay mod for Slay the Spire 2. It allows players to either have the game played automatically by an LLM or to play alongside an AI teammate in co-op mode, while also offering strategic advice through an in-game chat interface.

How it works

The mod integrates a C# based in-game overlay (accessible via F8) that connects to any OpenAI-compatible LLM endpoint (such as DeepSeek, OpenAI, or local models via Ollama). It uses a compact state engine to translate game data—like cards, energy, and enemy intents—into a format the AI can understand. For autonomous play, the AI evaluates the live state and dispatches actions. For co-op, the mod launches a second, isolated game instance to act as the AI's character. It also includes a FastMCP server and a local HTTP API to allow external agents like Cursor or Claude Desktop to interface with the game.

Who it’s for

  • Players who want to experiment with autonomous AI agents playing a deck-building game.
  • Co-op players looking for an AI teammate to coordinate with via natural language.
  • Developers who want to use the game as an environment for testing AI agents and agents' tool-calling abilities.

Highlights

  • Autonomous Auto-Play: Full run completion (combat, drafting, pathing) using text-only or vision-augmented models.
  • Local Co-op AI Teammate: One-click launch of a separate game instance for a coordinated AI partner.
  • In-Game Overlay UI: Direct configuration and control window within the game.
  • Budget Guards: Built-in token and request accounting to prevent unexpected API costs.
  • Developer Tools: Local HTTP API and FastMCP server for external agent integration.
  • Fault Recovery: Automatic circuit breakers and exponential backoff to prevent infinite loops during failures.

Related

  • Project
  • Project
  • Project
  • Project