STS2-Agent  by CharTyr

AI agent for Slay the Spire 2 gameplay

Created 3 months ago
258 stars

Top 98.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project provides an AI agent framework for Slay the Spire 2 (STS2), exposing game state and actions via a local HTTP API wrapped as an MCP server. It targets AI developers and researchers, enabling direct interaction for automated gameplay, training, and agent development, offering a powerful tool for extending the game's capabilities with AI.

How It Works

A Slay the Spire 2 mod (STS2AIAgent) intercepts and exposes game state and actions through a local HTTP API. This API is then wrapped by an MCP (Modding Communication Protocol) server, available via stdio or HTTP. This architecture allows AI clients supporting MCP to directly interface with the game, facilitating complex agent workflows and advanced AI training pipelines.

Quick Start & Requirements

  1. Install Mod: Copy STS2AIAgent.dll, STS2AIAgent.pck, mod_id.json into the game's mods/ directory.
  2. Confirm Mod: Launch STS2 and verify http://127.0.0.1:8080/health is reachable.
  3. MCP Server: Requires Python 3.11+ and uv. Install uv (see README for OS-specific commands). Start the MCP server via scripts/start-mcp-stdio.sh (recommended) or scripts/start-mcp-network.ps1.
  4. Connect Client: Use uv run sts2-mcp-server for stdio or connect to http://127.0.0.1:8765/mcp for network.
  • Docs: MCP tool docs: mcp_server/README.md. Agent workflow: skills/sts2-mcp-player/SKILL.md.

Highlighted Details

  • Full MCP integration for STS2, enabling AI control over combat, rewards, shops, map routing, events, and more.
  • Provides enriched game state payloads (e.g., Ascension, act/boss IDs, enemy/move IDs) suitable for AI training like AlphaZero.
  • Features an atomic resolve_rewards action and uses SSE events to reduce polling overhead.
  • Serves live game metadata for cards, relics, monsters, potions, and events via the Mod API.
  • Supports layered planner/combat agent handoff and Ascension level control.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels were found in the provided README.

Licensing & Compatibility

Licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only). This strong copyleft license requires derivative works to be shared under the same terms, potentially impacting commercial use or integration with proprietary code.

Limitations & Caveats

Developer-only actions like run_console_command are disabled by default and not intended for general use. The FAQ highlights common connection issues, suggesting potential setup complexities. The project appears to be an active development effort, with features geared towards advanced AI training.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
2
Star History
27 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.