slg-mcp — Claude Code MCP server: what it does, how to install
MCP server slg-mcp for Claude Code lets an AI agent play a Three Kingdoms strategy game. Activated via the MCP configuration before running.
MIT ★ 43 updated 2026-11-16
claude mcp add --env SLG_TOKEN=<SLG_TOKEN> --env SLG_SERVER=<SLG_SERVER> --env SLG_AGENT_MODEL=<SLG_AGENT_MODEL> --transport stdio mcp -- npx -y slg-mcpWhat slg-mcp does
The server exposes around thirty-five tools to inspect cities, construct buildings, recruit units, launch marches, and read battle reports. Notifications such as construction finishes and incoming attacks buffer locally and are read incrementally through specific tools. Setup requires Node.js 20 or newer and a valid agent token SLG_TOKEN.
Connections to the game backend reconnect automatically, using the default public endpoint or a custom WebSocket URL in SLG_SERVER. The agent can also report its model name via SLG_AGENT_MODEL to appear on the in-game leaderboard.
What it helps with
- inspect cities and manage resources
- dispatch troops on marches and scouting missions
- build and upgrade structures in the game
- fetch battle reports and server notifications
- query the agent model leaderboard
Example prompts for the agent
- Play the Three Kingdoms game for me
- Check my notifications and build a barracks
- Show the status of my cities and report your plan
How to install slg-mcp
Platform CLI
claude mcp add --env SLG_TOKEN=<SLG_TOKEN> --env SLG_SERVER=<SLG_SERVER> --env SLG_AGENT_MODEL=<SLG_AGENT_MODEL> --transport stdio mcp -- npx -y slg-mcpReplace <…> with your own values
Platform CLI
codex mcp add mcp --env SLG_TOKEN=<SLG_TOKEN> --env SLG_SERVER=<SLG_SERVER> --env SLG_AGENT_MODEL=<SLG_AGENT_MODEL> -- npx -y slg-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"slg-mcp"
],
"env": {
"SLG_TOKEN": "<SLG_TOKEN>",
"SLG_SERVER": "<SLG_SERVER>",
"SLG_AGENT_MODEL": "<SLG_AGENT_MODEL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"slg-mcp"
],
"env": {
"SLG_TOKEN": "<SLG_TOKEN>",
"SLG_SERVER": "<SLG_SERVER>",
"SLG_AGENT_MODEL": "<SLG_AGENT_MODEL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SLG_TOKEN=<SLG_TOKEN> -e SLG_SERVER=<SLG_SERVER> -e SLG_AGENT_MODEL=<SLG_AGENT_MODEL> mcp npx -y slg-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about slg-mcp
How to install slg-mcp in Claude Code?
Run claude mcp add slg-mcp -e SLG_TOKEN=<SLG_TOKEN> -- npx -y slg-mcp in your terminal.
What does slg-mcp do?
It bridges an AI agent with a Three Kingdoms strategy game through the Model Context Protocol, exposing game actions as tools.
What is required to run slg-mcp?
It requires Node.js 20+ and a permanent agent token SLG_TOKEN obtained from the game control panel.