defcon
LET AI PLAY GLOBAL THERMONUCLEAR WAR. This is an MCP Server for Introversion Software's 2007 game DEFCON.
claude mcp add --transport stdio jorisvddonk-defcon-mcp-server node mcp-server.mjs
How to use
This DEFCON MCP Server exposes a Model Context Protocol interface to coordinate an AI-driven DEFCON game session. The server runs the mcp-server.mjs entry point and supports both standard input/output (stdio) and HTTP transports for LLM integration. It reads game state from the DEFCON Lua bot via the defined input/output text files and writes commands for the Lua bot to execute, enabling an AI to interact with DEFCON through MCP prompts and tools. Available tools include sending chat messages, placing structures and fleets, launching nukes, drawing on the whiteboard, and querying game state or command results; prompts help the AI analyze the game state and propose optimal moves or targets. To begin, start DEFCON with the Lua bot set up, then run the MCP server and connect your LLM interface to the stdio or HTTP transport, configuring any input/output file paths as needed.
How to install
Prerequisites:
- Node.js (recommended latest LTS) and npm installed
- A DEFCON installation with the DEFCON AI API and LUABOT set up, as described in the README
- The DEFCON and LUABOT integration prepared to communicate via input.txt and output.txt
Installation steps:
-
Ensure DEFCON and LUABOT are installed and configured per the DEFCON MCP README.
-
Clone this repository into the luabot directory as described in the setup steps.
-
Install Node.js dependencies for the MCP server:
npm ci
-
Start DEFCON and the AI bot as described in the README to establish the in-game I/O paths (input.txt / output.txt).
-
Run the MCP server using Node.js:
node mcp-server.mjs
-
Connect your LLM or automation tool to the MCP server via stdio (default) or enable HTTP transport with:
node mcp-server.mjs --http
-
If you need to customize input/output file locations, pass them as CLI arguments, for example:
node mcp-server.mjs --inputfile="D:/input.txt" --outputfile="D:/output.txt"
Prerequisites recap: ensure you have a working DEFCON setup with LUABOT, npm installed, and the MCP server files in place before starting the server.
Additional notes
Notes and tips:
- This server is labeled work in progress; not all DEFCON commands may be available yet.
- The server communicates with the game via text files (input.txt and output.txt). You may adjust their locations via CLI arguments when launching the server.
- Transport options include stdio and HTTP; choose the one that matches your LLM integration setup.
- If you run into file path issues, ensure the DEFCON process has the correct permissions to read/write the input/output text files.
- The server provides a set of MCP tools (e.g., debug-log, send-chat, place-structure, launch-nuke) and resources/prompts to help guide the AI’s decisions. Use prompts like analyze-game-state and suggest-nuke-targets to craft strategic actions.
- For debugging, monitor the DEFCON game log and the MCP server logs to trace command correlations by their IDs.
Related MCP Servers
bitbucket
Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities
shadcn-ui
MCP server for shadcn/ui component references
advanced-homeassistant
An advanced MCP server for Home Assistant. 🔋 Batteries included.
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
website-publisher
AI Website builder and publisher MCP. Quickly publish and deploy your AI generated code as real website URL. Support html, css, js, python etc.