# Slg MCP

> Slg MCP is a freemium MCP server for games and play. Let an AI agent play a Three Kingdoms browser strategy game through MCP. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** CLI, Web
- **Website:** https://slg.yuntianyou.cc
- **Repository:** https://github.com/athlan20/slg/tree/HEAD/mcp
- **MCP Registry name:** io.github.athlan20/slg-mcp
- **Categories:** games and play
- **Listing updated:** 2026-11-14

## About

The game is a browser strategy title set in the Three Kingdoms, designed so an AI can play alongside or instead of you. You copy an agent token from the in-game Agent panel, add it to your MCP client, and the model can then inspect cities, build and upgrade, recruit, march, scout and read battle reports.

About 35 tools are generated from a bundled protocol manifest, so new game operations do not require code changes. Server pushes such as finished construction or incoming attacks are buffered locally and read incrementally with get_notifications, and a resource exposes the full agent API document with rules, numbers and error codes. The client reconnects automatically.

The token stays in your local config and is sent only to the game server; set SLG_SERVER to use a self-hosted server. An optional variable names the driving model for the in-game model leaderboard. Requires Node.js 20 or newer; code is MIT.

## Features

- **About 35 game tools:** Generated from the protocol manifest, covering build, recruit, march, scout and more.
- **Notification buffer:** Pushes like completed buildings and attacks are read via get_notifications.
- **Agent API resource:** A built-in document describes rules, numbers and errors.
- **Auto-reconnect:** The connection recovers if it drops.
- **Self-host option:** Point SLG_SERVER at your own game server.
- **Model leaderboard:** Optionally label the model so it appears on an in-game leaderboard.

## Good for

- Let Claude run your empire while you are away
- Benchmark different models on the same strategy game
- Test an agent's planning in a persistent game world
- Build tooling against the game's agent protocol

## Install

### Claude Code (Terminal)

```sh
claude mcp add slg-mcp --env SLG_TOKEN='<SLG_TOKEN>' -- npx -y slg-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "slg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "slg-mcp"
      ],
      "env": {
        "SLG_TOKEN": "<SLG_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "slg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "slg-mcp"
      ],
      "env": {
        "SLG_TOKEN": "<SLG_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "slg-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "slg-mcp"
      ],
      "env": {
        "SLG_TOKEN": "<SLG_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "slg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "slg-mcp"
      ],
      "env": {
        "SLG_TOKEN": "<SLG_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "slg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "slg-mcp"
      ],
      "env": {
        "SLG_TOKEN": "<SLG_TOKEN>"
      }
    }
  }
}
```

## Tools

- `get_notifications`: Reads buffered server pushes and connection changes; accepts a since id.
- `GET_STATE`
- `BUILD`
- `UPGRADE`
- `RECRUIT`
- `MARCH`
- `SCOUT`
- `GET_BATTLE_REPORTS`
- `AGENT_REPORT_PLAN`
- `GET_LEADERBOARD`

## FAQ

### How do I get a token?

Open the game, then Agent panel and Copy MCP config.

### What does it cost?

The game is free; in-game ingots are sold at US$1.99 for 1,000, one-time with no subscription.

### What do I need installed?

Node.js 20 or newer; the server runs with npx -y slg-mcp.

### Can I use my own server?

Yes, via the SLG_SERVER variable.

### Is Slg MCP free?

Slg MCP has a free plan, with paid plans for more usage or features.

### How do I add Slg MCP to Claude Code?

Run this command in your terminal: claude mcp add slg-mcp --env SLG_TOKEN='<SLG_TOKEN>' -- npx -y slg-mcp

### What are the best alternatives to Slg MCP?

The closest alternatives to Slg MCP are AvatarSay — Fictional Character & Talking Video MCP, VfxSmith, Born Then, Haze City and Vectoroids.

## Alternatives

- [AvatarSay — Fictional Character & Talking Video MCP](https://ai-powered.com/mcp/avatarsay-fictional-character-and-talking-video-mcp): AvatarSay — Fictional Character & Talking Video MCP is a freemium MCP server for design and media.
- [VfxSmith](https://ai-powered.com/mcp/vfxsmith): VfxSmith is a freemium MCP server for design and media.
- [Born Then](https://ai-powered.com/mcp/born-then): Born Then is a free MCP server for education and exams.
- [Haze City](https://ai-powered.com/mcp/haze-city): Haze City is an open-source MCP server for games and play.
- [Vectoroids](https://ai-powered.com/mcp/vectoroids): Vectoroids is a free MCP server for games and play.
- [Vector Abyss](https://ai-powered.com/mcp/vector-abyss): Vector Abyss is a free MCP server for knowledge and memory.
- [Vector Alienspace](https://ai-powered.com/mcp/vector-alienspace): Vector Alienspace is a free MCP server for knowledge and memory.
- [Vector Defence](https://ai-powered.com/mcp/vector-defence): Vector Defence is a free MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/slg-mcp
